1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-26 04:32:35 +01:00

Remove deprecated user management code

This commit is contained in:
Megamouse 2021-04-10 11:11:08 +02:00
parent 86ddc00bb1
commit 5b0dac797c
4 changed files with 7 additions and 24 deletions

View File

@ -67,11 +67,8 @@ bool gui_application::Init()
// The user might be set by cli arg. If not, set another user.
if (m_active_user.empty())
{
// Get deprecated active user (before August 2nd 2020)
const QString active_user = m_gui_settings->GetValue(gui::um_active_user).toString();
// Get active user with deprecated active user as fallback
m_active_user = m_persistent_settings->GetCurrentUser(active_user.isEmpty() ? "00000001" : active_user).toStdString();
// Get active user with standard user as fallback
m_active_user = m_persistent_settings->GetCurrentUser("00000001").toStdString();
}
// Force init the emulator

View File

@ -230,7 +230,6 @@ namespace gui
const gui_save sd_icon_color = gui_save(savedata, "icon_color", gl_icon_color);
const gui_save um_geometry = gui_save(users, "geometry", QByteArray());
const gui_save um_active_user = gui_save(users, "active_user", ""); // Deprecated
const gui_save loc_language = gui_save(localization, "language", "en");

View File

@ -1,6 +1,7 @@
#include "persistent_settings.h"
#include "util/logs.hpp"
#include "Emu/System.h"
LOG_CHANNEL(cfg_log, "CFG");
@ -47,15 +48,12 @@ QString persistent_settings::GetCurrentUser(const QString& fallback) const
user = fallback;
}
bool is_valid_user;
const u32 user_id = user.toInt(&is_valid_user);
// Set user if valid
if (is_valid_user && user_id > 0)
if (Emulator::CheckUsr(user.toStdString()) > 0)
{
return user;
}
cfg_log.fatal("Could not parse user setting: '%s' = '%d'.", user.toStdString(), user_id);
cfg_log.fatal("Could not parse user setting: '%s'.", user.toStdString());
return QString();
}

View File

@ -88,19 +88,8 @@ void user_manager_dialog::Init()
vbox_main->addLayout(hbox_buttons);
setLayout(vbox_main);
m_active_user = m_persistent_settings->GetValue(gui::persistent::active_user).toString().toStdString();
// Handle deprecated value (before August 2nd 2020)
if (m_active_user.empty())
{
m_active_user = m_gui_settings->GetValue(gui::um_active_user).toString().toStdString();
m_gui_settings->RemoveValue(gui::um_active_user);
if (!m_active_user.empty())
{
m_persistent_settings->SetValue(gui::persistent::active_user, qstr(m_active_user));
}
}
// Get the active user
m_active_user = m_persistent_settings->GetCurrentUser("00000001").toStdString();
// Get the real active user (might differ, set by cli)
if (m_active_user != Emu.GetUsr())