mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 16:26:40 -04:00
untitled>mydeck, don't remove on saveas
This commit is contained in:
parent
c50203b9a1
commit
ac15b666ef
1 changed files with 2 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue