From 7cbc1f076f485f60eee630f449ce3fa8da04bf82 Mon Sep 17 00:00:00 2001 From: Jeremy Borgman Date: Wed, 31 Mar 2021 13:00:11 -0500 Subject: [PATCH] restructured so clipboard actions happen after copy --- src/utils/screenshotsaver.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/utils/screenshotsaver.cpp b/src/utils/screenshotsaver.cpp index 34b9ab5d..6be5a0d4 100644 --- a/src/utils/screenshotsaver.cpp +++ b/src/utils/screenshotsaver.cpp @@ -135,17 +135,26 @@ bool ScreenshotSaver::saveToFilesystemGUI(const QPixmap& capture) if (ok) { QString pathNoFile = savePath.left(savePath.lastIndexOf(QLatin1String("/"))); + ConfigHandler().setSavePath(pathNoFile); + QString msg = QObject::tr("Capture saved as ") + savePath; + if (config.copyPathAfterSaveEnabled()) { - QApplication::clipboard()->setText(savePath); msg = QObject::tr("Capture is saved and copied to the clipboard as ") + savePath; } + SystemNotification().sendMessage(msg, savePath); + Controller::getInstance()->sendCaptureSaved( m_id, QFileInfo(savePath).canonicalFilePath()); + + if (config.copyPathAfterSaveEnabled()) { + QApplication::clipboard()->setText(savePath); + } + } else { QString msg = QObject::tr("Error trying to save as ") + savePath; QMessageBox saveErrBox(