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)