From 3aa8a46f6e36ea62a0d3f010ed7a05d72aa55188 Mon Sep 17 00:00:00 2001 From: Pokamest Nikak Date: Mon, 23 Sep 2024 01:19:46 +0300 Subject: [PATCH] wip --- client/ui/controllers/connectionController.cpp | 14 +++++++------- client/utilities.cpp | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client/ui/controllers/connectionController.cpp b/client/ui/controllers/connectionController.cpp index c7f95000..db8beed1 100644 --- a/client/ui/controllers/connectionController.cpp +++ b/client/ui/controllers/connectionController.cpp @@ -34,13 +34,13 @@ ConnectionController::ConnectionController(const QSharedPointer &s void ConnectionController::openConnection() { -// #if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) -// if (!Utils::processIsRunning(Utils::executable(SERVICE_NAME, false), true)) -// { -// emit connectionErrorOccurred(ErrorCode::AmneziaServiceNotRunning); -// return; -// } -// #endif +#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) + if (!Utils::processIsRunning(Utils::executable(SERVICE_NAME, false), true)) + { + emit connectionErrorOccurred(ErrorCode::AmneziaServiceNotRunning); + return; + } +#endif int serverIndex = m_serversModel->getDefaultServerIndex(); QJsonObject serverConfig = m_serversModel->getServerConfig(serverIndex); diff --git a/client/utilities.cpp b/client/utilities.cpp index bcae2ed5..ed91f5fc 100755 --- a/client/utilities.cpp +++ b/client/utilities.cpp @@ -247,7 +247,7 @@ bool Utils::killProcessByName(const QString &name) CloseHandle(hSnapshot); return success; #elif defined Q_OS_IOS || defined(Q_OS_ANDROID) - return; + return false; #else QProcess::execute(QString("pkill %1").arg(name)); #endif