From 222b90e640dafea556fa367005f882633725d516 Mon Sep 17 00:00:00 2001 From: Soren Bjornstad Date: Sat, 1 Jun 2013 13:48:24 -0500 Subject: [PATCH] fix "save image" creating a folder instead of an image --- aqt/stats.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/aqt/stats.py b/aqt/stats.py index b306a2d48..93bf6601a 100644 --- a/aqt/stats.py +++ b/aqt/stats.py @@ -50,11 +50,10 @@ class DeckStats(QDialog): name = time.strftime("-%Y-%m-%d@%H-%M-%S.png", time.localtime(time.time())) name = "anki-"+_("stats")+name - path = os.path.join( - QDesktopServices.storageLocation(QDesktopServices.DesktopLocation), - name) - if not os.path.exists(path): - os.mkdir(path) + desktopPath = QDesktopServices.storageLocation(QDesktopServices.DesktopLocation) + if not os.path.exists(desktopPath): + os.mkdir(desktopPath) + path = os.path.join(desktopPath, name) p = self.form.web.page() oldsize = p.viewportSize() p.setViewportSize(p.mainFrame().contentsSize())