feat: tlsUtility no longer needs AppConfig, tlsUtility takes a parent object
This commit is contained in:
@ -68,7 +68,7 @@ MainWindow::MainWindow(ConfigScopes &configScopes, AppConfig &appConfig)
|
|||||||
m_coreProcess(appConfig, m_serverConfig),
|
m_coreProcess(appConfig, m_serverConfig),
|
||||||
m_serverConnection(this, appConfig, m_serverConfig, m_serverConfigDialogState),
|
m_serverConnection(this, appConfig, m_serverConfig, m_serverConfigDialogState),
|
||||||
m_clientConnection(this, appConfig),
|
m_clientConnection(this, appConfig),
|
||||||
m_tlsUtility(appConfig),
|
m_tlsUtility(this),
|
||||||
m_trayIcon{new QSystemTrayIcon(this)},
|
m_trayIcon{new QSystemTrayIcon(this)},
|
||||||
m_guiDupeChecker{new QLocalServer(this)},
|
m_guiDupeChecker{new QLocalServer(this)},
|
||||||
m_daemonIpcClient{new ipc::DaemonIpcClient(this)},
|
m_daemonIpcClient{new ipc::DaemonIpcClient(this)},
|
||||||
|
|||||||
@ -29,7 +29,7 @@ SettingsDialog::SettingsDialog(
|
|||||||
m_appConfig(appConfig),
|
m_appConfig(appConfig),
|
||||||
m_serverConfig(serverConfig),
|
m_serverConfig(serverConfig),
|
||||||
m_coreProcess(coreProcess),
|
m_coreProcess(coreProcess),
|
||||||
m_tlsUtility(appConfig)
|
m_tlsUtility(this)
|
||||||
{
|
{
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|||||||
@ -280,18 +280,11 @@ private:
|
|||||||
bool m_LoadFromSystemScope = false;
|
bool m_LoadFromSystemScope = false;
|
||||||
bool m_RequireClientCert = true;
|
bool m_RequireClientCert = true;
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Flag is set when any TLS is setting is changed, and is reset
|
|
||||||
* when the TLS changed event is emitted.
|
|
||||||
*/
|
|
||||||
bool m_TlsChanged = false;
|
|
||||||
|
|
||||||
deskflow::gui::IConfigScopes &m_Scopes;
|
deskflow::gui::IConfigScopes &m_Scopes;
|
||||||
std::shared_ptr<Deps> m_pDeps;
|
std::shared_ptr<Deps> m_pDeps;
|
||||||
QString m_ScreenName;
|
QString m_ScreenName;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void tlsChanged();
|
|
||||||
void screenNameChanged();
|
void screenNameChanged();
|
||||||
void logLevelChanged();
|
void logLevelChanged();
|
||||||
};
|
};
|
||||||
|
|||||||
@ -556,7 +556,7 @@ bool CoreProcess::addServerArgs(QStringList &args, QString &app)
|
|||||||
// since it's not clear why (it is only needed for the server), this has now
|
// since it's not clear why (it is only needed for the server), this has now
|
||||||
// been moved to server args.
|
// been moved to server args.
|
||||||
if (Settings::value(Settings::Security::TlsEnabled).toBool()) {
|
if (Settings::value(Settings::Security::TlsEnabled).toBool()) {
|
||||||
TlsUtility tlsUtility(m_appConfig);
|
TlsUtility tlsUtility(this);
|
||||||
if (!tlsUtility.persistCertificate()) {
|
if (!tlsUtility.persistCertificate()) {
|
||||||
qCritical("failed to persist tls certificate");
|
qCritical("failed to persist tls certificate");
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
namespace deskflow::gui {
|
namespace deskflow::gui {
|
||||||
|
|
||||||
TlsUtility::TlsUtility(const IAppConfig &appConfig) : m_appConfig(appConfig)
|
TlsUtility::TlsUtility(QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,8 +6,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "gui/config/IAppConfig.h"
|
|
||||||
|
|
||||||
#include "TlsCertificate.h"
|
#include "TlsCertificate.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
@ -19,7 +17,7 @@ class TlsUtility : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TlsUtility(const IAppConfig &appConfig);
|
explicit TlsUtility(QObject *parent = nullptr);
|
||||||
|
|
||||||
bool generateCertificate();
|
bool generateCertificate();
|
||||||
bool persistCertificate();
|
bool persistCertificate();
|
||||||
@ -34,7 +32,6 @@ public:
|
|||||||
bool isEnabled() const;
|
bool isEnabled() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const IAppConfig &m_appConfig;
|
|
||||||
TlsCertificate m_certificate;
|
TlsCertificate m_certificate;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user