plugins/nightlight: Shuffle some code
Keep things that are related spatially close, in this case, the initialization of the timer that will start the next transition.
This commit is contained in:
parent
d595b8f8aa
commit
6b4ef4170c
1 changed files with 3 additions and 7 deletions
|
@ -372,13 +372,6 @@ void NightLightManager::resetSlowUpdateTimers()
|
||||||
}
|
}
|
||||||
|
|
||||||
const QDateTime dateTime = QDateTime::currentDateTime();
|
const QDateTime dateTime = QDateTime::currentDateTime();
|
||||||
|
|
||||||
// set up the next slow update
|
|
||||||
m_slowUpdateStartTimer = std::make_unique<QTimer>();
|
|
||||||
m_slowUpdateStartTimer->setSingleShot(true);
|
|
||||||
connect(m_slowUpdateStartTimer.get(), &QTimer::timeout, this, [this]() {
|
|
||||||
resetSlowUpdateTimers();
|
|
||||||
});
|
|
||||||
updateTransitionTimings(dateTime);
|
updateTransitionTimings(dateTime);
|
||||||
updateTargetTemperature();
|
updateTargetTemperature();
|
||||||
|
|
||||||
|
@ -387,6 +380,9 @@ void NightLightManager::resetSlowUpdateTimers()
|
||||||
qCCritical(KWIN_NIGHTLIGHT) << "Error in time calculation. Deactivating Night Light.";
|
qCCritical(KWIN_NIGHTLIGHT) << "Error in time calculation. Deactivating Night Light.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
m_slowUpdateStartTimer = std::make_unique<QTimer>();
|
||||||
|
m_slowUpdateStartTimer->setSingleShot(true);
|
||||||
|
connect(m_slowUpdateStartTimer.get(), &QTimer::timeout, this, &NightLightManager::resetSlowUpdateTimers);
|
||||||
m_slowUpdateStartTimer->start(diff);
|
m_slowUpdateStartTimer->start(diff);
|
||||||
|
|
||||||
// start the current slow update
|
// start the current slow update
|
||||||
|
|
Loading…
Reference in a new issue