From 9b7bca611601a3b8a27a1e3aad636f74df47a162 Mon Sep 17 00:00:00 2001 From: selsta Date: Sun, 1 May 2022 06:09:29 +0200 Subject: [PATCH] main: add compile time option to disable updates --- CMakeLists.txt | 5 +++++ src/main/main.cpp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d23d940..bc2f5f3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ option(STATIC "Link libraries statically, requires static Qt") option(USE_DEVICE_TREZOR "Trezor support compilation" ON) option(WITH_SCANNER "Enable webcam QR scanner" OFF) option(WITH_DESKTOP_ENTRY "Ask to install desktop entry on first startup" ON) +option(WITH_UPDATER "Regularly check for new updates" ON) option(DEV_MODE "Checkout latest monero master on build" OFF) list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake") @@ -87,6 +88,10 @@ if(WITH_DESKTOP_ENTRY) add_definitions(-DWITH_DESKTOP_ENTRY) endif() +if(WITH_UPDATER) + add_definitions(-DWITH_UPDATER) +endif() + # Sodium find_library(SODIUM_LIBRARY sodium) message(STATUS "libsodium: libraries at ${SODIUM_LIBRARY}") diff --git a/src/main/main.cpp b/src/main/main.cpp index db339d71..e6a1cda1 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -498,7 +498,11 @@ Verify update binary using 'shasum'-compatible (SHA256 algo) output signed by tw engine.rootContext()->setContextProperty("homePath", QDir::homePath()); engine.rootContext()->setContextProperty("applicationDirectory", QApplication::applicationDirPath()); engine.rootContext()->setContextProperty("idealThreadCount", QThread::idealThreadCount()); +#ifdef WITH_UPDATER engine.rootContext()->setContextProperty("disableCheckUpdatesFlag", parser.isSet(disableCheckUpdatesOption)); +#else + engine.rootContext()->setContextProperty("disableCheckUpdatesFlag", true); +#endif engine.rootContext()->setContextProperty("socksProxyFlag", parser.value(socksProxyOption)); engine.rootContext()->setContextProperty("socksProxyFlagSet", parser.isSet(socksProxyOption));