browserutilities/feedsengine/FeedsServer/Server/src/UpdateQueue.cpp
changeset 16 a359256acfc6
parent 0 dd21522fd290
--- a/browserutilities/feedsengine/FeedsServer/Server/src/UpdateQueue.cpp	Fri Jul 03 15:54:40 2009 +0100
+++ b/browserutilities/feedsengine/FeedsServer/Server/src/UpdateQueue.cpp	Thu Aug 27 07:44:59 2009 +0300
@@ -154,3 +154,28 @@
     {
     return iFeedIds.Count();
     }
+
+// -----------------------------------------------------------------------------
+// CUpdateQueue::ResetTimers
+// 
+// Resets all the auto update timers
+// -----------------------------------------------------------------------------
+
+void CUpdateQueue::ResetTimers()
+{
+    iLastAutoUpdate.HomeTime();
+    TDateTime dateTime = iLastAutoUpdate.DateTime();
+    TInt mins;
+
+    switch(iFreq)
+        {
+        case 10080:
+            mins = iLastAutoUpdate.DayNoInWeek()*60*24 + dateTime.Hour() * 60 + dateTime.Minute();
+            break;
+        default:
+            mins = dateTime.Hour() * 60 + dateTime.Minute();
+            break;
+        }
+
+    iLastAutoUpdate = iLastAutoUpdate - TTimeIntervalMinutes(mins % iFreq);
+}