diff --git a/src/utils/screenshotsaver.cpp b/src/utils/screenshotsaver.cpp index b6bd3eee..3e13dcb4 100644 --- a/src/utils/screenshotsaver.cpp +++ b/src/utils/screenshotsaver.cpp @@ -41,18 +41,21 @@ bool ScreenshotSaver::saveToFilesystem(const QPixmap &capture, completePath += ".png"; bool ok = capture.save(completePath); QString saveMessage; + if (ok) { ConfigHandler().setSavePath(path); saveMessage = QObject::tr("Capture saved as ") + completePath; } else { saveMessage = QObject::tr("Error trying to save as ") + completePath; } + SystemNotification().sendMessage(saveMessage); return ok; } bool ScreenshotSaver::saveToFilesystemGUI(const QPixmap &capture) { bool ok = false; + while (!ok) { QString savePath = QFileDialog::getSaveFileName( nullptr, @@ -62,7 +65,13 @@ bool ScreenshotSaver::saveToFilesystemGUI(const QPixmap &capture) { if (savePath.isNull()) { break; } + + if (!savePath.endsWith(".png")) { + savePath += ".png"; + } + ok = capture.save(savePath); + if (ok) { QString pathNoFile = savePath.left(savePath.lastIndexOf("/")); ConfigHandler().setSavePath(pathNoFile);