From 1c56ab829f04ea5b127c1c632cec330e47bca524 Mon Sep 17 00:00:00 2001 From: sandman Date: Sun, 09 Jun 2002 23:42:42 +0000 Subject: Fixed a counter bug in alarm timer loop. --- (limited to 'core') diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp index 8614b3f..2c2965e 100644 --- a/core/pim/datebook/datebook.cpp +++ b/core/pim/datebook/datebook.cpp @@ -81,7 +81,8 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f ) presetTime( -1 ), startTime( 8 ), // an acceptable default syncing(FALSE), - inSearch(FALSE) + inSearch(FALSE), + alarmCounter(0) { QTime t; t.start(); @@ -614,6 +615,7 @@ void DateBook::appMessage(const QCString& msg, const QByteArray& data) if ( found ) { if ( bSound ) { Sound::soundAlarm(); + alarmCounter = 0; stopTimer = startTimer( 5000 ); } @@ -683,14 +685,12 @@ void DateBook::flush() void DateBook::timerEvent( QTimerEvent *e ) { - static int stop = 0; - if ( stop < 10 ) { + if ( alarmCounter < 10 ) { + alarmCounter++; Sound::soundAlarm(); - stop++; - } else { - stop = 0; + } + else killTimer( e->timerId() ); - } } void DateBook::changeClock( bool newClock ) diff --git a/core/pim/datebook/datebook.h b/core/pim/datebook/datebook.h index d1fe90d..e7be0dd 100644 --- a/core/pim/datebook/datebook.h +++ b/core/pim/datebook/datebook.h @@ -120,6 +120,8 @@ private: bool syncing; bool inSearch; + int alarmCounter; + QString checkEvent(const Event &); }; -- cgit v0.9.0.2