aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Kaijser <martijn@xbmc.org>2016-01-25 18:28:55 +0100
committerMartijn Kaijser <martijn@xbmc.org>2016-01-25 18:28:55 +0100
commit8c5794d91f16e82587c731b7b04e2310727e6076 (patch)
tree63846f7f027657d7741d1cad006b03a726457133
parentccb2226cbe0aad8a420ea54d728917ad53567eb8 (diff)
parentd52dfebf1a7fa1ed89a8d9fb8021b603246b4e44 (diff)
Merge pull request #8947 from Montellese/Jarvis_fix_profile_switching
[jarvis][profiles] don't save skin settings on master profile when it was only loaded to switch between two other profiles
-rw-r--r--xbmc/profiles/ProfilesManager.cpp20
-rw-r--r--xbmc/profiles/ProfilesManager.h1
2 files changed, 17 insertions, 4 deletions
diff --git a/xbmc/profiles/ProfilesManager.cpp b/xbmc/profiles/ProfilesManager.cpp
index 394e88dd1b..86db51a413 100644
--- a/xbmc/profiles/ProfilesManager.cpp
+++ b/xbmc/profiles/ProfilesManager.cpp
@@ -71,8 +71,12 @@ using namespace XFILE;
static CProfile EmptyProfile;
CProfilesManager::CProfilesManager()
- : m_usingLoginScreen(false), m_autoLoginProfile(-1), m_lastUsedProfile(0),
- m_currentProfile(0), m_nextProfileId(0)
+ : m_usingLoginScreen(false),
+ m_profileLoadedForLogin(false),
+ m_autoLoginProfile(-1),
+ m_lastUsedProfile(0),
+ m_currentProfile(0),
+ m_nextProfileId(0)
{ }
CProfilesManager::~CProfilesManager()
@@ -221,6 +225,7 @@ void CProfilesManager::Clear()
{
CSingleLock lock(m_critical);
m_usingLoginScreen = false;
+ m_profileLoadedForLogin = false;
m_lastUsedProfile = 0;
m_nextProfileId = 0;
SetCurrentProfileId(0);
@@ -238,14 +243,16 @@ bool CProfilesManager::LoadProfile(size_t index)
if (m_currentProfile == index)
return true;
- // save any settings of the currently used skin
- if (g_SkinInfo != nullptr)
+ // save any settings of the currently used skin but only if the (master)
+ // profile hasn't just been loaded as a temporary profile for login
+ if (g_SkinInfo != nullptr && !m_profileLoadedForLogin)
g_SkinInfo->SaveSettings();
// unload any old settings
CSettings::GetInstance().Unload();
SetCurrentProfileId(index);
+ m_profileLoadedForLogin = false;
// load the new settings
if (!CSettings::GetInstance().Load())
@@ -427,7 +434,12 @@ void CProfilesManager::LoadMasterProfileForLogin()
// save the previous user
m_lastUsedProfile = m_currentProfile;
if (m_currentProfile != 0)
+ {
LoadProfile(0);
+
+ // remember that the (master) profile has only been loaded for login
+ m_profileLoadedForLogin = true;
+ }
}
bool CProfilesManager::GetProfileName(const size_t profileId, std::string& name) const
diff --git a/xbmc/profiles/ProfilesManager.h b/xbmc/profiles/ProfilesManager.h
index f67ee04fa2..f0bcab87ed 100644
--- a/xbmc/profiles/ProfilesManager.h
+++ b/xbmc/profiles/ProfilesManager.h
@@ -190,6 +190,7 @@ private:
std::vector<CProfile> m_profiles;
bool m_usingLoginScreen;
+ bool m_profileLoadedForLogin;
int m_autoLoginProfile;
uint32_t m_lastUsedProfile;
uint32_t m_currentProfile; // do not modify directly, use SetCurrentProfileId() function instead