Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement compile-time flag to disable automatic update checks. #4854

Merged
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ option(BUILD_TRANSLATIONS "" OFF)
option(BUILD_SHARED_LIBS "" OFF)
option(CHATTERINO_LTO "Enable LTO for all targets" OFF)
option(CHATTERINO_PLUGINS "Enable EXPERIMENTAL plugin support in Chatterino" OFF)
option(CHATTERINO_DISABLE_UPDATER "Disable update checks" OFF)
pajlada marked this conversation as resolved.
Show resolved Hide resolved

if(CHATTERINO_LTO)
include(CheckIPOSupported)
Expand Down
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1039,3 +1039,8 @@ if(CHATTERINO_ENABLE_LTO)
set_property(TARGET ${LIBRARY_PROJECT}
PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()

if(CHATTERINO_DISABLE_UPDATER)
message(STATUS "Disabling the updater.")
target_compile_definitions(${LIBRARY_PROJECT} PUBLIC CHATTERINO_DISABLE_UPDATER)
endif()
4 changes: 4 additions & 0 deletions src/singletons/Updates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ void Updates::checkForUpdates()
{
auto version = Version::instance();

#ifdef CHATTERINO_DISABLE_UPDATER
return;
#endif

if (!version.isSupportedOS())
{
qCDebug(chatterinoUpdate)
Expand Down