refactor: remove need for configScope in diagnostic
This commit is contained in:
@ -464,7 +464,7 @@ void MainWindow::clearSettings()
|
||||
m_coreProcess.clearSettings();
|
||||
|
||||
m_saveOnExit = false;
|
||||
diagnostic::clearSettings(m_configScopes, true);
|
||||
diagnostic::clearSettings(true);
|
||||
}
|
||||
|
||||
bool MainWindow::saveServerConfig()
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
#include "diagnostic.h"
|
||||
|
||||
#include "common/Settings.h"
|
||||
#include "config/ConfigScopes.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
@ -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()));
|
||||
|
||||
@ -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);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user