mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 16:02:23 -04:00
more robust desktop location detection
This commit is contained in:
parent
f6f6537967
commit
ce99114dc3
1 changed files with 5 additions and 4 deletions
|
@ -180,10 +180,11 @@ documentation for information on using a flash drive.""")
|
||||||
|
|
||||||
def _defaultBase(self):
|
def _defaultBase(self):
|
||||||
if isWin:
|
if isWin:
|
||||||
s = QSettings(QSettings.UserScope, "Microsoft", "Windows")
|
if qtmajor >= 5:
|
||||||
s.beginGroup("CurrentVersion/Explorer/Shell Folders")
|
loc = QStandardPaths.writeableLocation(QStandardPaths.DocumentsLocation)
|
||||||
d = s.value("Personal")
|
else:
|
||||||
return os.path.join(d, "Anki")
|
loc = QDesktopServices.storageLocation(QDesktopServices.DocumentsLocation)
|
||||||
|
return os.path.join(loc, "Anki")
|
||||||
elif isMac:
|
elif isMac:
|
||||||
return os.path.expanduser("~/Documents/Anki")
|
return os.path.expanduser("~/Documents/Anki")
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue