user_manager: megamouse fixes 3

This commit is contained in:
Megamouse 2018-07-23 23:55:27 +02:00 committed by Ivan
parent 9ca8ec8ec7
commit e58b7cbe1f
13 changed files with 98 additions and 44 deletions

View file

@ -18,6 +18,23 @@ gui_settings::~gui_settings()
m_settings.sync();
}
QString gui_settings::GetCurrentUser()
{
// load user
bool is_valid_user;
const QString user = GetValue(gui::um_active_user).toString();
const u32 user_id = user.toInt(&is_valid_user);
// set user if valid
if (is_valid_user && user_id > 0)
{
return user;
}
LOG_FATAL(GENERAL, "Could not parse user setting: '%s' = '%d'.", user.toStdString(), user_id);
return QString();
}
QString gui_settings::GetSettingsDir()
{
return m_settingsDir.absolutePath();