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
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- Dev: Clarify signal connection lifetimes where applicable. (#4818)
- Dev: Laid the groundwork for advanced input completion strategies. (#4639, #4846, #4853)
- Dev: Fixed flickering when running with Direct2D on Windows. (#4851)
- Dev: Add a compile-time flag `CHATTERINO_DISABLE_UPDATER` to disable update checks. (#4854)

## 2.4.6

Expand Down
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
Loading