Fix for bug 2719. symbian1
authorteknolog
Tue, 25 May 2010 00:31:01 +0100
branchsymbian1
changeset 129 7ef9faf10a81
parent 90 d0c0c3e6f7a1
child 130 92572a695a1d
Fix for bug 2719.
engine/inc/FeedTimer.h
engine/src/FeedTimer.cpp
--- 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);
 	}