From 9151446c0e1ea58815a8a8a444ecf382cbdd412d Mon Sep 17 00:00:00 2001 From: nerix Date: Wed, 6 Mar 2024 19:01:42 +0100 Subject: [PATCH] fix(streamer-mode): check setting on startup (#5236) --- CHANGELOG.md | 2 +- src/singletons/StreamerMode.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2311c7bf7..9858a65c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -170,7 +170,7 @@ - Dev: Added estimation for image sizes to avoid layout shifts. (#5192) - Dev: Added the `launachable` entry to Linux AppData. (#5210) - Dev: Cleaned up and optimized resources. (#5222) -- Dev: Refactor `StreamerMode`. (#5216) +- Dev: Refactor `StreamerMode`. (#5216, #5236) - Dev: Cleaned up unused code in `MessageElement` and `MessageLayoutElement`. (#5225) ## 2.4.6 diff --git a/src/singletons/StreamerMode.cpp b/src/singletons/StreamerMode.cpp index 06bdafebc..cb7311275 100644 --- a/src/singletons/StreamerMode.cpp +++ b/src/singletons/StreamerMode.cpp @@ -163,7 +163,6 @@ bool StreamerMode::isEnabled() const StreamerModePrivate::StreamerModePrivate(StreamerMode *parent) : parent_(parent) { - this->thread_.start(); this->timer_.moveToThread(&this->thread_); QObject::connect(&this->timer_, &QTimer::timeout, [this] { auto timeouts = @@ -184,6 +183,11 @@ StreamerModePrivate::StreamerModePrivate(StreamerMode *parent) }); }, this->settingConnections_); + + QObject::connect(&this->thread_, &QThread::started, [this] { + this->settingChanged(getSettings()->enableStreamerMode.getEnum()); + }); + this->thread_.start(); } bool StreamerModePrivate::isEnabled() const