Fix for bug 2719.
--- a/engine/inc/FeedTimer.h Sat May 15 11:13:19 2010 +0100
+++ b/engine/inc/FeedTimer.h Tue May 25 00:31:01 2010 +0100
@@ -36,6 +36,7 @@
private:
TInt iPeriodMinutes;
+ TTime iTriggerTime;
CFeedEngine *iFeedEngine;
};
#endif
--- a/engine/src/FeedTimer.cpp Sat May 15 11:13:19 2010 +0100
+++ b/engine/src/FeedTimer.cpp Tue May 25 00:31:01 2010 +0100
@@ -35,13 +35,26 @@
void CFeedTimer::RunL()
{
- DP("CFeedTimer::RunL");
+ DP("CFeedTimer::RunL BEGIN");
+
+ TTime time;
+ time.UniversalTime();
- // We need to trap this, otherwise we will not reschedule the timer
- TRAP_IGNORE(iFeedEngine->UpdateAllFeedsL(ETrue));
-
- // run again
- RunPeriodically();
+ if (time < iTriggerTime)
+ {
+ // timer was probably reset, this happens on Nokia every 30 minutes
+ DP("Timer reset");
+ AtUTC(iTriggerTime);
+ }
+ else
+ {
+ // We need to trap this, otherwise we will not reschedule the timer
+ TRAP_IGNORE(iFeedEngine->UpdateAllFeedsL(ETrue));
+
+ // run again
+ RunPeriodically();
+ }
+ DP("CFeedTimer::RunL END");
}
void CFeedTimer::SetPeriod(TInt aPeriodMinutes)
@@ -93,8 +106,8 @@
TTimeIntervalMinutes tmi;
tmi = iPeriodMinutes;
- time = time + tmi;
+ iTriggerTime = time + tmi;
DP("Running timer");
- AtUTC(time);
+ AtUTC(iTriggerTime);
}