From ce99114dc354777ec95664de3fea9db16c65a820 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 12 May 2013 17:24:01 +0900 Subject: [PATCH] more robust desktop location detection --- aqt/profiles.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/aqt/profiles.py b/aqt/profiles.py index 477b7b553..365bc8f8f 100644 --- a/aqt/profiles.py +++ b/aqt/profiles.py @@ -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: