Fix "getfolders() asked to get nonexisting folder" bug

When a new remote folder was detected, we tried to create the folder
locally on the Maildir and called repository.forgetfolders() to force a
new scanning of the Maildir. However, that implementation used the
inherited base function that did nothing. We simply needed to implement
forgetfolders() to set self.folder=None, so we would force a new read in
of the updated local folder structure.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth 2012-01-05 14:18:29 +01:00
parent 3e28073f98
commit a280a905ca
2 changed files with 9 additions and 1 deletions

View File

@ -18,3 +18,7 @@ Changes
Bug Fixes Bug Fixes
--------- ---------
* Fix the missing folder error that occured when a new remote folder was
detected (IMAP<->Maildir)

View File

@ -190,4 +190,8 @@ class MaildirRepository(BaseRepository):
if self.folders == None: if self.folders == None:
self.folders = self._getfolders_scandir(self.root) self.folders = self._getfolders_scandir(self.root)
return self.folders return self.folders
def forgetfolders(self):
"""Forgets the cached list of folders, if any. Useful to run
after a sync run."""
self.folders = None