MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / timesAreInInterval

Function timesAreInInterval

lib/legacy/switch-time.cpp:81–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81bool timesAreInInterval(QTime &time1, QTime &time2, int &interval)
82{
83 if (time1.isNull() || time2.isNull()) {
84 return false;
85 }
86
87 bool ret = false;
88 QTime validSwitchTimeWindow = time1.addMSecs(interval);
89
90 ret = time1 <= time2 && time2 <= validSwitchTimeWindow;
91 // Check for overflow
92 if (!ret && validSwitchTimeWindow.msecsSinceStartOfDay() < interval) {
93 ret = time2 >= time1 || time2 <= validSwitchTimeWindow;
94 }
95 return ret;
96}
97
98bool checkLiveTime(TimeSwitch &s, QDateTime &start, int &interval)
99{

Callers 2

checkLiveTimeFunction · 0.85
checkRegularTimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected