Quick synchronizations (for 'quick' > 0) are now performed between full synchronizations (as specified in the documentation).

Hello John,

 The attached patch makes quick synchronization work again (according to
 the documentation), so there are <quick> quick synchronizations
 performed between full synchronizations.

 Thanks,
        Michal
This commit is contained in:
Michal Vitecek 2009-07-10 11:27:31 +02:00 committed by John Goerzen
parent dd351a2465
commit 220db8a77d

View File

@ -109,6 +109,7 @@ class Account(CustomConfig.ConfigHelperMixin):
self.localeval = config.getlocaleval() self.localeval = config.getlocaleval()
self.ui = UIBase.getglobalui() self.ui = UIBase.getglobalui()
self.refreshperiod = self.getconffloat('autorefresh', 0.0) self.refreshperiod = self.getconffloat('autorefresh', 0.0)
self.quickrefreshcount = self.getconfint('quick', 0)
self.quicknum = 0 self.quicknum = 0
if self.refreshperiod == 0.0: if self.refreshperiod == 0.0:
self.refreshperiod = None self.refreshperiod = None
@ -145,7 +146,10 @@ class Account(CustomConfig.ConfigHelperMixin):
for item in kaobjs: for item in kaobjs:
item.startkeepalive() item.startkeepalive()
refreshperiod = int(self.refreshperiod * 60) sleeptime = int(self.refreshperiod * 60)
if (self.quickrefreshcount > 0):
sleeptime = int(sleeptime / self.quickrefreshcount)
# try: # try:
# sleepresult = siglistener.get_nowait() # sleepresult = siglistener.get_nowait()
# # retrieved signal before sleep started # # retrieved signal before sleep started
@ -153,8 +157,8 @@ class Account(CustomConfig.ConfigHelperMixin):
# # catching signal 1 here means folders were cleared before signal was posted # # catching signal 1 here means folders were cleared before signal was posted
# pass # pass
# except Empty: # except Empty:
# sleepresult = self.ui.sleep(refreshperiod, siglistener) # sleepresult = self.ui.sleep(sleeptime, siglistener)
sleepresult = self.ui.sleep(refreshperiod, siglistener) sleepresult = self.ui.sleep(sleeptime, siglistener)
if sleepresult == 1: if sleepresult == 1:
self.quicknum = 0 self.quicknum = 0