refactor: remove use of configScopes from mainwindow

This commit is contained in:
sithlord48 2025-03-14 23:03:59 -04:00 committed by Nick Bolton
parent 7faf76c7df
commit 1b01a010ed
3 changed files with 4 additions and 13 deletions

View File

@ -17,7 +17,6 @@
#include "base/String.h"
#include "common/Settings.h"
#include "gui/Logger.h"
#include "gui/config/ConfigScopes.h"
#include "gui/constants.h"
#include "gui/core/CoreProcess.h"
#include "gui/diagnostic.h"
@ -59,9 +58,8 @@ using namespace deskflow::gui;
using CoreConnectionState = CoreProcess::ConnectionState;
using CoreProcessState = CoreProcess::ProcessState;
MainWindow::MainWindow(ConfigScopes &configScopes)
MainWindow::MainWindow()
: ui{std::make_unique<Ui::MainWindow>()},
m_configScopes(configScopes),
m_serverConfig(*this),
m_coreProcess(m_serverConfig),
m_serverConnection(this, m_serverConfig),
@ -140,13 +138,11 @@ MainWindow::MainWindow(ConfigScopes &configScopes)
setupTrayIcon();
m_configScopes.signalReady();
updateScreenName();
applyConfig();
restoreWindow();
qDebug().noquote() << "active settings path:" << m_configScopes.activeFilePath();
qDebug().noquote() << "active settings path:" << Settings::settingsPath();
updateSize();

View File

@ -18,7 +18,6 @@
#include "ServerConfig.h"
#include "VersionChecker.h"
#include "gui/config/ConfigScopes.h"
#include "gui/core/ClientConnection.h"
#include "gui/core/CoreProcess.h"
#include "gui/core/ServerConnection.h"
@ -73,7 +72,7 @@ public:
};
public:
explicit MainWindow(deskflow::gui::ConfigScopes &configScopes);
explicit MainWindow();
~MainWindow() override;
CoreMode coreMode() const
@ -187,7 +186,6 @@ private:
bool m_secureSocket = false;
bool m_saveOnExit = true;
deskflow::gui::core::WaylandWarnings m_waylandWarnings;
deskflow::gui::ConfigScopes &m_configScopes;
ServerConfig m_serverConfig;
deskflow::gui::CoreProcess m_coreProcess;
deskflow::gui::ServerConnection m_serverConnection;

View File

@ -9,7 +9,6 @@
#include "MainWindow.h"
#include "common/constants.h"
#include "gui/Logger.h"
#include "gui/config/ConfigScopes.h"
#include "gui/constants.h"
#include "gui/diagnostic.h"
#include "gui/dotenv.h"
@ -132,8 +131,6 @@ int main(int argc, char *argv[])
}
#endif
ConfigScopes configScopes;
// --no-reset
QStringList arguments = QCoreApplication::arguments();
const auto noReset = hasArg("--no-reset", arguments);
@ -142,7 +139,7 @@ int main(int argc, char *argv[])
diagnostic::clearSettings(false);
}
MainWindow mainWindow(configScopes);
MainWindow mainWindow;
mainWindow.open();
return QApplication::exec();