mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
if win32 document dir invalid, use home dir instead
This commit is contained in:
parent
863dcfe389
commit
ef30c88ad8
1 changed files with 2 additions and 0 deletions
|
@ -2768,6 +2768,8 @@ 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):
|
||||||
|
self.documentDir = os.path.expanduser("~/.anki")
|
||||||
elif sys.platform.startswith("darwin"):
|
elif sys.platform.startswith("darwin"):
|
||||||
self.documentDir = os.path.expanduser("~/Documents")
|
self.documentDir = os.path.expanduser("~/Documents")
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue