diff --git a/aqt/profiles.py b/aqt/profiles.py index 66ae1ddc5..743b2e546 100644 --- a/aqt/profiles.py +++ b/aqt/profiles.py @@ -69,6 +69,7 @@ class ProfileManager(object): self.base = os.path.abspath(base) else: self.base = self._defaultBase() + self.maybeMigrateFolder() self.ensureBaseExists() # load metadata self.firstRun = self._loadMeta() @@ -95,6 +96,17 @@ issue, please see the documentation for information on running Anki from \ a flash drive.""" % self.base) raise + # Folder migration + ###################################################################### + + def maybeMigrateFolder(self): + if not isMac: + return + oldBase = os.path.expanduser("~/Documents/Anki") + if not os.path.exists(self.base) and os.path.exists(oldBase): + os.rename(oldBase, self.base) + os.symlink(self.base, oldBase) + # Profile load/save ###################################################################### @@ -217,7 +229,7 @@ and no other programs are accessing your profile folders, then try again.""")) loc = QDesktopServices.storageLocation(QDesktopServices.DocumentsLocation) return os.path.join(loc, "Anki") elif isMac: - return os.path.expanduser("~/Documents/Anki") + return os.path.expanduser("~/Library/Application Support/Anki2") else: # use Documents/Anki on new installs, ~/Anki on existing ones p = os.path.expanduser("~/Anki")