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
---------
* Fix the missing folder error that occured when a new remote folder was
detected (IMAP<->Maildir)

View File

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