From 7faf76c7df0c89d964ae0107f776c3319dac1f5f Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Fri, 14 Mar 2025 22:48:13 -0400 Subject: [PATCH] refactor: remove need for configScope in diagnostic --- src/apps/deskflow-gui/MainWindow.cpp | 2 +- src/apps/deskflow-gui/main.cpp | 2 +- src/lib/gui/diagnostic.cpp | 7 +++---- src/lib/gui/diagnostic.h | 4 +--- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/apps/deskflow-gui/MainWindow.cpp b/src/apps/deskflow-gui/MainWindow.cpp index ac5b8d8e3..bcd1124a5 100644 --- a/src/apps/deskflow-gui/MainWindow.cpp +++ b/src/apps/deskflow-gui/MainWindow.cpp @@ -464,7 +464,7 @@ void MainWindow::clearSettings() m_coreProcess.clearSettings(); m_saveOnExit = false; - diagnostic::clearSettings(m_configScopes, true); + diagnostic::clearSettings(true); } bool MainWindow::saveServerConfig() diff --git a/src/apps/deskflow-gui/main.cpp b/src/apps/deskflow-gui/main.cpp index 610159c6c..0376bbbe8 100644 --- a/src/apps/deskflow-gui/main.cpp +++ b/src/apps/deskflow-gui/main.cpp @@ -139,7 +139,7 @@ int main(int argc, char *argv[]) const auto noReset = hasArg("--no-reset", arguments); const auto resetEnvVar = strToTrue(qEnvironmentVariable("DESKFLOW_RESET_ALL")); if (resetEnvVar && !noReset) { - diagnostic::clearSettings(configScopes, false); + diagnostic::clearSettings(false); } MainWindow mainWindow(configScopes); diff --git a/src/lib/gui/diagnostic.cpp b/src/lib/gui/diagnostic.cpp index a6f4771a0..242734b91 100644 --- a/src/lib/gui/diagnostic.cpp +++ b/src/lib/gui/diagnostic.cpp @@ -7,7 +7,6 @@ #include "diagnostic.h" #include "common/Settings.h" -#include "config/ConfigScopes.h" #include #include @@ -30,14 +29,14 @@ void restart() QCoreApplication::exit(); } -void clearSettings(ConfigScopes &scopes, bool enableRestart) +void clearSettings(bool enableRestart) { qDebug("clearing settings"); - scopes.clear(); + Settings::proxy().clear(); // save but do not emit saving signal which will prevent the current state of // the app config and server configs from being applied. - scopes.save(false); + Settings::save(false); auto profileDir = QDir(Settings::settingsPath()); qDebug("removing profile dir: %s", qPrintable(profileDir.absolutePath())); diff --git a/src/lib/gui/diagnostic.h b/src/lib/gui/diagnostic.h index a9f5c2348..164ddcdf0 100644 --- a/src/lib/gui/diagnostic.h +++ b/src/lib/gui/diagnostic.h @@ -6,10 +6,8 @@ #pragma once -#include "gui/config/ConfigScopes.h" - namespace deskflow::gui::diagnostic { -void clearSettings(ConfigScopes &scopes, bool enableRestart); +void clearSettings(bool enableRestart); }