mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -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):
|
||||
if isWin:
|
||||
s = QSettings(QSettings.UserScope, "Microsoft", "Windows")
|
||||
s.beginGroup("CurrentVersion/Explorer/Shell Folders")
|
||||
d = s.value("Personal")
|
||||
return os.path.join(d, "Anki")
|
||||
if qtmajor >= 5:
|
||||
loc = QStandardPaths.writeableLocation(QStandardPaths.DocumentsLocation)
|
||||
else:
|
||||
loc = QDesktopServices.storageLocation(QDesktopServices.DocumentsLocation)
|
||||
return os.path.join(loc, "Anki")
|
||||
elif isMac:
|
||||
return os.path.expanduser("~/Documents/Anki")
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue