Skip to content

Commit

Permalink
Use native separators in save path
Browse files Browse the repository at this point in the history
Signed-off-by: Petru Gurduza <[email protected]>
  • Loading branch information
petrugrd committed Sep 15, 2023
1 parent 09a6e85 commit 79f818e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/screenshotsaver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ bool saveToFilesystemGUI(const QPixmap& capture)
}
#endif
if (!config.savePathFixed()) {
savePath = ShowSaveFileDialog(QObject::tr("Save screenshot"), savePath);
savePath = QDir::toNativeSeparators(
ShowSaveFileDialog(QObject::tr("Save screenshot"), savePath));
}
if (savePath == "") {
return okay;
Expand All @@ -191,7 +192,7 @@ bool saveToFilesystemGUI(const QPixmap& capture)

if (okay) {
QString pathNoFile =
savePath.left(savePath.lastIndexOf(QLatin1String("/")));
savePath.left(savePath.lastIndexOf(QDir::separator()));

ConfigHandler().setSavePath(pathNoFile);

Expand All @@ -200,8 +201,7 @@ bool saveToFilesystemGUI(const QPixmap& capture)

if (config.copyPathAfterSave()) {
FlameshotDaemon::copyToClipboard(
QDir::toNativeSeparators(savePath),
QObject::tr("Path copied to clipboard as ") + savePath);
savePath, QObject::tr("Path copied to clipboard as ") + savePath);
}

} else {
Expand Down

0 comments on commit 79f818e

Please sign in to comment.