untitled>mydeck, don't remove on saveas

This commit is contained in:
Damien Elmes 2008-12-23 20:38:19 +09:00
parent c50203b9a1
commit ac15b666ef

View file

@ -1484,9 +1484,6 @@ Return new path, relative to media dir."""
# move media
if oldMediaDir:
newDeck.renameMediaDir(oldMediaDir)
if self.name().startswith("untitled"):
# remove old deck
os.unlink(self.path)
# and return the new deck object
return newDeck
@ -1775,10 +1772,10 @@ class DeckStorage(object):
def newDeckPath():
n = 2
path = os.path.expanduser(
os.path.join(newDeckDir, "untitled.anki"))
os.path.join(newDeckDir, "mydeck.anki"))
while os.path.exists(path):
path = os.path.expanduser(
os.path.join(newDeckDir, "untitled%d.anki") % n)
os.path.join(newDeckDir, "mydeck%d.anki") % n)
n += 1
return path
newDeckPath = staticmethod(newDeckPath)