restructured so clipboard actions happen after copy

This commit is contained in:
Jeremy Borgman
2021-03-31 13:00:11 -05:00
committed by borgmanJeremy
parent 1779a88bb5
commit 7cbc1f076f

View File

@@ -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(