From 0e81c6b1f9ffab8dc0cfff77429ebe7abf9b711d Mon Sep 17 00:00:00 2001 From: lupoDharkael Date: Sun, 18 Mar 2018 13:15:09 +0100 Subject: [PATCH] Fix #169: Unable to write file when exporting config --- src/config/geneneralconf.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/config/geneneralconf.cpp b/src/config/geneneralconf.cpp index cce5c28d..d34b5ff0 100644 --- a/src/config/geneneralconf.cpp +++ b/src/config/geneneralconf.cpp @@ -100,6 +100,10 @@ void GeneneralConf::importConfiguration() { void GeneneralConf::exportFileConfiguration() { QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), "flameshot.conf"); + QFile targetFile(fileName); + if (targetFile.exists()) { + targetFile.remove(); + } bool ok = QFile::copy(ConfigHandler().configFilePath(), fileName); if (!ok) { QMessageBox::about(this, tr("Error"), tr("Unable to write file."));