Skip to content

Commit

Permalink
Merge branch 'master' of https:/Dr-Incognito/V2Ray-Desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Incognito committed Feb 18, 2020
2 parents b4a3aea + 89fff64 commit bae41a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
5 changes: 4 additions & 1 deletion src/appproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}

Expand Down
20 changes: 2 additions & 18 deletions src/v2raycore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
2 changes: 0 additions & 2 deletions src/v2raycore.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit bae41a7

Please sign in to comment.