From d3a9adbe4433db119ba0b325c2464ca629c3c87e Mon Sep 17 00:00:00 2001 From: Andre Rummler Date: Thu, 24 Sep 2026 12:32:47 +0200 Subject: [PATCH] Fix warning about reading XML without explicit file opening. This was implicit up to now and will go away in future Qt versions. --- sources/ElementsCollection/elementslocation.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sources/ElementsCollection/elementslocation.cpp b/sources/ElementsCollection/elementslocation.cpp index 075ea9b82..7c34f923a 100644 --- a/sources/ElementsCollection/elementslocation.cpp +++ b/sources/ElementsCollection/elementslocation.cpp @@ -653,9 +653,16 @@ QDomElement ElementsLocation::xml() const if (!m_project) { QFile file (m_file_system_path); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) + return QDomElement(); + QDomDocument docu; if (docu.setContent(&file)) + { + file.close(); return docu.documentElement(); + } + file.close(); } else {