diff --git a/src/plugins/nightlight/nightlightmanager.cpp b/src/plugins/nightlight/nightlightmanager.cpp index f92b615a95..b94dc99316 100644 --- a/src/plugins/nightlight/nightlightmanager.cpp +++ b/src/plugins/nightlight/nightlightmanager.cpp @@ -279,8 +279,12 @@ void NightLightManager::readConfig() // fixed timings QTime mrB = QTime::fromString(s->morningBeginFixed(), "hhmm"); QTime evB = QTime::fromString(s->eveningBeginFixed(), "hhmm"); + if (mrB >= evB) { + mrB = QTime(6, 0); + evB = QTime(18, 0); + } - int diffME = evB > mrB ? mrB.msecsTo(evB) : evB.msecsTo(mrB); + int diffME = mrB.msecsTo(evB); int diffMin = std::min(diffME, MSC_DAY - diffME); int trTime = s->transitionTime() * 1000 * 60;