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.
This commit is contained in:
Martin Kleusberg
2018-11-08 16:59:08 +01:00
parent a8338406c9
commit a393bbf25d

View File

@@ -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();