Copy file path (not url) on saving to disk

This commit is contained in:
Yuriy Puchkov
2020-09-03 18:40:49 +03:00
parent 77c3d785ab
commit 0fce7472fd
22 changed files with 717 additions and 499 deletions

View File

@@ -79,9 +79,14 @@ bool ScreenshotSaver::saveToFilesystemGUI(const QPixmap &capture) {
ok = capture.save(savePath);
if (ok) {
ConfigHandler config;
QString pathNoFile = savePath.left(savePath.lastIndexOf(QLatin1String("/")));
ConfigHandler().setSavePath(pathNoFile);
config.setSavePath(pathNoFile);
QString msg = QObject::tr("Capture saved as ") + savePath;
if(config.copyPathAfterSaveEnabled()) {
QApplication::clipboard()->setText(savePath);
msg = QObject::tr("Capture saved and copied to the clipboard as ") + savePath;
}
SystemNotification().sendMessage(msg, savePath);
} else {
QString msg = QObject::tr("Error trying to save as ") + savePath;