Qtopia-interest Archive, March 2008
Dead code in alarm.cpp magic_countdown
Message 1 in thread
Hey,
my llvm based static code analysis is not yet done so I have to do this by
hand. I had a quick look if I could easily change the alarm settings, which
song to play, how to play it, slowly increasing the volume to wake me up
gently, allow to snooze for a couple of minutes. I see it currently does only
best effort to wake me up, which will fail, I will miss my plane, I will not
be a happy user (not only will I miss my intern-continental flight, but due
the peer pressure of my colleagues will get a phone with a working alarm
clock).
Anyway while browsing the code I saw a variable called magic_countdown and
one else if (magic_countdown) branch. The code is dead, it should be cleaned
up.
z.
PS: Don't laugh, for me an alarm is the killer feature of a phone. I want to
go to bed and be sure that my phone will try everything to wake up me until
its battery is empty and the speakers are broken...
PPS: Feel free to update the requirements of an alarm clock and create tasks
for making the qpe clock an alarm clock.
commit 5cc618bf2fda76dd360e86395896fdba783e8834
commit 5cc618bf2fda76dd360e86395896fdba783e8834
Author: Holger Freyther <zecke@xxxxxxxxxxx>
Date: Wed Mar 19 17:51:01 2008 +0100
Clock: magic_countdown is dead code remove it, also remove the #ifdef
Preserve the usage of magic_daily with the hope other types get added
at one point in the future.
diff --git a/src/applications/clock/alarm.cpp b/src/applications/clock/alarm.cpp
index 49f0805..76b7727 100644
--- a/src/applications/clock/alarm.cpp
+++ b/src/applications/clock/alarm.cpp
@@ -40,15 +40,6 @@
#endif
static const int magic_daily = 2292922;
-static const int magic_countdown = 2292923;
-
-
-#if 0
-static void toggleScreenSaver( bool on )
-{
- QtopiaApplication::setTemporaryScreenSaverMode(on ? QtopiaApplication::Enable : QtopiaApplication::DisableSuspend);
-}
-#endif
void Alarm::setRingPriority(bool v)
{
@@ -158,11 +149,6 @@ void Alarm::triggerAlarm(const QDateTime &when, int type)
alarmt->stop();
setRingPriority(false);
}
- } else if ( type == magic_countdown ) {
- // countdown
- setRingPriority(true);
- Qtopia::soundAlarm();
- setRingPriority(false);
}
}