From 14cff3e9ee8124999c93793bbcffd777ff74beab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Sat, 18 Apr 2015 02:39:01 +0200 Subject: [PATCH] Do not call close on a file that is not open --- datafileexporter.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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(); } -- 2.43.5