From 9e69da6c9ad772afaeb7c28c41c40fe54689cbdc Mon Sep 17 00:00:00 2001 From: "Soren I. Bjornstad" Date: Tue, 22 Jul 2014 11:21:39 -0500 Subject: [PATCH] use Documents/Anki (in English) if no DocumentsLocation Otherwise it gets created directly in the home folder, which is confusing when you would expect that only to happen on older installs which previously used it. --- aqt/profiles.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/aqt/profiles.py b/aqt/profiles.py index f0444fe5e..27009afe0 100644 --- a/aqt/profiles.py +++ b/aqt/profiles.py @@ -224,7 +224,14 @@ and no other programs are accessing your profile folders, then try again.""")) return p else: loc = QDesktopServices.storageLocation(QDesktopServices.DocumentsLocation) - return os.path.join(loc, "Anki") + if loc[:-1] == QDesktopServices.storageLocation( + QDesktopServices.HomeLocation): + # occasionally "documentsLocation" will return the home + # folder because the Documents folder isn't configured + # properly; fall back to an English path + return os.path.expanduser("~/Documents/Anki") + else: + return os.path.join(loc, "Anki") def _loadMeta(self): path = os.path.join(self.base, "prefs.db")