226 line = textStream.readLine() |
227 line = textStream.readLine() |
227 self.__rules.append(AdBlockRule(line)) |
228 self.__rules.append(AdBlockRule(line)) |
228 self.__populateCache() |
229 self.__populateCache() |
229 self.changed.emit() |
230 self.changed.emit() |
230 |
231 |
|
232 self.checkForUpdate() |
|
233 |
|
234 def checkForUpdate(self): |
|
235 """ |
|
236 Public method to check for an update. |
|
237 """ |
231 if not self.__lastUpdate.isValid() or \ |
238 if not self.__lastUpdate.isValid() or \ |
232 self.__lastUpdate.addDays(7) < QDateTime.currentDateTime(): |
239 self.__lastUpdate.addDays(Preferences.getHelp("AdBlockUpdatePeriod")) < \ |
|
240 QDateTime.currentDateTime(): |
233 self.updateNow() |
241 self.updateNow() |
234 |
242 |
235 def updateNow(self): |
243 def updateNow(self): |
236 """ |
244 """ |
237 Public method to update the subscription immediately. |
245 Public method to update the subscription immediately. |