Fix #169: Unable to write file when exporting config

This commit is contained in:
lupoDharkael
2018-03-18 13:15:09 +01:00
parent 0523a83722
commit 0e81c6b1f9

View File

@@ -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."));