diff --git a/src/appproxy.cpp b/src/appproxy.cpp index 5c17a8a..061ff6a 100644 --- a/src/appproxy.cpp +++ b/src/appproxy.cpp @@ -269,6 +269,10 @@ void AppProxy::setAutoStart(bool autoStart) { fileContent = srcFile.readAll(); srcFile.close(); } + QFileInfo dstFileInfo(dstFile); + if (!dstFileInfo.dir().exists()) { + dstFileInfo.dir().mkpath("."); + } if (dstFile.open(QIODevice::WriteOnly)) { dstFile.write(fileContent.arg(APP_PATH).toUtf8()); dstFile.close(); @@ -712,7 +716,6 @@ void AppProxy::returnLatestRelease(QString name, QString version) { } latestVersion[name]["checkTime"] = QDateTime::currentDateTime(); latestVersion[name]["latestVersion"] = version; - qDebug() << version; emit latestReleaseReady(name, version); } diff --git a/src/v2raycore.cpp b/src/v2raycore.cpp index c96dd4e..e2c1749 100644 --- a/src/v2raycore.cpp +++ b/src/v2raycore.cpp @@ -17,8 +17,8 @@ V2RayCore::V2RayCore() { v2RayExecFilePath = QDir(v2RayInstallFolderPath).filePath("v2ray.exe"); v2RayCtlExecFilePath = QDir(v2RayInstallFolderPath).filePath("v2ctl.exe"); #elif defined(Q_OS_LINUX) or defined(Q_OS_MAC) - v2RayExecFilePath = QDir(v2RayInstallFolderPath).filePath("v2ray"); - v2RayCtlExecFilePath = QDir(v2RayInstallFolderPath).filePath("v2ctl"); + v2RayExecFilePath = QDir(v2RayInstallFolderPath).filePath("v2ray"); + v2RayCtlExecFilePath = QDir(v2RayInstallFolderPath).filePath("v2ctl"); #endif QDir v2RayInstallFolder(v2RayInstallFolderPath); // Create the install folder if not exists @@ -97,20 +97,4 @@ bool V2RayCore::isRunning() { return v2rayProcess->state() == QProcess::Running; } -bool V2RayCore::isUpgradable() { return V2RAY_USE_LOCAL_INSTALL; } - bool V2RayCore::isInstalled() { return QFile(v2RayExecFilePath).exists(); } - -bool V2RayCore::upgrade(const QString& version, const QNetworkProxy* proxy) { -#if defined(Q_OS_WIN) - QString operatingSystem = "windows-64"; -#elif defined(Q_OS_LINUX) - QString operatingSystem = "linux-64"; -#elif defined(Q_OS_MAC) - QString operatingSystem = "macos"; -#else - QString operatingSystem = "unknown"; -#endif - QString assetsUrl = QString(V2RAY_ASSETS_URL).arg(version, operatingSystem); - return false; -} diff --git a/src/v2raycore.h b/src/v2raycore.h index 86bdbbb..b6a4e64 100644 --- a/src/v2raycore.h +++ b/src/v2raycore.h @@ -14,11 +14,9 @@ class V2RayCore : public QObject { ~V2RayCore(); QString getVersion(); bool isRunning(); - bool isUpgradable(); bool start(); bool stop(); bool restart(); - bool upgrade(const QString& version, const QNetworkProxy* proxy = nullptr); private: V2RayCore();