X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Ftimer.cpp;h=e1dba54831b7ccb1258384285363e459126f0f39;hb=981f6e1b3c110aa5128f08a139c47a4c2a5854cd;hp=35930081fb20bc5d24ecb97f5c3fad33df3a2bdd;hpb=8c81978843d45998b02e3556bb4e326c37dac723;p=kitchenalert diff --git a/src/timer.cpp b/src/timer.cpp index 3593008..e1dba54 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -40,6 +40,7 @@ Timer::Timer(QObject *parent) : } + int Timer::getOriginalTimeInSeconds() { return _originalTime; @@ -74,7 +75,7 @@ void Timer::secondPassed() { alerting_ = true; emit alert(whereAmI()); - qDebug() << "alerting"; + qDebug() << "alerted"; } emit remainingTimeChanged(); //after alerting in case of alert so that status gets updated immediately @@ -87,13 +88,20 @@ void Timer::start() alerting_ = false; + if (_originalTime == 0) //has to be checked here, since 00:00:00 alert will already be negative when checked next time + //THIS ALERTS EVERY SECOND TIME THE TIMER IS STARTED! //This bug disappeared without explanation... + { + alerting_ = true; + emit alert(whereAmI()); + qDebug () << "Alerted for 00:00:00 alert"; + } } void Timer::stop() { _actualTimer.stop(); - _remainingTime = 0; //Stopped timer shows 00:00:00 (which unfortunately makes it red...) + _remainingTime = 0; //Stopped timer shows 00:00:00 alerting_ = false; }