diff --git a/src/apps/deskflow-gui/MainWindow.cpp b/src/apps/deskflow-gui/MainWindow.cpp index 5ae34e234..8f975465a 100644 --- a/src/apps/deskflow-gui/MainWindow.cpp +++ b/src/apps/deskflow-gui/MainWindow.cpp @@ -67,7 +67,7 @@ MainWindow::MainWindow(ConfigScopes &configScopes, AppConfig &appConfig) m_serverConfig(appConfig, *this), m_coreProcess(appConfig, m_serverConfig), m_serverConnection(this, appConfig, m_serverConfig, m_serverConfigDialogState), - m_clientConnection(this, appConfig), + m_clientConnection(this), m_tlsUtility(this), m_trayIcon{new QSystemTrayIcon(this)}, m_guiDupeChecker{new QLocalServer(this)}, diff --git a/src/lib/gui/core/ClientConnection.cpp b/src/lib/gui/core/ClientConnection.cpp index 571a07121..1758494c9 100644 --- a/src/lib/gui/core/ClientConnection.cpp +++ b/src/lib/gui/core/ClientConnection.cpp @@ -6,7 +6,7 @@ #include "ClientConnection.h" -#include "common/settings.h" +#include "common/Settings.h" #include "messages.h" #include diff --git a/src/lib/gui/core/ClientConnection.h b/src/lib/gui/core/ClientConnection.h index 3dc0c8537..a36c7e967 100644 --- a/src/lib/gui/core/ClientConnection.h +++ b/src/lib/gui/core/ClientConnection.h @@ -6,8 +6,6 @@ #pragma once -#include "gui/config/IAppConfig.h" - #include "gui/messages.h" #include @@ -30,11 +28,8 @@ public: virtual void showError(QWidget *parent, messages::ClientError error, const QString &address) const; }; - explicit ClientConnection( - QWidget *parent, IAppConfig &appConfig, std::shared_ptr deps = std::make_shared() - ) + explicit ClientConnection(QWidget *parent, std::shared_ptr deps = std::make_shared()) : m_pParent(parent), - m_appConfig(appConfig), m_deps(deps) { } @@ -52,7 +47,6 @@ private: void showMessage(const QString &logLine); QWidget *m_pParent; - IAppConfig &m_appConfig; std::shared_ptr m_deps; bool m_showMessage = true; }; diff --git a/src/test/unittests/gui/core/ClientConnectionTests.cpp b/src/test/unittests/gui/core/ClientConnectionTests.cpp index 68da00892..263941451 100644 --- a/src/test/unittests/gui/core/ClientConnectionTests.cpp +++ b/src/test/unittests/gui/core/ClientConnectionTests.cpp @@ -4,11 +4,9 @@ * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception */ -#include "common/settings.h" +#include "common/Settings.h" #include "gui/core/ClientConnection.h" -#include "shared/gui/mocks/AppConfigMock.h" - #include #include @@ -39,7 +37,6 @@ public: } std::shared_ptr m_pDeps = std::make_shared>(); - NiceMock m_appConfig; private: const QString stub = "stub"; @@ -47,7 +44,7 @@ private: TEST_F(ClientConnectionTests, handleLogLine_alreadyConnected_showError) { - ClientConnection clientConnection(nullptr, m_appConfig, m_pDeps); + ClientConnection clientConnection(nullptr, m_pDeps); const QString serverName = "test server"; Settings::setValue(Settings::Client::RemoteHost, serverName); @@ -62,7 +59,7 @@ TEST_F(ClientConnectionTests, handleLogLine_alreadyConnected_showError) TEST_F(ClientConnectionTests, handleLogLine_withHostname_showError) { - ClientConnection clientConnection(nullptr, m_appConfig, m_pDeps); + ClientConnection clientConnection(nullptr, m_pDeps); const QString serverName = "test hostname"; Settings::setValue(Settings::Client::RemoteHost, serverName); @@ -74,7 +71,7 @@ TEST_F(ClientConnectionTests, handleLogLine_withHostname_showError) TEST_F(ClientConnectionTests, handleLogLine_withIpAddress_showError) { - ClientConnection clientConnection(nullptr, m_appConfig, m_pDeps); + ClientConnection clientConnection(nullptr, m_pDeps); const QString serverName = "1.1.1.1"; Settings::setValue(Settings::Client::RemoteHost, serverName); @@ -86,7 +83,7 @@ TEST_F(ClientConnectionTests, handleLogLine_withIpAddress_showError) TEST_F(ClientConnectionTests, handleLogLine_messageShown_shouldNotShowAgain) { - ClientConnection clientConnection(nullptr, m_appConfig, m_pDeps); + ClientConnection clientConnection(nullptr, m_pDeps); clientConnection.handleLogLine("failed to connect to server"); @@ -97,7 +94,7 @@ TEST_F(ClientConnectionTests, handleLogLine_messageShown_shouldNotShowAgain) TEST_F(ClientConnectionTests, handleLogLine_serverRefusedClient_shouldNotShowError) { - ClientConnection clientConnection(nullptr, m_appConfig, m_pDeps); + ClientConnection clientConnection(nullptr, m_pDeps); EXPECT_CALL(*m_pDeps, showError(_, _, _)).Times(0); @@ -109,7 +106,7 @@ TEST_F(ClientConnectionTests, handleLogLine_serverRefusedClient_shouldNotShowErr TEST_F(ClientConnectionTests, handleLogLine_connected_shouldPreventFutureError) { - ClientConnection clientConnection(nullptr, m_appConfig, m_pDeps); + ClientConnection clientConnection(nullptr, m_pDeps); clientConnection.handleLogLine("connected to server"); EXPECT_CALL(*m_pDeps, showError(_, _, _)).Times(0); @@ -119,7 +116,7 @@ TEST_F(ClientConnectionTests, handleLogLine_connected_shouldPreventFutureError) TEST_F(ClientConnectionTests, handleLogLine_otherMessage_shouldNotShowError) { - ClientConnection clientConnection(nullptr, m_appConfig, m_pDeps); + ClientConnection clientConnection(nullptr, m_pDeps); EXPECT_CALL(*m_pDeps, showError(_, _, _)).Times(0);