From: tobtoht Date: Fri, 21 Apr 2023 20:27:09 +0000 (+0200) Subject: TorManager: TOR_INSTALLED, set fallback tor dir X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=fce3b0338854b6e488cf4406eb5c6f6e75c55a2d;p=gamesguru%2Ffeather.git TorManager: TOR_INSTALLED, set fallback tor dir --- diff --git a/src/utils/TorManager.cpp b/src/utils/TorManager.cpp index 21d6b8f3..c3e0dacf 100644 --- a/src/utils/TorManager.cpp +++ b/src/utils/TorManager.cpp @@ -21,9 +21,15 @@ TorManager::TorManager(QObject *parent) connect(m_checkConnectionTimer, &QTimer::timeout, this, &TorManager::checkConnection); this->torDir = Config::defaultConfigDir().filePath("tor"); + #if defined(TOR_INSTALLED) - // When installed, use directory relative to application path. - this->torDir = QDir(Utils::applicationPath()).filePath("tor"); + QString installedTorPath = QDir(Utils::applicationPath()).filePath("tor"); + bool installedTorPathIsDir = QFileInfo(torPath).isDir(); + if (installedTorPathIsDir) { + this->torDir = installedTorPath; + } else { + this->torDir = Utils::applicationPath(); + } #endif this->torDataPath = Config::defaultConfigDir().filePath("tor/data");