chore: appconfig remove unused useinternalconfig option

This commit is contained in:
sithlord48 2025-03-11 18:02:57 -04:00 committed by Nick Bolton
parent af17b14224
commit 554178b658
2 changed files with 4 additions and 48 deletions

View file

@ -54,7 +54,7 @@ const char *const AppConfig::m_SettingsName[] = {
"", // kServerGroupChecked "", // kServerGroupChecked
"", // 21 = use external config moved to deskflow settings "", // 21 = use external config moved to deskflow settings
"", // 22 config file moved to dekflow settings "", // 22 config file moved to dekflow settings
"useInternalConfig", "", // 23 use internal config unsed, removed
"", // Client groupchecked "", // Client groupchecked
"", // 25 server host name moved to deskflow settings "", // 25 server host name moved to deskflow settings
"", // 26 cert path moved to deskflow settings "", // 26 cert path moved to deskflow settings
@ -93,7 +93,6 @@ void AppConfig::recall()
qDebug("recalling app config"); qDebug("recalling app config");
recallFromAllScopes(); recallFromAllScopes();
recallFromCurrentScope();
} }
void AppConfig::recallFromAllScopes() void AppConfig::recallFromAllScopes()
@ -102,13 +101,6 @@ void AppConfig::recallFromAllScopes()
m_LoadFromSystemScope = findInAllScopes(kLoadSystemSettings, m_LoadFromSystemScope).toBool(); m_LoadFromSystemScope = findInAllScopes(kLoadSystemSettings, m_LoadFromSystemScope).toBool();
} }
void AppConfig::recallFromCurrentScope()
{
using enum Setting;
m_UseInternalConfig = getFromCurrentScope(kUseInternalConfig, m_UseInternalConfig).toBool();
}
void AppConfig::commit() void AppConfig::commit()
{ {
using enum Setting; using enum Setting;
@ -116,10 +108,6 @@ void AppConfig::commit()
qDebug("committing app config"); qDebug("committing app config");
saveToAllScopes(kLoadSystemSettings, m_LoadFromSystemScope); saveToAllScopes(kLoadSystemSettings, m_LoadFromSystemScope);
if (isActiveScopeWritable()) {
setInCurrentScope(kUseInternalConfig, m_UseInternalConfig);
}
} }
void AppConfig::determineScope() void AppConfig::determineScope()
@ -145,7 +133,7 @@ void AppConfig::determineScope()
// ...failing that, check the system scope instead to see if an arbitrary // ...failing that, check the system scope instead to see if an arbitrary
// required setting is present. if it is, then we can assume that the system // required setting is present. if it is, then we can assume that the system
// scope should be used. // scope should be used.
else if (m_Scopes.scopeContains(settingName(Setting::kUseInternalConfig), ConfigScopes::Scope::System)) { else if (m_Scopes.scopeContains(settingName(Setting::kLoadSystemSettings), ConfigScopes::Scope::System)) {
qDebug("system settings scope contains screen name, using system scope"); qDebug("system settings scope contains screen name, using system scope");
setLoadFromSystemScope(true); setLoadFromSystemScope(true);
} }
@ -238,7 +226,7 @@ void AppConfig::loadScope(ConfigScopes::Scope scope)
// only signal ready if there is at least one setting in the required scope. // only signal ready if there is at least one setting in the required scope.
// this prevents the current settings from being set back to default. // this prevents the current settings from being set back to default.
if (m_Scopes.scopeContains(settingName(Setting::kUseInternalConfig), m_Scopes.activeScope())) { if (m_Scopes.scopeContains(settingName(Setting::kLoadSystemSettings), m_Scopes.activeScope())) {
m_Scopes.signalReady(); m_Scopes.signalReady();
} else { } else {
qDebug("no screen name in scope, skipping"); qDebug("no screen name in scope, skipping");
@ -278,24 +266,6 @@ IConfigScopes &AppConfig::scopes() const
return m_Scopes; return m_Scopes;
} }
bool AppConfig::useInternalConfig() const
{
return m_UseInternalConfig;
}
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// End getters // End getters
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Begin setters
///////////////////////////////////////////////////////////////////////////////
void AppConfig::setUseInternalConfig(bool newValue)
{
m_UseInternalConfig = newValue;
}
///////////////////////////////////////////////////////////////////////////////
// End setters
///////////////////////////////////////////////////////////////////////////////

View file

@ -61,7 +61,7 @@ private:
// kServerGroupChecked = 20, // kServerGroupChecked = 20,
// 21 = use external config moved to deskflow settings // 21 = use external config moved to deskflow settings
// 22 = k config file moved to deskflow settings // 22 = k config file moved to deskflow settings
kUseInternalConfig = 23, // 23 kUseInternalConfig removed
// kClientGroupChecked = 24, // kClientGroupChecked = 24,
// 25 = serverHostName moved to deskflow settings // 25 = serverHostName moved to deskflow settings
// 26 = kTlsCertPath moved to deskflow settings // 26 = kTlsCertPath moved to deskflow settings
@ -111,18 +111,6 @@ public:
bool isActiveScopeWritable() const override; bool isActiveScopeWritable() const override;
bool isActiveScopeSystem() const override; bool isActiveScopeSystem() const override;
//
// Getters (new methods)
//
bool useInternalConfig() const;
//
// Setters (new methods)
//
void setUseInternalConfig(bool);
/// @brief Sets the user preference to load from SystemScope. /// @brief Sets the user preference to load from SystemScope.
/// @param [in] value /// @param [in] value
/// True - This will set the variable and load the global scope /// True - This will set the variable and load the global scope
@ -136,7 +124,6 @@ private:
void recall(); void recall();
void recallScreenName(); void recallScreenName();
void recallFromAllScopes(); void recallFromAllScopes();
void recallFromCurrentScope();
/** /**
* @brief Loads a setting if it exists, otherwise returns `std::nullopt` * @brief Loads a setting if it exists, otherwise returns `std::nullopt`
@ -179,7 +166,6 @@ private:
/// @brief Contains the string values of the settings names that will be saved /// @brief Contains the string values of the settings names that will be saved
static const char *const m_SettingsName[]; static const char *const m_SettingsName[];
bool m_UseInternalConfig = false;
bool m_LoadFromSystemScope = false; bool m_LoadFromSystemScope = false;
deskflow::gui::IConfigScopes &m_Scopes; deskflow::gui::IConfigScopes &m_Scopes;