]> Nutra Git (v1) - gamesguru/feather.git/commitdiff
Revert "CMake: add TOR_INSTALLED"
authortobtoht <tob@featherwallet.org>
Wed, 24 May 2023 19:53:39 +0000 (21:53 +0200)
committertobtoht <tob@featherwallet.org>
Wed, 24 May 2023 19:53:39 +0000 (21:53 +0200)
This reverts commit be5fd97fe075bad5eb29bac2ea5fdfcae1d4bff6.

CMakeLists.txt
contrib/guix/libexec/build.sh
src/CMakeLists.txt
src/utils/TorManager.cpp
src/widgets/NetworkProxyWidget.cpp

index a85d6a9071a17d6b71f457d6ab2960ffab132682..a7d97abc067633ae1555b15c2b5eba4dad5057ec 100644 (file)
@@ -18,24 +18,15 @@ set(COPYRIGHT_HOLDERS "The Monero Project")
 # Configurable options
 option(STATIC "Link libraries statically, requires static Qt" OFF)
 option(SELF_CONTAINED "Disable when building Feather for packages" OFF)
-option(STACK_TRACE "Dump stack trace on crash (Linux only)" OFF)
-option(DONATE_BEG "Prompt donation window every once in a while" OFF)
-
-# Updater
+option(LOCALMONERO "Include LocalMonero module" ON)
+option(XMRIG "Include XMRig module" ON)
+option(TOR_DIR "Directory containing Tor binaries to embed inside Feather" OFF)
 option(CHECK_UPDATES "Enable checking for application updates" OFF)
 option(PLATFORM_INSTALLER "Built-in updater fetches installer (windows-only)" OFF)
-
-# Tor
-option(TOR_DIR "Directory containing Tor binaries to embed inside Feather" OFF)
-option(TOR_VERSION "Tor version for bundled Tor binary" OFF)
-option(TOR_INSTALLED "Tor binary is available in the installation directory" OFF)
-
-# Components
-option(WITH_SCANNER "Enable webcam QR scanner" ON)
 option(USE_DEVICE_TREZOR "Trezor support compilation" ON)
-option(LOCALMONERO "Include LocalMonero module" ON)
-option(XMRIG "Include XMRig module" ON)
-
+option(DONATE_BEG "Prompt donation window every once in a while" OFF)
+option(WITH_SCANNER "Enable webcam QR scanner" ON)
+option(STACK_TRACE "Dump stack trace on crash (Linux only)" OFF)
 
 list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake")
 include(CheckCCompilerFlag)
index ab2163e6ac4ee62ad686f4eb37ec0a59b808fee6..3ef6fb96a97034d441f22fc7e2ff2250a11d5147 100755 (executable)
@@ -279,7 +279,7 @@ mkdir -p "$DISTSRC"
         *mingw32)
             case "$OPTIONS" in
                 installer)
-                    CMAKEVARS+=" -DPLATFORM_INSTALLER=On -DTOR_DIR=Off -DTOR_VERSION=Off -DTOR_INSTALLED=On"
+                    CMAKEVARS+=" -DPLATFORM_INSTALLER=On -DTOR_DIR=Off -DTOR_VERSION=Off"
                     ;;
             esac
             ;;
index 3245d5ff57df176f14195b1552e4d5dff72ef759..9d4877da475e7db72aff01d382485e0b19390195 100644 (file)
@@ -187,10 +187,6 @@ if(TOR_DIR)
     target_compile_definitions(feather PRIVATE HAS_TOR_BIN=1)
 endif()
 
-if(TOR_INSTALLED)
-    target_compile_definitions(feather PRIVATE TOR_INSTALLED=1)
-endif()
-
 if(XMRIG)
     target_compile_definitions(feather PRIVATE HAS_XMRIG=1)
 endif()
@@ -322,4 +318,4 @@ else()
         install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/feather.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
         install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/images/appicons/256x256.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/256x256/apps RENAME "feather.png")
     endif()
-endif()
+endif()
\ No newline at end of file
index 21d6b8f3dff64d0a82ce82bad8f3e720ac2bd12b..977711fc83e1bf9ef9f4592823fc39a38223b850 100644 (file)
@@ -21,7 +21,7 @@ TorManager::TorManager(QObject *parent)
     connect(m_checkConnectionTimer, &QTimer::timeout, this, &TorManager::checkConnection);
 
     this->torDir = Config::defaultConfigDir().filePath("tor");
-#if defined(TOR_INSTALLED)
+#if defined(PLATFORM_INSTALLER)
     // When installed, use directory relative to application path.
     this->torDir = QDir(Utils::applicationPath()).filePath("tor");
 #endif
@@ -73,6 +73,10 @@ void TorManager::start() {
     }
 
     QFile torFile{this->torPath};
+    QString alternativeTorFile = QCoreApplication::applicationDirPath() + "/tor";
+    if (!torFile.exists() && QFileInfo(alternativeTorFile).isFile()) {
+        this->torPath = alternativeTorFile;
+    }
 
     qDebug() << QString("Start process: %1").arg(this->torPath);
 
@@ -186,7 +190,7 @@ bool TorManager::unpackBins() {
 
     this->torPath = QDir(this->torDir).filePath(torBin);
 
-#if defined(TOR_INSTALLED)
+#if defined(PLATFORM_INSTALLER)
     // We don't need to unpack if Tor was installed using the installer
     return true;
 #endif
@@ -250,7 +254,7 @@ bool TorManager::shouldStartTorDaemon() {
     }
 
     // Don't start a Tor daemon if we don't have one
-#if !defined(HAS_TOR_BIN) && !defined(TOR_INSTALLED)
+#if !defined(HAS_TOR_BIN) && !defined(PLATFORM_INSTALLER)
     qWarning() << "Feather built without embedded Tor. Assuming --use-local-tor";
     return false;
 #endif
index b5d56fb716e43dd2b5ba60da0471e415d5a8ec51..0af68eb97543253de64bf30e8c8958db57624c2e 100644 (file)
@@ -44,7 +44,7 @@ NetworkProxyWidget::NetworkProxyWidget(QWidget *parent)
 
     // [Tor settings]
     // [Let Feather start and manage a Tor daemon]
-#if !defined(HAS_TOR_BIN) && !defined(TOR_INSTALLED)
+#if !defined(HAS_TOR_BIN) && !defined(PLATFORM_INSTALLER)
     ui->checkBox_torManaged->setChecked(false);
     ui->checkBox_torManaged->setEnabled(false);
     ui->checkBox_torManaged->setToolTip("Feather was bundled without Tor");
@@ -69,7 +69,7 @@ NetworkProxyWidget::NetworkProxyWidget(QWidget *parent)
 
     // [Show Tor logs]
     ui->frame_torShowLogs->setVisible(!config()->get(Config::useLocalTor).toBool());
-#if !defined(HAS_TOR_BIN) && !defined(TOR_INSTALLED)
+#if !defined(HAS_TOR_BIN) && !defined(PLATFORM_INSTALLER)
     ui->frame_torShowLogs->setVisible(false);
 #endif
     connect(ui->btn_torShowLogs, &QPushButton::clicked, [this]{