From: Michal MalĂ˝ Date: Sat, 18 Apr 2015 00:39:01 +0000 (+0200) Subject: Do not call close on a file that is not open X-Git-Tag: 0.5c~1 X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=14cff3e9ee8124999c93793bbcffd777ff74beab;p=anyanka.git Do not call close on a file that is not open --- diff --git a/datafileexporter.cpp b/datafileexporter.cpp index 54dca7d..493c9ca 100644 --- a/datafileexporter.cpp +++ b/datafileexporter.cpp @@ -80,10 +80,9 @@ exportData(const WriteList& list, const QString& path, const std::string& format if (file.exists()) { int ret = QMessageBox::question(nullptr, "Data export", QString("The selected file \"%1\" already exists. Do you wish to overwrite it?").arg(file.fileName())); - if (ret == QMessageBox::No) { - file.close(); + if (ret == QMessageBox::No) continue; - } else + else file.remove(); }