refactor: remove need for configScope in diagnostic

This commit is contained in:
sithlord48 2025-03-14 22:48:13 -04:00 committed by Nick Bolton
parent 55f513941b
commit 7faf76c7df
4 changed files with 6 additions and 9 deletions

View file

@ -464,7 +464,7 @@ void MainWindow::clearSettings()
m_coreProcess.clearSettings(); m_coreProcess.clearSettings();
m_saveOnExit = false; m_saveOnExit = false;
diagnostic::clearSettings(m_configScopes, true); diagnostic::clearSettings(true);
} }
bool MainWindow::saveServerConfig() bool MainWindow::saveServerConfig()

View file

@ -139,7 +139,7 @@ int main(int argc, char *argv[])
const auto noReset = hasArg("--no-reset", arguments); const auto noReset = hasArg("--no-reset", arguments);
const auto resetEnvVar = strToTrue(qEnvironmentVariable("DESKFLOW_RESET_ALL")); const auto resetEnvVar = strToTrue(qEnvironmentVariable("DESKFLOW_RESET_ALL"));
if (resetEnvVar && !noReset) { if (resetEnvVar && !noReset) {
diagnostic::clearSettings(configScopes, false); diagnostic::clearSettings(false);
} }
MainWindow mainWindow(configScopes); MainWindow mainWindow(configScopes);

View file

@ -7,7 +7,6 @@
#include "diagnostic.h" #include "diagnostic.h"
#include "common/Settings.h" #include "common/Settings.h"
#include "config/ConfigScopes.h"
#include <QCoreApplication> #include <QCoreApplication>
#include <QDir> #include <QDir>
@ -30,14 +29,14 @@ void restart()
QCoreApplication::exit(); QCoreApplication::exit();
} }
void clearSettings(ConfigScopes &scopes, bool enableRestart) void clearSettings(bool enableRestart)
{ {
qDebug("clearing settings"); qDebug("clearing settings");
scopes.clear(); Settings::proxy().clear();
// save but do not emit saving signal which will prevent the current state of // save but do not emit saving signal which will prevent the current state of
// the app config and server configs from being applied. // the app config and server configs from being applied.
scopes.save(false); Settings::save(false);
auto profileDir = QDir(Settings::settingsPath()); auto profileDir = QDir(Settings::settingsPath());
qDebug("removing profile dir: %s", qPrintable(profileDir.absolutePath())); qDebug("removing profile dir: %s", qPrintable(profileDir.absolutePath()));

View file

@ -6,10 +6,8 @@
#pragma once #pragma once
#include "gui/config/ConfigScopes.h"
namespace deskflow::gui::diagnostic { namespace deskflow::gui::diagnostic {
void clearSettings(ConfigScopes &scopes, bool enableRestart); void clearSettings(bool enableRestart);
} }