Skip to content

Commit

Permalink
Allow compiling without default update checks
Browse files Browse the repository at this point in the history
Via -DDISABLE_UPDATE_CHECK_DEFAULT=ON. This will change the setting
default to be off instead of on by default, but the user can still
enable it or manually check if desired. To be used for F-Droid, since
that client will notify users of updates on its own anyway and considers
update checks by default an antifeature.
  • Loading branch information
askmeaboutlo0m committed Oct 8, 2024
1 parent 710ec7a commit d2eab86
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cmake/DrawpileOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ endif()
option(DIST_BUILD "Build for stand-alone distribution")
add_feature_info("Distribution build (DIST_BUILD)" DIST_BUILD "")

option(DISABLE_UPDATE_CHECK_DEFAULT "Don't enable update checks by default" OFF)
add_feature_info("Update checking disabled by default (DISABLE_UPDATE_CHECK_DEFAULT)" DISABLE_UPDATE_CHECK_DEFAULT "")

if(NOT CMAKE_CROSSCOMPILING)
if(DIST_BUILD)
set(source_assets_default OFF)
Expand Down
4 changes: 4 additions & 0 deletions src/desktop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,10 @@ if(WIN32 AND QT_VERSION_MAJOR VERSION_EQUAL 6)
target_include_directories(drawpile PRIVATE "${Qt6Gui_PRIVATE_INCLUDE_DIRS}")
endif()

if(DISABLE_UPDATE_CHECK_DEFAULT)
target_compile_definitions(drawpile PRIVATE DISABLE_UPDATE_CHECK_DEFAULT=1)
endif()

if(PROXY_STYLE)
target_compile_definitions(drawpile PRIVATE HAVE_PROXY_STYLE=1)
target_sources(drawpile PRIVATE utils/fusionui.cpp utils/fusionui.h)
Expand Down
10 changes: 9 additions & 1 deletion src/desktop/settings_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@
# endif
#endif

#ifndef UPDATE_CHECK_DEFAULT
# if DISABLE_UPDATE_CHECK_DEFAULT
# define UPDATE_CHECK_DEFAULT false
# else
# define UPDATE_CHECK_DEFAULT true
# endif
#endif

#ifndef THEME_PALETTE_DEFAULT
# ifdef Q_OS_MACOS
# define THEME_PALETTE_DEFAULT ThemePalette::System
Expand Down Expand Up @@ -226,7 +234,7 @@ SETTING_FULL(V2, themeStyle , ThemeStyle , "settings/theme/
, &any::get , &any::set, &themeStyle::notify)
SETTING(toolToggle , ToolToggle , "settings/tooltoggle" , true)
SETTING(toolset , Toolset , "tools/toolset" , (QMap<QString, QVariantHash>()))
SETTING(updateCheckEnabled , UpdateCheckEnabled , "settings/updatecheck" , true)
SETTING(updateCheckEnabled , UpdateCheckEnabled , "settings/updatecheck" , UPDATE_CHECK_DEFAULT)
SETTING(userMarkerPersistence , UserMarkerPersistence , "settings/usermarkerpersistence" , 1000)
SETTING(videoExportCustomFfmpeg , VideoExportCustomFfmpeg , "videoexport/customffmpeg" , QString())
SETTING(videoExportFfmpegPath , VideoExportFfmpegPath , "videoexport/ffmpegpath" , QString("ffmpeg"))
Expand Down

0 comments on commit d2eab86

Please sign in to comment.