From a393bbf25dd04d3bdc933585914a8b8b0ec0540b Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Thu, 8 Nov 2018 16:59:08 +0100 Subject: [PATCH] Improve read only project file loading This slightly changes the behaviour regarding the read-only mode in project files. It makes sure that we always respect the user's choice to open a file in read-only mode, even if the project file says it wasn't opened in read-only mode before. --- src/MainWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index c2d58b66..e2955ec5 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -2616,8 +2616,8 @@ bool MainWindow::loadProject(QString filename, bool readOnly) if(xml.name() == "db") { // Read only? - if(xml.attributes().hasAttribute("readonly")) - readOnly = xml.attributes().value("readonly").toInt(); + if(xml.attributes().hasAttribute("readonly") && xml.attributes().value("readonly").toInt()) + readOnly = true; // DB file QString dbfilename = xml.attributes().value("path").toString();