Don't pass a list to ui.copyingmessage()

We only copy to a single folder anyway, so clean up the code to only
pass in a single folder.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Sebastian Spaeth 2011-08-15 09:58:46 +02:00 committed by Nicolas Sebrecht
parent 38b1d7b085
commit 6f9b171ffd
4 changed files with 14 additions and 12 deletions

View File

@ -244,7 +244,7 @@ class BaseFolder(object):
statusfolder.savemessage(uid, None, flags, rtime) statusfolder.savemessage(uid, None, flags, rtime)
return return
self.ui.copyingmessage(uid, self, [dstfolder]) self.ui.copyingmessage(uid, self, dstfolder)
# If any of the destinations actually stores the message body, # If any of the destinations actually stores the message body,
# load it up. # load it up.
if dstfolder.storesmessages(): if dstfolder.storesmessages():
@ -254,6 +254,7 @@ class BaseFolder(object):
#UID. If newid is 0, saving succeeded, but we could not #UID. If newid is 0, saving succeeded, but we could not
#retrieve the new UID. Ignore message in this case. #retrieve the new UID. Ignore message in this case.
newuid = dstfolder.savemessage(uid, message, flags, rtime) newuid = dstfolder.savemessage(uid, message, flags, rtime)
if newuid > 0: if newuid > 0:
if newuid != uid: if newuid != uid:
# Got new UID, change the local uid. # Got new UID, change the local uid.

View File

@ -54,9 +54,9 @@ class BlinkenBase:
s.gettf().setcolor('blue') s.gettf().setcolor('blue')
s.__class__.__bases__[-1].syncingmessages(s, sr, sf, dr, df) s.__class__.__bases__[-1].syncingmessages(s, sr, sf, dr, df)
def copyingmessage(s, uid, src, destlist): def copyingmessage(s, uid, src, destfolder):
s.gettf().setcolor('orange') s.gettf().setcolor('orange')
s.__class__.__bases__[-1].copyingmessage(s, uid, src, destlist) s.__class__.__bases__[-1].copyingmessage(s, uid, src, destfolder)
def deletingmessages(s, uidlist, destlist): def deletingmessages(s, uidlist, destlist):
s.gettf().setcolor('red') s.gettf().setcolor('red')

View File

@ -108,10 +108,10 @@ class MachineUI(UIBase):
(s.getnicename(sr), sf.getname(), s.getnicename(dr), (s.getnicename(sr), sf.getname(), s.getnicename(dr),
df.getname())) df.getname()))
def copyingmessage(s, uid, src, destlist): def copyingmessage(s, uid, src, destfolder):
ds = s.folderlist(destlist) s._printData('copyingmessage', "%d\n%s\n%s\n%s[%s]" % \
s._printData('copyingmessage', "%d\n%s\n%s\n%s" % \ (uid, s.getnicename(src), src.getname(),
(uid, s.getnicename(src), src.getname(), ds)) destfolder.getnicename(), destfolder))
def folderlist(s, list): def folderlist(s, list):
return ("\f".join(["%s\t%s" % (s.getnicename(x), x.getname()) for x in list])) return ("\f".join(["%s\t%s" % (s.getnicename(x), x.getname()) for x in list]))

View File

@ -285,11 +285,12 @@ class UIBase:
s.getnicename(dr), s.getnicename(dr),
df.getname())) df.getname()))
def copyingmessage(s, uid, src, destlist): def copyingmessage(self, uid, src, destfolder):
if s.verbose >= 0: """Output a log line stating which message we copy"""
ds = s.folderlist(destlist) if self.verbose >= 0:
s._msg("Copy message %d %s[%s] -> %s" % (uid, s.getnicename(src), self._msg("Copy message %d %s[%s] -> %s[%s]" % \
src.getname(), ds)) (uid, self.getnicename(src), src,
self.getnicename(destfolder), destfolder))
def deletingmessage(s, uid, destlist): def deletingmessage(s, uid, destlist):
if s.verbose >= 0: if s.verbose >= 0: