From e4f067b86d11c8e3233382bf5394300b0a142d42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haris=20Gu=C5=A1i=C4=87?= Date: Mon, 30 Aug 2021 18:11:52 +0200 Subject: [PATCH] Fix wrong default config export path (#1848) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Haris Gušić --- src/config/generalconf.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/config/generalconf.cpp b/src/config/generalconf.cpp index 9ecb3372..097d6fd1 100644 --- a/src/config/generalconf.cpp +++ b/src/config/generalconf.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -149,11 +150,12 @@ void GeneralConf::importConfiguration() void GeneralConf::exportFileConfiguration() { - QString fileName = QFileDialog::getSaveFileName( - this, tr("Save File"), QStringLiteral("flameshot.conf")); + QString defaultFileName = QSettings().fileName(); + QString fileName = + QFileDialog::getSaveFileName(this, tr("Save File"), defaultFileName); - // Cancel button - if (fileName.isNull()) { + // Cancel button or target same as source + if (fileName.isNull() || fileName == defaultFileName) { return; }