From c7633f54def16653abaedd62e2e8b38da290b923 Mon Sep 17 00:00:00 2001 From: Barry <870709864@qq.com> Date: Tue, 4 Dec 2018 21:55:22 +0800 Subject: [PATCH] =?UTF-8?q?update:=E4=BF=AE=E5=A4=8D=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QtScrcpy/adb/adbprocess.cpp | 5 ++++- QtScrcpy/server/server.cpp | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/QtScrcpy/adb/adbprocess.cpp b/QtScrcpy/adb/adbprocess.cpp index 43a09a9..7eb4e2c 100644 --- a/QtScrcpy/adb/adbprocess.cpp +++ b/QtScrcpy/adb/adbprocess.cpp @@ -1,6 +1,8 @@ #include #include #include +#include +#include #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"; } } diff --git a/QtScrcpy/server/server.cpp b/QtScrcpy/server/server.cpp index 58fe266..b4450ee 100644 --- a/QtScrcpy/server/server.cpp +++ b/QtScrcpy/server/server.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #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"; } }