@@ -55,17 +57,10 @@ void dotenv(const QString &filename) {
"no %s file in dir: %s", qPrintable(filename),
qPrintable(fileInfo.absolutePath()));
- // if nothing in current dir, then try the app data dir.
+ // if nothing in current dir, then try the config dir.
// this makes it a bit easier for engineers in the field to have an easily
// predictable location for the .env file.
- QDir configDir(
- QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation));
-
- // HACK: since we have the org name set to the app name, the config dir is
- // confusing. make this simple by using the org dir instead.
- // use `filePath("..")` instead of `cdUp` to avoid the existence check.
- QDir orgDir = configDir.filePath("..");
- orgDir = orgDir.absolutePath();
+ const auto orgDir = paths::configDir();
filePath = orgDir.filePath(filename);
if (!open(file, filePath)) {
diff --git a/src/lib/gui/messages.cpp b/src/lib/gui/messages.cpp
index 36e413a45..56ac6f28c 100644
--- a/src/lib/gui/messages.cpp
+++ b/src/lib/gui/messages.cpp
@@ -249,4 +249,17 @@ showNewClientPrompt(QWidget *parent, const QString &clientName) {
}
}
+bool showClearSettings(QWidget *parent) {
+ QMessageBox message(parent);
+ message.addButton(QObject::tr("Cancel"), QMessageBox::RejectRole);
+ const auto clear =
+ message.addButton(QObject::tr("Clear settings"), QMessageBox::AcceptRole);
+ message.setText(
+ "Are you sure you want to clear all settings and restart Synergy?
"
+ "This action cannot be undone.
");
+ message.exec();
+
+ return message.clickedButton() == clear;
+}
+
} // namespace synergy::gui::messages
diff --git a/src/lib/gui/messages.h b/src/lib/gui/messages.h
index 9c20f3f11..18a82be2a 100644
--- a/src/lib/gui/messages.h
+++ b/src/lib/gui/messages.h
@@ -46,4 +46,6 @@ void showClientConnectError(
NewClientPromptResult
showNewClientPrompt(QWidget *parent, const QString &clientName);
+bool showClearSettings(QWidget *parent);
+
} // namespace synergy::gui::messages
diff --git a/src/lib/gui/paths.h b/src/lib/gui/paths.h
new file mode 100644
index 000000000..796ba7eca
--- /dev/null
+++ b/src/lib/gui/paths.h
@@ -0,0 +1,67 @@
+/*
+ * synergy -- mouse and keyboard sharing utility
+ * Copyright (C) 2024 Symless Ltd.
+ *
+ * This package is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * found in the file LICENSE that should have accompanied this file.
+ *
+ * This package is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#pragma once
+
+#include "core/CoreTool.h"
+
+#include
+#include
+#include
+
+const auto kCertificateFilename = "Synergy.pem";
+const auto kSslDir = "SSL";
+
+namespace synergy::gui::paths {
+
+/**
+ * @brief Gets the org config dir (parent of app config dir).
+ */
+inline QDir configDir(const bool persist = false) {
+ const QDir configDir(
+ QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation));
+
+ // HACK: since we have the org name set to the app name, the config dir is
+ // confusing. make this simple by using the org dir instead.
+ // use `filePath("..")` instead of `cdUp` to avoid the existence check.
+ const QDir orgDir = configDir.filePath("..");
+
+ if (persist) {
+ const auto orgDirPath = orgDir.absolutePath();
+ if (!QDir().mkpath(orgDirPath)) {
+ qFatal("failed to persist config dir: %s", qPrintable(orgDirPath));
+ }
+ }
+
+ return orgDir.absolutePath();
+}
+
+/**
+ * @brief Uses the Core tool to get the profile dir.
+ */
+inline QDir coreProfileDir() {
+ CoreTool coreTool;
+ return QDir(coreTool.getProfileDir());
+}
+
+inline QString defaultTlsCertPath() {
+ const auto root = coreProfileDir();
+ const auto sslDirPath = QDir(root.filePath(kSslDir));
+ return sslDirPath.filePath(kCertificateFilename);
+}
+
+} // namespace synergy::gui::paths
diff --git a/src/lib/gui/proxy/QSettingsProxy.h b/src/lib/gui/proxy/QSettingsProxy.h
index 51ff1ce9e..fb54bb1fe 100644
--- a/src/lib/gui/proxy/QSettingsProxy.h
+++ b/src/lib/gui/proxy/QSettingsProxy.h
@@ -29,7 +29,7 @@ public:
virtual void loadUser();
virtual void loadSystem();
-
+ virtual void clear() { m_pSettings->clear(); }
virtual void sync() { m_pSettings->sync(); }
virtual int beginReadArray(const QString &prefix);
virtual void beginWriteArray(const QString &prefix);
diff --git a/src/lib/gui/tls/TlsCertificate.cpp b/src/lib/gui/tls/TlsCertificate.cpp
index a9267c471..bcc89d0d4 100644
--- a/src/lib/gui/tls/TlsCertificate.cpp
+++ b/src/lib/gui/tls/TlsCertificate.cpp
@@ -18,18 +18,16 @@
#include "TlsCertificate.h"
#include "TlsFingerprint.h"
+#include "gui/paths.h"
#include
#include
#include
-#include
static const char *const kCertificateKeyLength = "rsa:";
static const char *const kCertificateHashAlgorithm = "-sha256";
static const char *const kCertificateLifetime = "365";
static const char *const kCertificateSubjectInfo = "/CN=Synergy";
-static const char *const kCertificateFilename = "Synergy.pem";
-static const char *const kSslDir = "SSL";
#if defined(Q_OS_WIN)
static const char *const kWinOpenSslDir = "OpenSSL";
@@ -39,6 +37,8 @@ static const char *const kConfigFile = "synergy.conf";
static const char *const kUnixOpenSslCommand = "openssl";
#endif
+using namespace synergy::gui;
+
#if defined(Q_OS_WIN)
namespace synergy::gui {
@@ -87,12 +87,7 @@ using namespace synergy::gui;
#endif
-TlsCertificate::TlsCertificate(QObject *parent) : QObject(parent) {
- m_profileDir = m_coreTool.getProfileDir();
- if (m_profileDir.isEmpty()) {
- qCritical("empty profile directory result");
- }
-}
+TlsCertificate::TlsCertificate(QObject *parent) : QObject(parent) {}
bool TlsCertificate::runTool(const QStringList &args) {
QString program;
@@ -157,21 +152,17 @@ bool TlsCertificate::runTool(const QStringList &args) {
}
bool TlsCertificate::generateCertificate(const QString &path, int keyLength) {
- QString sslDirPath =
- QString("%1%2%3").arg(m_profileDir).arg(QDir::separator()).arg(kSslDir);
+ qDebug("generating tls certificate: %s", qUtf8Printable(path));
- QString defaultPath = QString("%1%2%3")
- .arg(sslDirPath)
- .arg(QDir::separator())
- .arg(kCertificateFilename);
+ QFileInfo info(path);
+ QDir dir(info.absolutePath());
+ if (!dir.exists() && !dir.mkpath(".")) {
+ qCritical("failed to create directory for tls certificate");
+ return false;
+ }
QString keySize = kCertificateKeyLength + QString::number(keyLength);
- const QString pathToUse =
- QDir::cleanPath(path.isEmpty() ? defaultPath : path);
-
- qDebug("generating tls certificate: %s", qUtf8Printable(pathToUse));
-
QStringList arguments;
// self signed certificate
@@ -179,7 +170,7 @@ bool TlsCertificate::generateCertificate(const QString &path, int keyLength) {
arguments.append("-x509");
arguments.append("-nodes");
- // valide duration
+ // valid duration
arguments.append("-days");
arguments.append(kCertificateLifetime);
@@ -193,22 +184,18 @@ bool TlsCertificate::generateCertificate(const QString &path, int keyLength) {
arguments.append("-newkey");
arguments.append(keySize);
- if (QDir sslDir(sslDirPath); !sslDir.exists()) {
- sslDir.mkpath(".");
- }
-
// key output filename
arguments.append("-keyout");
- arguments.append(pathToUse);
+ arguments.append(path);
// certificate output filename
arguments.append("-out");
- arguments.append(pathToUse);
+ arguments.append(path);
if (runTool(arguments)) {
qDebug("tls certificate generated");
- return generateFingerprint(pathToUse);
+ return generateFingerprint(path);
} else {
qCritical("failed to generate tls certificate");
return false;
diff --git a/src/lib/gui/tls/TlsCertificate.h b/src/lib/gui/tls/TlsCertificate.h
index dbb5a858e..86823d5a0 100644
--- a/src/lib/gui/tls/TlsCertificate.h
+++ b/src/lib/gui/tls/TlsCertificate.h
@@ -35,7 +35,6 @@ private:
bool generateFingerprint(const QString &certificateFilename);
private:
- QString m_profileDir;
QString m_toolStdout;
[[no_unique_address]] CoreTool m_coreTool;
};
diff --git a/src/lib/gui/tls/TlsUtility.cpp b/src/lib/gui/tls/TlsUtility.cpp
index a30526dfc..ebe20a423 100644
--- a/src/lib/gui/tls/TlsUtility.cpp
+++ b/src/lib/gui/tls/TlsUtility.cpp
@@ -20,12 +20,13 @@
#include "TlsCertificate.h"
#include "constants.h"
+#include
#include
namespace synergy::gui {
TlsUtility::TlsUtility(
- const IAppConfig &appConfig, const license::License &license)
+ const IAppConfig &appConfig, const license::ILicense &license)
: m_appConfig(appConfig),
m_license(license) {}
@@ -48,10 +49,20 @@ bool TlsUtility::generateCertificate() {
return false;
}
- auto path = m_appConfig.tlsCertPath();
auto length = m_appConfig.tlsKeyLength();
- return m_certificate.generateCertificate(path, length);
+ return m_certificate.generateCertificate(m_appConfig.tlsCertPath(), length);
+}
+
+bool TlsUtility::persistCertificate() {
+ qDebug("persisting tls certificate");
+
+ if (QFile::exists(m_appConfig.tlsCertPath())) {
+ qDebug("tls certificate already exists");
+ return true;
+ }
+
+ return generateCertificate();
}
} // namespace synergy::gui
diff --git a/src/lib/gui/tls/TlsUtility.h b/src/lib/gui/tls/TlsUtility.h
index 4c0ecb819..575039801 100644
--- a/src/lib/gui/tls/TlsUtility.h
+++ b/src/lib/gui/tls/TlsUtility.h
@@ -31,9 +31,10 @@ class TlsUtility : public QObject {
public:
explicit TlsUtility(
- const IAppConfig &appConfig, const license::License &license);
+ const IAppConfig &appConfig, const license::ILicense &license);
bool generateCertificate();
+ bool persistCertificate();
/**
* @brief Combines the availability and the enabled status of TLS.
@@ -51,7 +52,7 @@ public:
private:
const IAppConfig &m_appConfig;
- const license::License &m_license;
+ const license::ILicense &m_license;
TlsCertificate m_certificate;
};
diff --git a/src/lib/license/ILicense.h b/src/lib/license/ILicense.h
new file mode 100644
index 000000000..f6d699e9b
--- /dev/null
+++ b/src/lib/license/ILicense.h
@@ -0,0 +1,32 @@
+/*
+ * synergy -- mouse and keyboard sharing utility
+ * Copyright (C) 2016 Symless Ltd.
+ *
+ * This package is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * found in the file LICENSE that should have accompanied this file.
+ *
+ * This package is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#pragma once
+
+class Server;
+class LicenseHandler;
+class LicenseTests;
+
+namespace synergy::license {
+
+class ILicense {
+public:
+ virtual ~ILicense() = default;
+ virtual bool isTlsAvailable() const = 0;
+};
+
+} // namespace synergy::license
diff --git a/src/lib/license/License.h b/src/lib/license/License.h
index 18576166b..83ce3f84d 100644
--- a/src/lib/license/License.h
+++ b/src/lib/license/License.h
@@ -17,6 +17,7 @@
#pragma once
+#include "ILicense.h"
#include "SerialKey.h"
#include
@@ -30,7 +31,7 @@ class LicenseTests;
namespace synergy::license {
-class License {
+class License : public ILicense {
friend class ::Server;
friend class ::LicenseHandler;
friend class ::LicenseTests;
@@ -44,18 +45,20 @@ class License {
public:
explicit License(const SerialKey &serialKey);
explicit License(const std::string &hexString);
+ ~License() override = default;
friend bool operator==(License const &lhs, License const &rhs) {
return lhs.m_serialKey == rhs.m_serialKey;
}
+ bool isTlsAvailable() const override;
+
bool isValid() const { return m_serialKey.isValid; }
bool isExpiringSoon() const;
bool isExpired() const;
bool isTrial() const;
bool isSubscription() const;
bool isTimeLimited() const;
- bool isTlsAvailable() const;
days daysLeft() const;
Edition productEdition() const;
std::string productName() const;
diff --git a/src/lib/net/InverseSockets/SecureServerSocket.cpp b/src/lib/net/InverseSockets/SecureServerSocket.cpp
index de2c46f92..49f393d58 100644
--- a/src/lib/net/InverseSockets/SecureServerSocket.cpp
+++ b/src/lib/net/InverseSockets/SecureServerSocket.cpp
@@ -40,7 +40,7 @@ IDataSocket *SecureServerSocket::accept() {
socket->initSsl(true);
setListeningJob();
- auto certificateFilename = getCertifcateFileName();
+ auto certificateFilename = getCertificateFileName();
if (socket->loadCertificates(certificateFilename)) {
socket->secureAccept();
} else {
@@ -64,7 +64,7 @@ IDataSocket *SecureServerSocket::accept() {
return dynamic_cast(socket);
}
-std::string SecureServerSocket::getCertifcateFileName() const {
+std::string SecureServerSocket::getCertificateFileName() const {
// if the tls cert option is set use that for the certificate file
auto certificateFilename = ArgParser::argsBase().m_tlsCertFile;
diff --git a/src/lib/net/InverseSockets/SecureServerSocket.h b/src/lib/net/InverseSockets/SecureServerSocket.h
index 62ff32b97..bc150dc9c 100644
--- a/src/lib/net/InverseSockets/SecureServerSocket.h
+++ b/src/lib/net/InverseSockets/SecureServerSocket.h
@@ -27,5 +27,5 @@ public:
IDataSocket *accept() override;
private:
- std::string getCertifcateFileName() const;
+ std::string getCertificateFileName() const;
};
diff --git a/src/test/unittests/gui/config/AppConfigTests.cpp b/src/test/unittests/gui/config/AppConfigTests.cpp
index bd5a242c7..3d335a636 100644
--- a/src/test/unittests/gui/config/AppConfigTests.cpp
+++ b/src/test/unittests/gui/config/AppConfigTests.cpp
@@ -48,12 +48,12 @@ public:
MOCK_METHOD(bool, isActiveScopeWritable, (), (const, override));
MOCK_METHOD(const QSettingsProxy &, activeSettings, (), (const, override));
MOCK_METHOD(QSettingsProxy &, activeSettings, (), (override));
- MOCK_METHOD(void, save, (), (override));
+ MOCK_METHOD(void, save, (bool), (override));
};
struct DepsMock : public AppConfig::Deps {
DepsMock() {
- ON_CALL(*this, profileDir()).WillByDefault(Return("stub"));
+ ON_CALL(*this, defaultTlsCertPath()).WillByDefault(Return("stub"));
ON_CALL(*this, hostname()).WillByDefault(Return("stub"));
}
@@ -61,7 +61,7 @@ struct DepsMock : public AppConfig::Deps {
return std::make_shared>();
}
- MOCK_METHOD(QString, profileDir, (), (const, override));
+ MOCK_METHOD(QString, defaultTlsCertPath, (), (const, override));
MOCK_METHOD(QString, hostname, (), (const, override));
};
diff --git a/src/test/unittests/gui/config/ConfigScopesTests.cpp b/src/test/unittests/gui/config/ConfigScopesTests.cpp
index 8662c4066..87f4c5fc9 100644
--- a/src/test/unittests/gui/config/ConfigScopesTests.cpp
+++ b/src/test/unittests/gui/config/ConfigScopesTests.cpp
@@ -63,8 +63,7 @@ struct DepsMock : public ConfigScopes::Deps {
} // namespace
TEST(ConfigScopesTests, ctor_callsMakeUserSettings) {
- std::shared_ptr> deps =
- std::make_shared>();
+ auto deps = std::make_shared>();
EXPECT_CALL(*deps, makeUserSettings()).Times(1);
@@ -72,8 +71,7 @@ TEST(ConfigScopesTests, ctor_callsMakeUserSettings) {
}
TEST(ConfigScopesTests, ctor_callsMakeSystemSettings) {
- std::shared_ptr> deps =
- std::make_shared>();
+ auto deps = std::make_shared>();
EXPECT_CALL(*deps, makeSystemSettings()).Times(1);
@@ -81,8 +79,7 @@ TEST(ConfigScopesTests, ctor_callsMakeSystemSettings) {
}
TEST(ConfigScopesTests, save_syncsBothScopes) {
- std::shared_ptr> deps =
- std::make_shared>();
+ auto deps = std::make_shared>();
ConfigScopes configScopes(deps);
@@ -93,8 +90,7 @@ TEST(ConfigScopesTests, save_syncsBothScopes) {
}
TEST(ConfigScopesTests, activeSettings_returnsUserSettingsByDefault) {
- std::shared_ptr> deps =
- std::make_shared>();
+ auto deps = std::make_shared>();
ConfigScopes configScopes(deps);
@@ -102,8 +98,7 @@ TEST(ConfigScopesTests, activeSettings_returnsUserSettingsByDefault) {
}
TEST(ConfigScopesTests, activeSettings_returnsSystemSettingsWhenSystemScope) {
- std::shared_ptr> deps =
- std::make_shared>();
+ auto deps = std::make_shared>();
ConfigScopes configScopes(deps);
configScopes.setActiveScope(ConfigScopes::Scope::System);
@@ -112,8 +107,7 @@ TEST(ConfigScopesTests, activeSettings_returnsSystemSettingsWhenSystemScope) {
}
TEST(ConfigScopesTests, setActiveScope_setsCurrentScope) {
- std::shared_ptr> deps =
- std::make_shared>();
+ auto deps = std::make_shared>();
ConfigScopes configScopes(deps);
@@ -125,8 +119,7 @@ TEST(ConfigScopesTests, setActiveScope_setsCurrentScope) {
TEST(
ConfigScopesTests,
isActiveScopeWritable_returnsTrueWhenUserSettingsWritable) {
- std::shared_ptr> deps =
- std::make_shared>();
+ auto deps = std::make_shared>();
ConfigScopes configScopes(deps);
@@ -138,8 +131,7 @@ TEST(
TEST(
ConfigScopesTests,
scopeContains_byDefault_returnsTrueWhenUserSettingsContainsKey) {
- std::shared_ptr> deps =
- std::make_shared>();
+ auto deps = std::make_shared>();
ON_CALL(*deps->m_pUserSettings, contains(_)).WillByDefault(Return(true));
@@ -151,8 +143,7 @@ TEST(
TEST(
ConfigScopesTests,
scopeContains_userScope_returnsTrueWhenUserSettingsContainsKey) {
- std::shared_ptr> deps =
- std::make_shared>();
+ auto deps = std::make_shared>();
ON_CALL(*deps->m_pUserSettings, contains(_)).WillByDefault(Return(true));
@@ -164,8 +155,7 @@ TEST(
TEST(
ConfigScopesTests,
scopeContains_systemScope_returnsTrueWhenSystemSettingsContainsKey) {
- std::shared_ptr> deps =
- std::make_shared>();
+ auto deps = std::make_shared>();
ON_CALL(*deps->m_pSystemSettings, contains(_)).WillByDefault(Return(true));
@@ -175,8 +165,7 @@ TEST(
}
TEST(ConfigScopesTests, activeFilePath_returnsUserSettingsFileNameByDefault) {
- std::shared_ptr> deps =
- std::make_shared>();
+ auto deps = std::make_shared>();
ON_CALL(*deps->m_pUserSettings, fileName()).WillByDefault(Return("test"));
ConfigScopes configScopes(deps);
@@ -185,8 +174,7 @@ TEST(ConfigScopesTests, activeFilePath_returnsUserSettingsFileNameByDefault) {
}
TEST(ConfigScopesTests, getFromScope_byDefault_returnsValueFromActiveSettings) {
- std::shared_ptr> deps =
- std::make_shared>();
+ auto deps = std::make_shared>();
ON_CALL(*deps->m_pUserSettings, value(_, _)).WillByDefault(Return("test"));
ConfigScopes configScopes(deps);
@@ -195,8 +183,7 @@ TEST(ConfigScopesTests, getFromScope_byDefault_returnsValueFromActiveSettings) {
}
TEST(ConfigScopesTests, setInScope_byDefault_setsValueInActiveSettings) {
- std::shared_ptr> deps =
- std::make_shared>();
+ auto deps = std::make_shared>();
ConfigScopes configScopes(deps);
diff --git a/src/test/unittests/gui/core/CoreProcessTests.cpp b/src/test/unittests/gui/core/CoreProcessTests.cpp
index 610e921fb..3209497c6 100644
--- a/src/test/unittests/gui/core/CoreProcessTests.cpp
+++ b/src/test/unittests/gui/core/CoreProcessTests.cpp
@@ -19,6 +19,7 @@
#include "gui/core/CoreProcess.h"
#include "gui/ipc/IQIpcClient.h"
#include "gui/proxy/QProcessProxy.h"
+#include "license/ILicense.h"
#include "shared/gui/mocks/AppConfigMock.h"
#include "shared/gui/mocks/ServerConfigMock.h"
@@ -27,10 +28,8 @@
#include
using namespace synergy::gui;
-using ::testing::_;
-using ::testing::NiceMock;
-using ::testing::Return;
-using ::testing::ReturnRef;
+using namespace synergy::license;
+using namespace testing;
namespace {
@@ -92,12 +91,23 @@ public:
NiceMock m_ipcClient;
};
-class CoreProcessTests : public ::testing::Test {
+class LicenseMock : public ILicense {
public:
- CoreProcessTests() : m_coreProcess(m_appConfig, m_serverConfig, m_pDeps) {}
+ LicenseMock() {
+ ON_CALL(*this, isTlsAvailable()).WillByDefault(Return(true));
+ }
+
+ MOCK_METHOD(bool, isTlsAvailable, (), (const, override));
+};
+
+class CoreProcessTests : public Test {
+public:
+ CoreProcessTests()
+ : m_coreProcess(m_appConfig, m_serverConfig, m_license, m_pDeps) {}
NiceMock m_appConfig;
NiceMock m_serverConfig;
+ NiceMock m_license;
std::shared_ptr> m_pDeps =
std::make_shared>();
CoreProcess m_coreProcess;
diff --git a/src/test/unittests/gui/core/ServerConnectionTests.cpp b/src/test/unittests/gui/core/ServerConnectionTests.cpp
index 5a6d19569..1442afb4c 100644
--- a/src/test/unittests/gui/core/ServerConnectionTests.cpp
+++ b/src/test/unittests/gui/core/ServerConnectionTests.cpp
@@ -15,6 +15,7 @@
* along with this program. If not, see .
*/
+#include "gui/config/ServerConfigDialogState.h"
#include "gui/core/ServerConnection.h"
#include "shared/gui/mocks/AppConfigMock.h"
@@ -45,11 +46,12 @@ public:
std::shared_ptr m_pDeps = std::make_shared>();
NiceMock m_appConfig;
NiceMock m_serverConfig;
+ config::ServerConfigDialogState m_serverConfigDialogState;
};
TEST_F(ServerConnectionTests, handleLogLine_newClient_shouldShowPrompt) {
ServerConnection serverConnection(
- nullptr, m_appConfig, m_serverConfig, m_pDeps);
+ nullptr, m_appConfig, m_serverConfig, m_serverConfigDialogState, m_pDeps);
QString clientName = "test client";
EXPECT_CALL(*m_pDeps, showNewClientPrompt(_, clientName));
@@ -59,7 +61,7 @@ TEST_F(ServerConnectionTests, handleLogLine_newClient_shouldShowPrompt) {
TEST_F(ServerConnectionTests, handleLogLine_ignoredClient_shouldNotShowPrompt) {
ServerConnection serverConnection(
- nullptr, m_appConfig, m_serverConfig, m_pDeps);
+ nullptr, m_appConfig, m_serverConfig, m_serverConfigDialogState, m_pDeps);
ON_CALL(*m_pDeps, showNewClientPrompt(_, _))
.WillByDefault(testing::Return(messages::NewClientPromptResult::Ignore));
serverConnection.handleLogLine(R"(unrecognised client name "stub")");
@@ -72,7 +74,7 @@ TEST_F(ServerConnectionTests, handleLogLine_ignoredClient_shouldNotShowPrompt) {
TEST_F(
ServerConnectionTests, handleLogLine_serverConfigFull_shouldNotShowPrompt) {
ServerConnection serverConnection(
- nullptr, m_appConfig, m_serverConfig, m_pDeps);
+ nullptr, m_appConfig, m_serverConfig, m_serverConfigDialogState, m_pDeps);
ON_CALL(m_serverConfig, isFull()).WillByDefault(testing::Return(true));
EXPECT_CALL(*m_pDeps, showNewClientPrompt(_, _)).Times(0);
@@ -82,7 +84,7 @@ TEST_F(
TEST_F(ServerConnectionTests, handleLogLine_screenExists_shouldNotShowPrompt) {
ServerConnection serverConnection(
- nullptr, m_appConfig, m_serverConfig, m_pDeps);
+ nullptr, m_appConfig, m_serverConfig, m_serverConfigDialogState, m_pDeps);
ON_CALL(m_serverConfig, screenExists(_)).WillByDefault(testing::Return(true));
EXPECT_CALL(*m_pDeps, showNewClientPrompt(_, _)).Times(0);
diff --git a/src/test/unittests/gui/dialogs/SettingsDialogTests.cpp b/src/test/unittests/gui/dialogs/SettingsDialogTests.cpp
index ce08d2601..60eab9868 100644
--- a/src/test/unittests/gui/dialogs/SettingsDialogTests.cpp
+++ b/src/test/unittests/gui/dialogs/SettingsDialogTests.cpp
@@ -39,7 +39,7 @@ TEST(SettingsDialogTests, ctor_getsScreenName) {
serialKey.isValid = true;
License license(serialKey);
auto cpDeps = std::make_shared();
- CoreProcess coreProcess(appConfig, serverConfig, cpDeps);
+ CoreProcess coreProcess(appConfig, serverConfig, license, cpDeps);
EXPECT_CALL(appConfig, screenName()).Times(1);