Fix formatting
This commit is contained in:
parent
9e7cf7fa1f
commit
6a21994736
4 changed files with 50 additions and 56 deletions
|
|
@ -9,7 +9,8 @@
|
|||
#include "core/errorstrings.h"
|
||||
#include "version.h"
|
||||
|
||||
namespace {
|
||||
namespace
|
||||
{
|
||||
#ifdef Q_OS_MACOS
|
||||
const QString installerPath = QStandardPaths::writableLocation(QStandardPaths::TempLocation) + "/AmneziaVPN.dmg";
|
||||
#elif defined Q_OS_WINDOWS
|
||||
|
|
@ -19,7 +20,8 @@ namespace {
|
|||
#endif
|
||||
}
|
||||
|
||||
UpdateController::UpdateController(const std::shared_ptr<Settings> &settings, QObject *parent) : QObject(parent), m_settings(settings)
|
||||
UpdateController::UpdateController(const std::shared_ptr<Settings> &settings, QObject *parent)
|
||||
: QObject(parent), m_settings(settings)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -141,5 +143,4 @@ void UpdateController::runInstaller()
|
|||
|
||||
reply->deleteLater();
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ public slots:
|
|||
signals:
|
||||
void updateFound();
|
||||
void errorOccured(const QString &errorMessage);
|
||||
|
||||
private:
|
||||
std::shared_ptr<Settings> m_settings;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
#include "logger.h"
|
||||
#include "router.h"
|
||||
|
||||
#include "../core/networkUtilities.h"
|
||||
#include "../client/protocols/protocols_defs.h"
|
||||
#include "../core/networkUtilities.h"
|
||||
#ifdef Q_OS_WIN
|
||||
#include "../client/platforms/windows/daemon/windowsdaemon.h"
|
||||
#include "../client/platforms/windows/daemon/windowsfirewall.h"
|
||||
|
|
@ -60,12 +60,15 @@ int IpcServer::createPrivilegedProcess()
|
|||
}
|
||||
});
|
||||
|
||||
QObject::connect(pd.serverNode.data(), &QRemoteObjectHost::error, this,
|
||||
[pd](QRemoteObjectNode::ErrorCode errorCode) { qDebug() << "QRemoteObjectHost::error" << errorCode; });
|
||||
QObject::connect(pd.serverNode.data(), &QRemoteObjectHost::error, this, [pd](QRemoteObjectNode::ErrorCode errorCode) {
|
||||
qDebug() << "QRemoteObjectHost::error" << errorCode;
|
||||
});
|
||||
|
||||
QObject::connect(pd.serverNode.data(), &QRemoteObjectHost::destroyed, this, [pd]() { qDebug() << "QRemoteObjectHost::destroyed"; });
|
||||
QObject::connect(pd.serverNode.data(), &QRemoteObjectHost::destroyed, this,
|
||||
[pd]() { qDebug() << "QRemoteObjectHost::destroyed"; });
|
||||
|
||||
// connect(pd.ipcProcess.data(), &IpcServerProcess::finished, this, [this, pid=m_localpid](int exitCode, QProcess::ExitStatus exitStatus){
|
||||
// connect(pd.ipcProcess.data(), &IpcServerProcess::finished, this, [this, pid=m_localpid](int exitCode,
|
||||
// QProcess::ExitStatus exitStatus){
|
||||
// qDebug() << "IpcServerProcess finished" << exitCode << exitStatus;
|
||||
//// if (m_processes.contains(pid)) {
|
||||
//// m_processes[pid].ipcProcess.reset();
|
||||
|
|
@ -386,10 +389,7 @@ int IpcServer::installApp(const QString &path)
|
|||
// On Windows, simply run the .exe file with administrator privileges
|
||||
QProcess process;
|
||||
process.setProgram("powershell.exe");
|
||||
process.setArguments(QStringList()
|
||||
<< "Start-Process"
|
||||
<< path
|
||||
<< "-Verb"
|
||||
process.setArguments(QStringList() << "Start-Process" << path << "-Verb"
|
||||
<< "RunAs"
|
||||
<< "-Wait");
|
||||
|
||||
|
|
@ -417,12 +417,7 @@ int IpcServer::installApp(const QString &path)
|
|||
|
||||
// Mount DMG image
|
||||
qDebug() << "Mounting DMG image...";
|
||||
process.start("hdiutil", QStringList()
|
||||
<< "attach"
|
||||
<< path
|
||||
<< "-mountpoint"
|
||||
<< mountPoint
|
||||
<< "-nobrowse");
|
||||
process.start("hdiutil", QStringList() << "attach" << path << "-mountpoint" << mountPoint << "-nobrowse");
|
||||
process.waitForFinished();
|
||||
|
||||
if (process.exitCode() != 0) {
|
||||
|
|
@ -442,17 +437,12 @@ int IpcServer::installApp(const QString &path)
|
|||
|
||||
// Copy application to /Applications
|
||||
qDebug() << "Copying app to Applications folder...";
|
||||
process.start("cp", QStringList()
|
||||
<< "-R"
|
||||
<< appPath
|
||||
<< targetPath);
|
||||
process.start("cp", QStringList() << "-R" << appPath << targetPath);
|
||||
process.waitForFinished();
|
||||
|
||||
// Unmount DMG
|
||||
qDebug() << "Unmounting DMG...";
|
||||
process.start("hdiutil", QStringList()
|
||||
<< "detach"
|
||||
<< mountPoint);
|
||||
process.start("hdiutil", QStringList() << "detach" << mountPoint);
|
||||
process.waitForFinished();
|
||||
|
||||
if (process.exitCode() != 0) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
#ifndef IPCSERVER_H
|
||||
#define IPCSERVER_H
|
||||
|
||||
#include "../client/daemon/interfaceconfig.h"
|
||||
#include <QJsonObject>
|
||||
#include <QLocalServer>
|
||||
#include <QObject>
|
||||
#include <QRemoteObjectNode>
|
||||
#include <QJsonObject>
|
||||
#include "../client/daemon/interfaceconfig.h"
|
||||
|
||||
#include "ipc.h"
|
||||
#include "ipcserverprocess.h"
|
||||
|
|
@ -44,8 +44,10 @@ public:
|
|||
private:
|
||||
int m_localpid = 0;
|
||||
|
||||
struct ProcessDescriptor {
|
||||
ProcessDescriptor (QObject *parent = nullptr) {
|
||||
struct ProcessDescriptor
|
||||
{
|
||||
ProcessDescriptor(QObject *parent = nullptr)
|
||||
{
|
||||
serverNode = QSharedPointer<QRemoteObjectHost>(new QRemoteObjectHost(parent));
|
||||
ipcProcess = QSharedPointer<IpcServerProcess>(new IpcServerProcess(parent));
|
||||
tun2socksProcess = QSharedPointer<IpcProcessTun2Socks>(new IpcProcessTun2Socks(parent));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue