local status: deletemessagelist: remove broken code

This did not work and is not usefull since the purge() method was introduced in
1410a391bc. Actually, the purge() does what deletemessagelist() was supposed to
achieve.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht 2016-07-25 14:50:08 +02:00
parent fbc3b15888
commit 5aa2a883f0
3 changed files with 5 additions and 26 deletions

View File

@ -533,17 +533,8 @@ def syncfolder(account, remotefolder, quick):
statusfolder = statusrepos.getfolder(remotefolder.getvisiblename(). statusfolder = statusrepos.getfolder(remotefolder.getvisiblename().
replace(remoterepos.getsep(), statusrepos.getsep())) replace(remoterepos.getsep(), statusrepos.getsep()))
statusfolder.openfiles() statusfolder.openfiles()
if localfolder.get_uidvalidity() == None:
# This is a new folder, so delete the status cache to be
# sure we don't have a conflict.
# TODO: This does not work. We always return a value, need
# to rework this...
statusfolder.deletemessagelist()
statusfolder.cachemessagelist() statusfolder.cachemessagelist()
# Load local folder. # Load local folder.
ui.syncingfolder(remoterepos, remotefolder, localrepos, localfolder) ui.syncingfolder(remoterepos, remotefolder, localrepos, localfolder)

View File

@ -50,10 +50,6 @@ class LocalStatusFolder(BaseFolder):
def getfullname(self): def getfullname(self):
return self.filename return self.filename
def deletemessagelist(self):
if not self.isnewfolder():
os.unlink(self.filename)
# Interface from BaseFolder # Interface from BaseFolder
def msglist_item_initializer(self, uid): def msglist_item_initializer(self, uid):
return {'uid': uid, 'flags': set(), 'labels': set(), 'time': 0, 'mtime': 0} return {'uid': uid, 'flags': set(), 'labels': set(), 'time': 0, 'mtime': 0}

View File

@ -118,14 +118,6 @@ class LocalStatusSQLiteFolder(BaseFolder):
def isnewfolder(self): def isnewfolder(self):
return self._newfolder return self._newfolder
# Interface from LocalStatusFolder
def deletemessagelist(self):
"""Delete all messages in the db."""
self.__sql_write('DELETE FROM status')
def __sql_write(self, sql, vars=None, executemany=False): def __sql_write(self, sql, vars=None, executemany=False):
"""Execute some SQL, retrying if the db was locked. """Execute some SQL, retrying if the db was locked.