Fix the order of folders during sync
was broken by e1fb9492f84538df698d6a2f1cfa2738929ed040 (Patch for signal handling to start a sync by Jim Prior) This patch from Nicolas Dandrimont. Closes: #535540.
This commit is contained in:
parent
5c11de5285
commit
7bdd4a69fa
@ -37,9 +37,9 @@ class SigListener(Queue):
|
|||||||
# folders haven't yet been added, or this account is once-only; drop signal
|
# folders haven't yet been added, or this account is once-only; drop signal
|
||||||
return
|
return
|
||||||
elif self.folders:
|
elif self.folders:
|
||||||
for folder in self.folders:
|
for foldernr in range(len(self.folders)):
|
||||||
# requeue folder
|
# requeue folder
|
||||||
self.folders[folder] = True
|
self.folders[foldernr][1] = True
|
||||||
self.quick = False
|
self.quick = False
|
||||||
return
|
return
|
||||||
# else folders have already been cleared, put signal...
|
# else folders have already been cleared, put signal...
|
||||||
@ -49,22 +49,22 @@ class SigListener(Queue):
|
|||||||
def addfolders(self, remotefolders, autorefreshes, quick):
|
def addfolders(self, remotefolders, autorefreshes, quick):
|
||||||
self.folderlock.acquire()
|
self.folderlock.acquire()
|
||||||
try:
|
try:
|
||||||
self.folders = {}
|
self.folders = []
|
||||||
self.quick = quick
|
self.quick = quick
|
||||||
self.autorefreshes = autorefreshes
|
self.autorefreshes = autorefreshes
|
||||||
for folder in remotefolders:
|
for folder in remotefolders:
|
||||||
# new folders are queued
|
# new folders are queued
|
||||||
self.folders[folder] = True
|
self.folders.append([folder, True])
|
||||||
finally:
|
finally:
|
||||||
self.folderlock.release()
|
self.folderlock.release()
|
||||||
def clearfolders(self):
|
def clearfolders(self):
|
||||||
self.folderlock.acquire()
|
self.folderlock.acquire()
|
||||||
try:
|
try:
|
||||||
for folder in self.folders:
|
for folder, queued in self.folders:
|
||||||
if self.folders[folder]:
|
if queued:
|
||||||
# some folders still in queue
|
# some folders still in queue
|
||||||
return False
|
return False
|
||||||
self.folders.clear()
|
self.folders[:] = []
|
||||||
return True
|
return True
|
||||||
finally:
|
finally:
|
||||||
self.folderlock.release()
|
self.folderlock.release()
|
||||||
@ -74,10 +74,10 @@ class SigListener(Queue):
|
|||||||
dirty = True
|
dirty = True
|
||||||
while dirty:
|
while dirty:
|
||||||
dirty = False
|
dirty = False
|
||||||
for folder in self.folders:
|
for foldernr, (folder, queued) in enumerate(self.folders):
|
||||||
if self.folders[folder]:
|
if queued:
|
||||||
# mark folder as no longer queued
|
# mark folder as no longer queued
|
||||||
self.folders[folder] = False
|
self.folders[foldernr][1] = False
|
||||||
dirty = True
|
dirty = True
|
||||||
quick = self.quick
|
quick = self.quick
|
||||||
self.folderlock.release()
|
self.folderlock.release()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user