From a5d22de63ac64a5df44260de3f5b5edcfcfa627d Mon Sep 17 00:00:00 2001 From: Matthias Puchner <github@mpuchner.de> Date: Tue, 30 Nov 2021 07:12:00 +0100 Subject: [PATCH] rename fn to what it really does --- GUI/Model/Session/SessionModel.cpp | 2 +- GUI/Model/Session/SessionXML.cpp | 8 ++++---- GUI/Model/Session/SessionXML.h | 2 +- Tests/Unit/GUI/TestSessionXML.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/GUI/Model/Session/SessionModel.cpp b/GUI/Model/Session/SessionModel.cpp index 19d816a4d72..013ad4fee41 100644 --- a/GUI/Model/Session/SessionModel.cpp +++ b/GUI/Model/Session/SessionModel.cpp @@ -379,7 +379,7 @@ void SessionModel::readFrom(QXmlStreamReader* reader, MessageService* messageSer void SessionModel::writeTo(QXmlStreamWriter* writer) { - GUI::Session::XML::writeTo(writer, m_root_item); + GUI::Session::XML::writeModel(writer, m_root_item); } //! Move given parameterized item to the new_parent at given row. If new_parent is not defined, diff --git a/GUI/Model/Session/SessionXML.cpp b/GUI/Model/Session/SessionXML.cpp index dfb3b438ad6..f1118ea39ac 100644 --- a/GUI/Model/Session/SessionXML.cpp +++ b/GUI/Model/Session/SessionXML.cpp @@ -54,13 +54,13 @@ SessionItem* createItem(SessionItem* parent, const QString& modelType, const QSt } // namespace -void GUI::Session::XML::writeTo(QXmlStreamWriter* writer, SessionItem* parent) +void GUI::Session::XML::writeModel(QXmlStreamWriter* writer, SessionItem* modelRootItem) { ASSERT(writer); - ASSERT(parent); - writer->writeStartElement(parent->model()->getModelTag()); + ASSERT(modelRootItem); + writer->writeStartElement(modelRootItem->model()->getModelTag()); - writeItemAndChildItems(writer, parent); + writeItemAndChildItems(writer, modelRootItem); writer->writeEndElement(); // m_model_tag } diff --git a/GUI/Model/Session/SessionXML.h b/GUI/Model/Session/SessionXML.h index 5d9b12ff2f4..05f4f22250c 100644 --- a/GUI/Model/Session/SessionXML.h +++ b/GUI/Model/Session/SessionXML.h @@ -54,7 +54,7 @@ const QString ParameterExtAttribute("ParExt"); const QString ExternalPropertyColorAtt("Color"); const QString ExternalPropertyIdentifierAtt("Identifier"); -void writeTo(QXmlStreamWriter* writer, SessionItem* parent); +void writeModel(QXmlStreamWriter* writer, SessionItem* modelRootItem); void writeItemAndChildItems(QXmlStreamWriter* writer, const SessionItem* item); //! Write the variant as a complete tag, including the given role diff --git a/Tests/Unit/GUI/TestSessionXML.cpp b/Tests/Unit/GUI/TestSessionXML.cpp index d353986cb73..39a76f641ae 100644 --- a/Tests/Unit/GUI/TestSessionXML.cpp +++ b/Tests/Unit/GUI/TestSessionXML.cpp @@ -14,7 +14,7 @@ QString itemToXML(SessionItem* item) { QString result; QXmlStreamWriter writer(&result); - GUI::Session::XML::writeTo(&writer, item); + GUI::Session::XML::writeModel(&writer, item); return result; } -- GitLab