mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
add 'anki' to documentDir
This commit is contained in:
parent
aeb23cdbcc
commit
b3f16c60ff
1 changed files with 10 additions and 4 deletions
|
@ -2832,12 +2832,18 @@ Consider backing up your media directory first."""))
|
||||||
s = QSettings(QSettings.UserScope, "Microsoft", "Windows")
|
s = QSettings(QSettings.UserScope, "Microsoft", "Windows")
|
||||||
s.beginGroup("CurrentVersion/Explorer/Shell Folders")
|
s.beginGroup("CurrentVersion/Explorer/Shell Folders")
|
||||||
self.documentDir = unicode(s.value("Personal").toString())
|
self.documentDir = unicode(s.value("Personal").toString())
|
||||||
if not os.path.exists(self.documentDir):
|
if os.path.exists(self.documentDir):
|
||||||
self.documentDir = os.path.expanduser("~/.anki")
|
self.documentDir = os.path.join(self.documentDir, "Anki")
|
||||||
|
else:
|
||||||
|
self.documentDir = os.path.expanduser("~/.anki/decks")
|
||||||
elif sys.platform.startswith("darwin"):
|
elif sys.platform.startswith("darwin"):
|
||||||
self.documentDir = os.path.expanduser("~/Documents")
|
self.documentDir = os.path.expanduser("~/Documents/Anki")
|
||||||
else:
|
else:
|
||||||
self.documentDir = os.path.expanduser("~/.anki")
|
self.documentDir = os.path.expanduser("~/.anki/decks")
|
||||||
|
try:
|
||||||
|
os.mkdir(self.documentDir)
|
||||||
|
except (OSError, IOError):
|
||||||
|
pass
|
||||||
|
|
||||||
def changeLayoutSpacing(self):
|
def changeLayoutSpacing(self):
|
||||||
if sys.platform.startswith("darwin"):
|
if sys.platform.startswith("darwin"):
|
||||||
|
|
Loading…
Reference in a new issue