From 554178b65846715309d99421237d49a029ec61b5 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Tue, 11 Mar 2025 18:02:57 -0400 Subject: [PATCH] chore: appconfig remove unused useinternalconfig option --- src/lib/gui/config/AppConfig.cpp | 36 +++----------------------------- src/lib/gui/config/AppConfig.h | 16 +------------- 2 files changed, 4 insertions(+), 48 deletions(-) diff --git a/src/lib/gui/config/AppConfig.cpp b/src/lib/gui/config/AppConfig.cpp index ea7c6e127..0fd08a798 100644 --- a/src/lib/gui/config/AppConfig.cpp +++ b/src/lib/gui/config/AppConfig.cpp @@ -54,7 +54,7 @@ const char *const AppConfig::m_SettingsName[] = { "", // kServerGroupChecked "", // 21 = use external config moved to deskflow settings "", // 22 config file moved to dekflow settings - "useInternalConfig", + "", // 23 use internal config unsed, removed "", // Client groupchecked "", // 25 server host name moved to deskflow settings "", // 26 cert path moved to deskflow settings @@ -93,7 +93,6 @@ void AppConfig::recall() qDebug("recalling app config"); recallFromAllScopes(); - recallFromCurrentScope(); } void AppConfig::recallFromAllScopes() @@ -102,13 +101,6 @@ void AppConfig::recallFromAllScopes() m_LoadFromSystemScope = findInAllScopes(kLoadSystemSettings, m_LoadFromSystemScope).toBool(); } -void AppConfig::recallFromCurrentScope() -{ - using enum Setting; - - m_UseInternalConfig = getFromCurrentScope(kUseInternalConfig, m_UseInternalConfig).toBool(); -} - void AppConfig::commit() { using enum Setting; @@ -116,10 +108,6 @@ void AppConfig::commit() qDebug("committing app config"); saveToAllScopes(kLoadSystemSettings, m_LoadFromSystemScope); - - if (isActiveScopeWritable()) { - setInCurrentScope(kUseInternalConfig, m_UseInternalConfig); - } } void AppConfig::determineScope() @@ -145,7 +133,7 @@ void AppConfig::determineScope() // ...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 // 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"); 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. // 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(); } else { qDebug("no screen name in scope, skipping"); @@ -278,24 +266,6 @@ IConfigScopes &AppConfig::scopes() const return m_Scopes; } -bool AppConfig::useInternalConfig() const -{ - return m_UseInternalConfig; -} - /////////////////////////////////////////////////////////////////////////////// // End getters /////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// Begin setters -/////////////////////////////////////////////////////////////////////////////// - -void AppConfig::setUseInternalConfig(bool newValue) -{ - m_UseInternalConfig = newValue; -} - -/////////////////////////////////////////////////////////////////////////////// -// End setters -/////////////////////////////////////////////////////////////////////////////// diff --git a/src/lib/gui/config/AppConfig.h b/src/lib/gui/config/AppConfig.h index 95f167e08..9aeed1dbe 100644 --- a/src/lib/gui/config/AppConfig.h +++ b/src/lib/gui/config/AppConfig.h @@ -61,7 +61,7 @@ private: // kServerGroupChecked = 20, // 21 = use external config moved to deskflow settings // 22 = k config file moved to deskflow settings - kUseInternalConfig = 23, + // 23 kUseInternalConfig removed // kClientGroupChecked = 24, // 25 = serverHostName moved to deskflow settings // 26 = kTlsCertPath moved to deskflow settings @@ -111,18 +111,6 @@ public: bool isActiveScopeWritable() 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. /// @param [in] value /// True - This will set the variable and load the global scope @@ -136,7 +124,6 @@ private: void recall(); void recallScreenName(); void recallFromAllScopes(); - void recallFromCurrentScope(); /** * @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 static const char *const m_SettingsName[]; - bool m_UseInternalConfig = false; bool m_LoadFromSystemScope = false; deskflow::gui::IConfigScopes &m_Scopes;