From d831bbee5f96454d3bbf9313a7a4a3cf30f864ec Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 5 Jul 2016 19:52:26 +1000 Subject: [PATCH] fix exporting & one bug in stats image export --- aqt/exporting.py | 8 ++++---- aqt/stats.py | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/aqt/exporting.py b/aqt/exporting.py index 3befb85af..a5b964fdb 100644 --- a/aqt/exporting.py +++ b/aqt/exporting.py @@ -68,12 +68,12 @@ class ExportDialog(QDialog): # it's a verbatim apkg export, so place on desktop instead of # choosing file; use homedir if no desktop usingHomedir = False - file = os.path.join(QDesktopServices.storageLocation( - QDesktopServices.DesktopLocation), "collection.apkg") + file = os.path.join(QStandardPaths.writableLocation( + QStandardPaths.DesktopLocation), "collection.apkg") if not os.path.exists(os.path.dirname(file)): usingHomedir = True - file = os.path.join(QDesktopServices.storageLocation( - QDesktopServices.HomeLocation), "collection.apkg") + file = os.path.join(QStandardPaths.writableLocation( + QStandardPaths.HomeLocation), "collection.apkg") if os.path.exists(file): if usingHomedir: question = _("%s already exists in your home directory. Overwrite it?") diff --git a/aqt/stats.py b/aqt/stats.py index 7bd252672..2e39dd3f3 100644 --- a/aqt/stats.py +++ b/aqt/stats.py @@ -49,7 +49,8 @@ class DeckStats(QDialog): name = time.strftime("-%Y-%m-%d@%H-%M-%S.png", time.localtime(time.time())) name = "anki-"+_("stats")+name - desktopPath = QDesktopServices.storageLocation(QDesktopServices.DesktopLocation) + desktopPath = QStandardPaths.writableLocation( + QStandardPaths.DesktopLocation) if not os.path.exists(desktopPath): os.mkdir(desktopPath) path = os.path.join(desktopPath, name)