Commit 3dced489 authored by Roman Gilg's avatar Roman Gilg

fix(kded): watch config also when known config is applied

Summary:
When a known config is applied the doApplyConfig with the Config wrapper
override is called. In this case we still want to activate config watching
like when a config from the ConfigPtr override is applied.

Otherwise we are not be able to detect a control change until the first time
a new config is applied.

Test Plan:
Started with rotation in manual mode. Switched in KCM only from manual to
automatic mode without changing anything else. With the patch the daemon
notices this change, without it not.

Reviewers: #plasma, bshah

Reviewed By: #plasma, bshah

Subscribers: bshah, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D28386
parent 7d68300e
......@@ -173,7 +173,7 @@ void KScreenDaemon::doApplyConfig(const KScreen::ConfigPtr& config)
qCDebug(KSCREEN_KDED) << "Do set and apply specific config";
auto configWrapper = std::unique_ptr<Config>(new Config(config));
configWrapper->setValidityFlags(KScreen::Config::ValidityFlag::RequireAtLeastOneEnabledScreen);
configWrapper->activateControlWatching();
doApplyConfig(std::move(configWrapper));
}
......@@ -181,7 +181,9 @@ void KScreenDaemon::doApplyConfig(std::unique_ptr<Config> config)
{
m_monitoredConfig = std::move(config);
m_monitoredConfig->activateControlWatching();
m_orientationSensor->setEnabled(m_monitoredConfig->autoRotationRequested());
connect(m_monitoredConfig.get(), &Config::controlChanged, this, [this]() {
m_orientationSensor->setEnabled(m_monitoredConfig->autoRotationRequested());
updateOrientation();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment