Helpviewer/AdBlock/AdBlockSubscription.py

changeset 1854
191efdc54c62
parent 1509
c0b5e693b0eb
child 1955
9e6da33c1c10
--- a/Helpviewer/AdBlock/AdBlockSubscription.py	Sun May 06 18:10:24 2012 +0200
+++ b/Helpviewer/AdBlock/AdBlockSubscription.py	Sun May 06 19:08:47 2012 +0200
@@ -20,6 +20,7 @@
 import Helpviewer.HelpWindow
 
 import Utilities
+import Preferences
 
 
 class AdBlockSubscription(QObject):
@@ -228,8 +229,15 @@
                     self.__populateCache()
                     self.changed.emit()
         
+        self.checkForUpdate()
+    
+    def checkForUpdate(self):
+        """
+        Public method to check for an update.
+        """
         if not self.__lastUpdate.isValid() or \
-           self.__lastUpdate.addDays(7) < QDateTime.currentDateTime():
+           self.__lastUpdate.addDays(Preferences.getHelp("AdBlockUpdatePeriod")) < \
+                QDateTime.currentDateTime():
             self.updateNow()
     
     def updateNow(self):

eric ide

mercurial