Skip to content

Commit 1b8d833

Browse files
committed
Fix DD check
1 parent 314a927 commit 1b8d833

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

SmartTimer/widgetsettings.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,25 @@ int elpasedTime(QTime time)
1919
bool DDCheck(GlobalSettings globalSettings)
2020
{
2121
int currTime = elpasedTime(QTime::currentTime());
22-
if (currTime>=globalSettings.DDstart && currTime <= globalSettings.DDend )
23-
return false;
22+
23+
if (globalSettings.DDenabled)
24+
{
25+
if(globalSettings.DDstart<globalSettings.DDend)
26+
{
27+
if (currTime>=globalSettings.DDstart && currTime <= globalSettings.DDend )
28+
return false;
29+
else
30+
return true;
31+
}
32+
else
33+
{
34+
if (currTime>=globalSettings.DDstart || currTime <= globalSettings.DDend)
35+
return false;
36+
else
37+
return true;
38+
}
39+
}
2440
else
2541
return true;
42+
2643
}

0 commit comments

Comments
 (0)