mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
Merge branch 'dev' of github.com:amnezia-vpn/amnezia-client into feature/amnezia-wireguard-client-impl
This commit is contained in:
@@ -17,9 +17,7 @@ WireguardProtocol::WireguardProtocol(const QJsonObject &configuration, QObject *
|
||||
writeWireguardConfiguration(configuration);
|
||||
|
||||
// MZ
|
||||
#if defined(MZ_LINUX)
|
||||
// m_impl.reset(new LinuxController());
|
||||
#elif defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN) || defined(Q_OS_LINUX)
|
||||
m_impl.reset(new LocalSocketController());
|
||||
connect(m_impl.get(), &ControllerImpl::connected, this,
|
||||
[this](const QString &pubkey, const QDateTime &connectionTimestamp) {
|
||||
@@ -39,7 +37,7 @@ WireguardProtocol::~WireguardProtocol()
|
||||
|
||||
void WireguardProtocol::stop()
|
||||
{
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN) || defined(Q_OS_LINUX)
|
||||
stopMzImpl();
|
||||
return;
|
||||
#endif
|
||||
@@ -100,7 +98,7 @@ void WireguardProtocol::stop()
|
||||
setConnectionState(Vpn::ConnectionState::Disconnected);
|
||||
}
|
||||
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN) || defined(Q_OS_LINUX)
|
||||
ErrorCode WireguardProtocol::startMzImpl()
|
||||
{
|
||||
|
||||
@@ -128,7 +126,7 @@ void WireguardProtocol::writeWireguardConfiguration(const QJsonObject &configura
|
||||
m_configFile.write(jConfig.value(config_key::config).toString().toUtf8());
|
||||
m_configFile.close();
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#if 0
|
||||
if (IpcClient::Interface()) {
|
||||
QRemoteObjectPendingReply<bool> result = IpcClient::Interface()->copyWireguardConfig(m_configFile.fileName());
|
||||
if (result.returnValue()) {
|
||||
@@ -174,7 +172,7 @@ ErrorCode WireguardProtocol::start()
|
||||
return lastError();
|
||||
}
|
||||
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN) || defined(Q_OS_LINUX)
|
||||
return startMzImpl();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
ErrorCode start() override;
|
||||
void stop() override;
|
||||
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN) || defined(Q_OS_LINUX)
|
||||
ErrorCode startMzImpl();
|
||||
ErrorCode stopMzImpl();
|
||||
#endif
|
||||
@@ -47,7 +47,7 @@ private:
|
||||
|
||||
bool m_isConfigLoaded = false;
|
||||
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN) || defined(Q_OS_LINUX)
|
||||
QScopedPointer<ControllerImpl> m_impl;
|
||||
#endif
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user