From 08fd226d6fae75874b7c149215b52fa76164e797 Mon Sep 17 00:00:00 2001 From: mgrojo Date: Mon, 6 Jan 2020 00:55:33 +0100 Subject: [PATCH] Avoid getting notifications of files just saved by us Closing the file in the destructor seems to be done after the watch is in place, so it can get a notification in some platforms. --- src/SqlExecutionArea.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SqlExecutionArea.cpp b/src/SqlExecutionArea.cpp index 44947684..0e2f30c3 100644 --- a/src/SqlExecutionArea.cpp +++ b/src/SqlExecutionArea.cpp @@ -271,6 +271,8 @@ void SqlExecutionArea::saveFile(const QString& filename) // Write to the file if(f.write(getSql().toUtf8()) != -1) { + // Close file now. If we let the destructor close it, we can get change notifications. + f.close(); // Set modified to false so we can get control of unsaved changes when closing. ui->editEditor->setModified(false);