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_serverConnection(this, appConfig, m_serverConfig, m_serverConfigDialogState),
|
||||
m_clientConnection(this, appConfig),
|
||||
m_tlsUtility(appConfig),
|
||||
m_tlsUtility(this),
|
||||
m_trayIcon{new QSystemTrayIcon(this)},
|
||||
m_guiDupeChecker{new QLocalServer(this)},
|
||||
m_daemonIpcClient{new ipc::DaemonIpcClient(this)},
|
||||
|
||||
@ -29,7 +29,7 @@ SettingsDialog::SettingsDialog(
|
||||
m_appConfig(appConfig),
|
||||
m_serverConfig(serverConfig),
|
||||
m_coreProcess(coreProcess),
|
||||
m_tlsUtility(appConfig)
|
||||
m_tlsUtility(this)
|
||||
{
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
@ -280,18 +280,11 @@ private:
|
||||
bool m_LoadFromSystemScope = false;
|
||||
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;
|
||||
std::shared_ptr<Deps> m_pDeps;
|
||||
QString m_ScreenName;
|
||||
|
||||
signals:
|
||||
void tlsChanged();
|
||||
void screenNameChanged();
|
||||
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
|
||||
// been moved to server args.
|
||||
if (Settings::value(Settings::Security::TlsEnabled).toBool()) {
|
||||
TlsUtility tlsUtility(m_appConfig);
|
||||
TlsUtility tlsUtility(this);
|
||||
if (!tlsUtility.persistCertificate()) {
|
||||
qCritical("failed to persist tls certificate");
|
||||
return false;
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
namespace deskflow::gui {
|
||||
|
||||
TlsUtility::TlsUtility(const IAppConfig &appConfig) : m_appConfig(appConfig)
|
||||
TlsUtility::TlsUtility(QObject *parent) : QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -6,8 +6,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "gui/config/IAppConfig.h"
|
||||
|
||||
#include "TlsCertificate.h"
|
||||
|
||||
#include <QObject>
|
||||
@ -19,7 +17,7 @@ class TlsUtility : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TlsUtility(const IAppConfig &appConfig);
|
||||
explicit TlsUtility(QObject *parent = nullptr);
|
||||
|
||||
bool generateCertificate();
|
||||
bool persistCertificate();
|
||||
@ -34,7 +32,6 @@ public:
|
||||
bool isEnabled() const;
|
||||
|
||||
private:
|
||||
const IAppConfig &m_appConfig;
|
||||
TlsCertificate m_certificate;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user