fixed warning with QFutureWatcher

- renamed readWireguardConfiguration function to match what it does
This commit is contained in:
vladimir.kuznetsov 2023-01-24 09:43:12 +03:00
parent e7ed532545
commit ee609f3e8f
3 changed files with 4 additions and 5 deletions

View file

@ -549,10 +549,9 @@ ErrorCode ServerController::installDockerWorker(const ServerCredentials &credent
return ErrorCode::NoError; return ErrorCode::NoError;
}); });
watcher.setFuture(future);
QEventLoop wait; QEventLoop wait;
QObject::connect(&watcher, &QFutureWatcher<ErrorCode>::finished, &wait, &QEventLoop::quit); QObject::connect(&watcher, &QFutureWatcher<ErrorCode>::finished, &wait, &QEventLoop::quit);
watcher.setFuture(future);
wait.exec(); wait.exec();
m_cancelInstallation = false; m_cancelInstallation = false;

View file

@ -12,7 +12,7 @@ WireguardProtocol::WireguardProtocol(const QJsonObject &configuration, QObject*
VpnProtocol(configuration, parent) VpnProtocol(configuration, parent)
{ {
m_configFile.setFileName(QDir::tempPath() + QDir::separator() + serviceName() + ".conf"); m_configFile.setFileName(QDir::tempPath() + QDir::separator() + serviceName() + ".conf");
readWireguardConfiguration(configuration); writeWireguardConfiguration(configuration);
} }
WireguardProtocol::~WireguardProtocol() WireguardProtocol::~WireguardProtocol()
@ -70,7 +70,7 @@ void WireguardProtocol::stop()
} }
void WireguardProtocol::readWireguardConfiguration(const QJsonObject &configuration) void WireguardProtocol::writeWireguardConfiguration(const QJsonObject &configuration)
{ {
QJsonObject jConfig = configuration.value(ProtocolProps::key_proto_config_data(Proto::WireGuard)).toObject(); QJsonObject jConfig = configuration.value(ProtocolProps::key_proto_config_data(Proto::WireGuard)).toObject();

View file

@ -23,7 +23,7 @@ public:
private: private:
QString configPath() const; QString configPath() const;
void readWireguardConfiguration(const QJsonObject &configuration); void writeWireguardConfiguration(const QJsonObject &configuration);
void updateRouteGateway(QString line); void updateRouteGateway(QString line);
void updateVpnGateway(const QString &line); void updateVpnGateway(const QString &line);