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

View file

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

View file

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