Commit dbdaf6c8 authored by Roman Gilg's avatar Roman Gilg

[Night Color] Check read in mode value

KConfigSkeleton does not check arbitrary enum values on being
correct. So we do it explicity in our code.

Reviewers: #kwin, graesslin

Subscribers: kwin, plasma-devel, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D9310
parent 112d30b5
......@@ -156,7 +156,15 @@ void Manager::readConfig()
s->load();
m_active = s->active();
m_mode = s->mode();
NightColorMode mode = s->mode();
if (mode == NightColorMode::Location || mode == NightColorMode::Timings) {
m_mode = mode;
} else {
// also fallback for invalid setting values
m_mode = NightColorMode::Automatic;
}
m_nightTargetTemp = qBound(MIN_TEMPERATURE, s->nightTemperature(), NEUTRAL_TEMPERATURE);
double lat, lng;
......
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