Permalink
Browse files

Merge pull request #4173 from Montellese/settings_fixes

Two settings related fixes
  • Loading branch information...
2 parents 8ffac13 + abca7fe commit 73371a9942056088a282f2e8704198278c96dd6c @t-nelson t-nelson committed Feb 11, 2014
View
3 system/settings/settings.xml
@@ -2702,9 +2702,8 @@
<category id="masterlock" label="12360" help="36395">
<access>CheckMasterLock</access>
<group id="1">
- <setting id="masterlock.lockcode" type="string" label="20100" help="36396">
+ <setting id="masterlock.lockcode" type="action" label="20100" help="36396">
<level>2</level>
- <default>-</default>
<control type="button" format="action">
<hidevalue>true</hidevalue>
</control>
View
8 xbmc/network/WakeOnAccess.cpp
@@ -635,18 +635,16 @@ void CWakeOnAccess::OnSettingsLoaded()
LoadFromXML();
}
-void CWakeOnAccess::OnSettingsSaved() const
+void CWakeOnAccess::OnSettingsSaved()
{
bool enabled = CSettings::Get().GetBool("powermanagement.wakeonaccess");
if (enabled != IsEnabled())
{
- CWakeOnAccess& woa = CWakeOnAccess::Get();
-
- woa.SetEnabled(enabled);
+ SetEnabled(enabled);
if (enabled)
- woa.QueueMACDiscoveryForAllRemotes();
+ QueueMACDiscoveryForAllRemotes();
}
}
View
2 xbmc/network/WakeOnAccess.h
@@ -35,7 +35,7 @@ class CWakeOnAccess : private IJobCallback, public ISettingsHandler
virtual void OnJobComplete(unsigned int jobID, bool success, CJob *job);
virtual void OnSettingsLoaded();
- virtual void OnSettingsSaved() const;
+ virtual void OnSettingsSaved();
// struct to keep per host settings
struct WakeUpEntry
View
4 xbmc/profiles/ProfilesManager.cpp
@@ -96,10 +96,10 @@ void CProfilesManager::OnSettingsLoaded()
CDirectory::Create(URIUtils::AddFileToFolder(strDir,"mixed"));
}
-bool CProfilesManager::OnSettingsSaved()
+void CProfilesManager::OnSettingsSaved()
{
// save mastercode
- return Save();
+ Save();
}
void CProfilesManager::OnSettingsCleared()
View
2 xbmc/profiles/ProfilesManager.h
@@ -33,7 +33,7 @@ class CProfilesManager : public ISettingsHandler
static CProfilesManager& Get();
virtual void OnSettingsLoaded();
- virtual bool OnSettingsSaved();
+ virtual void OnSettingsSaved();
virtual void OnSettingsCleared();
bool Load();
View
11 xbmc/settings/AdvancedSettings.cpp
@@ -834,11 +834,14 @@ void CAdvancedSettings::ParseSettingsFile(const CStdString &file)
{ // read the loglevel setting, so set the setting advanced to hide it in GUI
// as altering it will do nothing - we don't write to advancedsettings.xml
XMLUtils::GetInt(pRootElement, "loglevel", m_logLevelHint, LOG_LEVEL_NONE, LOG_LEVEL_MAX);
- CSettingBool *setting = (CSettingBool *)CSettings::Get().GetSetting("debug.showloginfo");
- if (setting != NULL)
+ const char* hide = pElement->Attribute("hide");
+ if (hide == NULL || strnicmp("false", hide, 4) != 0)
{
- const char* hide;
- if (!((hide = pElement->Attribute("hide")) && strnicmp("false", hide, 4) == 0))
+ CSetting *setting = CSettings::Get().GetSetting("debug.showloginfo");
+ if (setting != NULL)
+ setting->SetVisible(false);
+ setting = CSettings::Get().GetSetting("debug.setextraloglevel");
+ if (setting != NULL)
setting->SetVisible(false);
}
g_advancedSettings.m_logLevel = std::max(g_advancedSettings.m_logLevel, g_advancedSettings.m_logLevelHint);
View
2 xbmc/settings/lib/ISettingsHandler.h
@@ -52,7 +52,7 @@ class ISettingsHandler
This callback can be used to trigger saving other settings.
*/
- virtual void OnSettingsSaved() const { }
+ virtual void OnSettingsSaved() { }
/*!
\brief Setting values have been unloaded.

0 comments on commit 73371a9

Please sign in to comment.