From 1b01a010edee295ea719fd85ad1c4a5bc1afb5d7 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Fri, 14 Mar 2025 23:03:59 -0400 Subject: [PATCH] refactor: remove use of configScopes from mainwindow --- src/apps/deskflow-gui/MainWindow.cpp | 8 ++------ src/apps/deskflow-gui/MainWindow.h | 4 +--- src/apps/deskflow-gui/main.cpp | 5 +---- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/apps/deskflow-gui/MainWindow.cpp b/src/apps/deskflow-gui/MainWindow.cpp index bcd1124a55..5c9e299931 100644 --- a/src/apps/deskflow-gui/MainWindow.cpp +++ b/src/apps/deskflow-gui/MainWindow.cpp @@ -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()}, - 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(); diff --git a/src/apps/deskflow-gui/MainWindow.h b/src/apps/deskflow-gui/MainWindow.h index a9ed4fe7b6..501ba64acd 100644 --- a/src/apps/deskflow-gui/MainWindow.h +++ b/src/apps/deskflow-gui/MainWindow.h @@ -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; diff --git a/src/apps/deskflow-gui/main.cpp b/src/apps/deskflow-gui/main.cpp index 0376bbbe8f..242389fb76 100644 --- a/src/apps/deskflow-gui/main.cpp +++ b/src/apps/deskflow-gui/main.cpp @@ -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();