update:修复发布问题

This commit is contained in:
Barry 2018-12-04 21:55:22 +08:00
parent 00054b808d
commit a6fc4e5200
2 changed files with 7 additions and 2 deletions

View file

@ -1,6 +1,8 @@
#include <QProcess>
#include <QCoreApplication>
#include <QDebug>
#include <QFileInfo>
#include <QDir>
#include "adbprocess.h"
@ -23,7 +25,8 @@ const QString& AdbProcess::getAdbPath()
{
if (s_adbPath.isEmpty()) {
s_adbPath = QString::fromLocal8Bit(qgetenv("QTSCRCPY_ADB_PATH"));
if (s_adbPath.isEmpty()) {
QFileInfo fileInfo(s_adbPath);
if (s_adbPath.isEmpty() || !fileInfo.isFile()) {
s_adbPath = QCoreApplication::applicationDirPath() + "/adb";
}
}

View file

@ -4,6 +4,7 @@
#include <QSize>
#include <QTimerEvent>
#include <QCoreApplication>
#include <QFileInfo>
#include "server.h"
@ -52,7 +53,8 @@ const QString& Server::getServerPath()
{
if (m_serverPath.isEmpty()) {
m_serverPath = QString::fromLocal8Bit(qgetenv("QTSCRCPY_SERVER_PATH"));
if (m_serverPath.isEmpty()) {
QFileInfo fileInfo(m_serverPath);
if (m_serverPath.isEmpty() || !fileInfo.isFile()) {
m_serverPath = QCoreApplication::applicationDirPath() + "/scrcpy-server.jar";
}
}