diff options
author | mkaay <mkaay@mkaay.de> | 2010-11-06 14:13:51 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2010-11-06 14:13:51 +0100 |
commit | efe149e5a08554d63a255e6cd03e952e21eddccd (patch) | |
tree | fba7f160a6614e90da032640ecdc7503140e41a9 /module/AccountManager.py | |
parent | youporn fix (diff) | |
download | pyload-efe149e5a08554d63a255e6cd03e952e21eddccd.tar.xz |
cache fix
Diffstat (limited to 'module/AccountManager.py')
-rw-r--r-- | module/AccountManager.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/module/AccountManager.py b/module/AccountManager.py index 0409e5115..d1733585f 100644 --- a/module/AccountManager.py +++ b/module/AccountManager.py @@ -161,11 +161,13 @@ class AccountManager(): self.saveAccounts() p.getAllAccounts(force=True) - def getAccountInfos(self, force=False, cache=False): + def getCachedAccountInfos(self, refresh=True): + if refresh: + self.core.scheduler.addJob(0, self.core.accountManager.getAccountInfos) + return self.accountInfoCache + + def getAccountInfos(self, force=True): data = {} - if cache: - self.core.scheduler.addJob(0, self.core.accountManager.cacheAccountInfos) #prevent gui from blocking - force = False for p in self.accounts.keys(): if self.accounts[p]: @@ -177,9 +179,6 @@ class AccountManager(): e = AccountUpdateEvent() self.core.pullManager.addEvent(e) return data - - def cacheAccountInfos(self): - self.getAccountInfos(True, True) def sendChange(self): e = AccountUpdateEvent() |