From 576aaba67a695700fac0ca15ecc1cc785f30ddce Mon Sep 17 00:00:00 2001
From: Mikhail Svechnikov <m.svechnikov@fz-juelich.de>
Date: Wed, 21 Dec 2022 19:37:43 +0100
Subject: [PATCH] delete 'Streamer'

---
 .../CatSample/InterferenceItemCatalog.cpp     |   1 +
 .../CatSample/ItemWithParticlesCatalog.cpp    |   1 +
 GUI/Model/Descriptor/DistributionItems.cpp    |   1 -
 GUI/Model/Descriptor/SelectionProperty.h      |   1 -
 GUI/Model/Device/BeamItems.cpp                |   3 +-
 GUI/Model/Device/ResolutionFunctionItems.cpp  |   1 -
 .../Device/SpecularBeamInclinationItem.cpp    |   3 +-
 GUI/Model/Job/JobItem.cpp                     |   1 -
 GUI/Model/Project/ProjectDocument.cpp         |   6 +-
 GUI/Model/Sample/CompoundItem.cpp             |   1 +
 GUI/Model/Sample/FormFactorItems.h            |   1 -
 GUI/Model/Sample/LayerItem.cpp                |   4 +-
 GUI/Model/Sample/MaterialItem.cpp             |   1 -
 GUI/Model/Sample/ParticleLayoutItem.cpp       |   3 +-
 GUI/Model/Sample/SampleValidator.cpp          |   4 +-
 GUI/Model/ToCore/SampleToCore.cpp             |   3 +-
 GUI/Support/Data/SimulationOptionsItem.cpp    |   1 -
 GUI/Support/XML/Streamer.cpp                  |  96 ----------------
 GUI/Support/XML/Streamer.h                    | 105 ------------------
 GUI/View/Instrument/DistributionEditor.cpp    |   1 -
 GUI/View/Instrument/GISASBeamEditor.cpp       |   3 +-
 .../Instrument/InclinationAnglesEditor.cpp    |   3 +-
 GUI/View/Instrument/SpecularBeamEditor.cpp    |   3 +-
 GUI/View/SampleDesigner/CoreAndShellForm.cpp  |   3 +-
 .../LatticeTypeSelectionForm.cpp              |   3 +-
 GUI/View/SampleDesigner/LayerEditorUtils.cpp  |   4 +-
 GUI/View/SampleDesigner/MesocrystalForm.cpp   |   4 +-
 .../SampleDesigner/ParticleLayoutForm.cpp     |   4 +-
 Tests/Unit/GUI/TestSessionXML.cpp             |   3 +-
 29 files changed, 35 insertions(+), 233 deletions(-)
 delete mode 100644 GUI/Support/XML/Streamer.cpp
 delete mode 100644 GUI/Support/XML/Streamer.h

diff --git a/GUI/Model/CatSample/InterferenceItemCatalog.cpp b/GUI/Model/CatSample/InterferenceItemCatalog.cpp
index f86ce4241fa..58eff0d118f 100644
--- a/GUI/Model/CatSample/InterferenceItemCatalog.cpp
+++ b/GUI/Model/CatSample/InterferenceItemCatalog.cpp
@@ -12,6 +12,7 @@
 //
 //  ************************************************************************************************
 
+#include "Base/Util/Assert.h"
 #include "GUI/Model/CatSample/InterferenceItemCatalog.h"
 #include "GUI/Model/Sample/InterferenceItems.h"
 
diff --git a/GUI/Model/CatSample/ItemWithParticlesCatalog.cpp b/GUI/Model/CatSample/ItemWithParticlesCatalog.cpp
index 00cbcee9928..4fa4cd62275 100644
--- a/GUI/Model/CatSample/ItemWithParticlesCatalog.cpp
+++ b/GUI/Model/CatSample/ItemWithParticlesCatalog.cpp
@@ -12,6 +12,7 @@
 //
 //  ************************************************************************************************
 
+#include "Base/Util/Assert.h"
 #include "GUI/Model/CatSample/ItemWithParticlesCatalog.h"
 #include "GUI/Model/Sample/CompoundItem.h"
 #include "GUI/Model/Sample/CoreAndShellItem.h"
diff --git a/GUI/Model/Descriptor/DistributionItems.cpp b/GUI/Model/Descriptor/DistributionItems.cpp
index a68c8863c7a..d2e3a572bf0 100644
--- a/GUI/Model/Descriptor/DistributionItems.cpp
+++ b/GUI/Model/Descriptor/DistributionItems.cpp
@@ -13,7 +13,6 @@
 //  ************************************************************************************************
 
 #include "GUI/Model/Descriptor/DistributionItems.h"
-#include "GUI/Support/XML/Streamer.h"
 #include "GUI/Support/XML/UtilXML.h"
 #include "Param/Distrib/Distributions.h"
 #include "Param/Distrib/RangedDistributions.h"
diff --git a/GUI/Model/Descriptor/SelectionProperty.h b/GUI/Model/Descriptor/SelectionProperty.h
index b9402804377..21f5d5f7cd1 100644
--- a/GUI/Model/Descriptor/SelectionProperty.h
+++ b/GUI/Model/Descriptor/SelectionProperty.h
@@ -15,7 +15,6 @@
 #ifndef BORNAGAIN_GUI_MODEL_DESCRIPTOR_SELECTIONPROPERTY_H
 #define BORNAGAIN_GUI_MODEL_DESCRIPTOR_SELECTIONPROPERTY_H
 
-#include "GUI/Support/XML/Streamer.h"
 #include "GUI/Support/XML/UtilXML.h"
 
 //! Abstract base class for SelectionProperty to ease referencing.
diff --git a/GUI/Model/Device/BeamItems.cpp b/GUI/Model/Device/BeamItems.cpp
index 8e4e5a0b5fb..f06de293e57 100644
--- a/GUI/Model/Device/BeamItems.cpp
+++ b/GUI/Model/Device/BeamItems.cpp
@@ -12,11 +12,12 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/Model/Device/BeamItems.h"
 #include "Base/Axis/IAxis.h"
 #include "Base/Const/Units.h"
+#include "Base/Util/Assert.h"
 #include "Device/Beam/Beam.h"
 #include "GUI/Model/Device/BeamAngleItems.h"
+#include "GUI/Model/Device/BeamItems.h"
 #include "GUI/Model/Device/BeamWavelengthItem.h"
 #include "GUI/Model/Device/FootprintItems.h"
 #include "GUI/Model/Device/PointwiseAxisItem.h"
diff --git a/GUI/Model/Device/ResolutionFunctionItems.cpp b/GUI/Model/Device/ResolutionFunctionItems.cpp
index 772f22e6b62..f4b44ea284b 100644
--- a/GUI/Model/Device/ResolutionFunctionItems.cpp
+++ b/GUI/Model/Device/ResolutionFunctionItems.cpp
@@ -14,7 +14,6 @@
 
 #include "GUI/Model/Device/ResolutionFunctionItems.h"
 #include "Device/Resolution/ResolutionFunction2DGaussian.h"
-#include "GUI/Support/XML/Streamer.h"
 #include "GUI/Support/XML/UtilXML.h"
 
 namespace {
diff --git a/GUI/Model/Device/SpecularBeamInclinationItem.cpp b/GUI/Model/Device/SpecularBeamInclinationItem.cpp
index f7643a94613..cb2d83a0978 100644
--- a/GUI/Model/Device/SpecularBeamInclinationItem.cpp
+++ b/GUI/Model/Device/SpecularBeamInclinationItem.cpp
@@ -12,11 +12,12 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/Model/Device/SpecularBeamInclinationItem.h"
 #include "Base/Axis/IAxis.h"
 #include "Base/Const/Units.h"
+#include "Base/Util/Assert.h"
 #include "GUI/Model/CatDevice/DistributionItemCatalog.h"
 #include "GUI/Model/Device/PointwiseAxisItem.h"
+#include "GUI/Model/Device/SpecularBeamInclinationItem.h"
 #include "GUI/Support/XML/UtilXML.h"
 
 namespace {
diff --git a/GUI/Model/Job/JobItem.cpp b/GUI/Model/Job/JobItem.cpp
index ca13bb15aba..e1929f5f842 100644
--- a/GUI/Model/Job/JobItem.cpp
+++ b/GUI/Model/Job/JobItem.cpp
@@ -31,7 +31,6 @@
 #include "GUI/Model/Sample/MaterialModel.h"
 #include "GUI/Model/Sample/SampleItem.h"
 #include "GUI/Support/IO/ItemFileNameUtils.h"
-#include "GUI/Support/XML/Streamer.h"
 #include "GUI/Support/XML/UtilXML.h"
 #include "GUI/Util/DeserializationException.h"
 #include "GUI/Util/Error.h"
diff --git a/GUI/Model/Project/ProjectDocument.cpp b/GUI/Model/Project/ProjectDocument.cpp
index bfbe2f257bc..460431cfe1e 100644
--- a/GUI/Model/Project/ProjectDocument.cpp
+++ b/GUI/Model/Project/ProjectDocument.cpp
@@ -24,7 +24,6 @@
 #include "GUI/Model/Sample/SampleItem.h"
 #include "GUI/Support/Data/SimulationOptionsItem.h"
 #include "GUI/Support/IO/ProjectUtils.h"
-#include "GUI/Support/XML/Streamer.h"
 #include "GUI/Support/XML/UtilXML.h"
 #include "GUI/Util/DeserializationException.h"
 #include "GUI/Util/Error.h"
@@ -307,7 +306,7 @@ void ProjectDocument::writeProject(QIODevice* device)
     w.writeStartElement(Tag::BornAgain);
     QString version_string = GUI::Util::Path::getBornAgainVersionString();
     w.writeAttribute(XML::Attrib::BA_Version, version_string);
-    Streamer(&w).writeVersion(2);
+    XML::writeAttribute(&w, XML::Attrib::version, uint(2));
 
     w.writeStartElement(Tag::DocumentInfo);
     w.writeAttribute(XML::Attrib::projectName, projectName());
@@ -346,7 +345,8 @@ ProjectDocument::ReadResult ProjectDocument::readProject(QIODevice* device,
             r.readNext();
             if (r.isStartElement()) {
                 if (r.name() == Tag::BornAgain) {
-                    Streamer(&r).assertVersion(2);
+                    const uint version = XML::readUIntAttribute(&r, XML::Attrib::version);
+                    Q_UNUSED(version)
                     m_currentVersion = r.attributes().value(XML::Attrib::BA_Version).toString();
 
                     if (!GUI::Util::Path::isVersionMatchMinimal(m_currentVersion,
diff --git a/GUI/Model/Sample/CompoundItem.cpp b/GUI/Model/Sample/CompoundItem.cpp
index b7193aad324..d8cbffb84e0 100644
--- a/GUI/Model/Sample/CompoundItem.cpp
+++ b/GUI/Model/Sample/CompoundItem.cpp
@@ -12,6 +12,7 @@
 //
 //  ************************************************************************************************
 
+#include "Base/Util/Assert.h"
 #include "GUI/Model/Sample/CompoundItem.h"
 #include "GUI/Model/Sample/CoreAndShellItem.h"
 #include "GUI/Model/Sample/MesocrystalItem.h"
diff --git a/GUI/Model/Sample/FormFactorItems.h b/GUI/Model/Sample/FormFactorItems.h
index 57e2816ef3c..ac11e736917 100644
--- a/GUI/Model/Sample/FormFactorItems.h
+++ b/GUI/Model/Sample/FormFactorItems.h
@@ -16,7 +16,6 @@
 #define BORNAGAIN_GUI_MODEL_SAMPLE_FORMFACTORITEMS_H
 
 #include "GUI/Model/Descriptor/DoubleProperty.h"
-#include "GUI/Support/XML/Streamer.h"
 #include <QVector>
 #include <memory>
 
diff --git a/GUI/Model/Sample/LayerItem.cpp b/GUI/Model/Sample/LayerItem.cpp
index 9372230e543..864734715c9 100644
--- a/GUI/Model/Sample/LayerItem.cpp
+++ b/GUI/Model/Sample/LayerItem.cpp
@@ -12,9 +12,10 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/Model/Sample/LayerItem.h"
+#include "Base/Util/Assert.h"
 #include "GUI/Model/Sample/CompoundItem.h"
 #include "GUI/Model/Sample/CoreAndShellItem.h"
+#include "GUI/Model/Sample/LayerItem.h"
 #include "GUI/Model/Sample/MesocrystalItem.h"
 #include "GUI/Model/Sample/ParticleItem.h"
 #include "GUI/Model/Sample/ParticleLayoutItem.h"
@@ -23,7 +24,6 @@
 #include <QColor>
 
 namespace {
-
 namespace Tag {
 
 const QString Name("Name");
diff --git a/GUI/Model/Sample/MaterialItem.cpp b/GUI/Model/Sample/MaterialItem.cpp
index b2c59848799..ff2684fa095 100644
--- a/GUI/Model/Sample/MaterialItem.cpp
+++ b/GUI/Model/Sample/MaterialItem.cpp
@@ -14,7 +14,6 @@
 
 #include "GUI/Model/Sample/MaterialItem.h"
 #include "Base/Util/Assert.h"
-#include "GUI/Support/XML/Streamer.h"
 #include "GUI/Support/XML/UtilXML.h"
 #include "GUI/Util/DeserializationException.h"
 #include "Sample/Material/MaterialFactoryFuncs.h"
diff --git a/GUI/Model/Sample/ParticleLayoutItem.cpp b/GUI/Model/Sample/ParticleLayoutItem.cpp
index 617a2f4a2e7..358704c8578 100644
--- a/GUI/Model/Sample/ParticleLayoutItem.cpp
+++ b/GUI/Model/Sample/ParticleLayoutItem.cpp
@@ -12,12 +12,13 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/Model/Sample/ParticleLayoutItem.h"
+#include "Base/Util/Assert.h"
 #include "GUI/Model/Sample/CompoundItem.h"
 #include "GUI/Model/Sample/InterferenceItems.h"
 #include "GUI/Model/Sample/Lattice2DItems.h"
 #include "GUI/Model/Sample/MesocrystalItem.h"
 #include "GUI/Model/Sample/ParticleItem.h"
+#include "GUI/Model/Sample/ParticleLayoutItem.h"
 
 namespace {
 namespace Tag {
diff --git a/GUI/Model/Sample/SampleValidator.cpp b/GUI/Model/Sample/SampleValidator.cpp
index 8b585db54cc..acbe17e7f09 100644
--- a/GUI/Model/Sample/SampleValidator.cpp
+++ b/GUI/Model/Sample/SampleValidator.cpp
@@ -12,14 +12,14 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/Model/Sample/SampleValidator.h"
+#include "Base/Util/Assert.h"
 #include "GUI/Model/Sample/CompoundItem.h"
 #include "GUI/Model/Sample/CoreAndShellItem.h"
 #include "GUI/Model/Sample/InterferenceItems.h"
 #include "GUI/Model/Sample/LayerItem.h"
 #include "GUI/Model/Sample/ParticleLayoutItem.h"
 #include "GUI/Model/Sample/SampleItem.h"
-
+#include "GUI/Model/Sample/SampleValidator.h"
 
 void SampleValidator::validateItem(const ItemWithParticles* item)
 {
diff --git a/GUI/Model/ToCore/SampleToCore.cpp b/GUI/Model/ToCore/SampleToCore.cpp
index 9c0cd19f5d3..117b84728fb 100644
--- a/GUI/Model/ToCore/SampleToCore.cpp
+++ b/GUI/Model/ToCore/SampleToCore.cpp
@@ -12,7 +12,7 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/Model/ToCore/SampleToCore.h"
+#include "Base/Util/Assert.h"
 #include "GUI/Model/Sample/CompoundItem.h"
 #include "GUI/Model/Sample/CoreAndShellItem.h"
 #include "GUI/Model/Sample/InterferenceItems.h"
@@ -23,6 +23,7 @@
 #include "GUI/Model/Sample/ParticleLayoutItem.h"
 #include "GUI/Model/Sample/RoughnessItems.h"
 #include "GUI/Model/Sample/SampleItem.h"
+#include "GUI/Model/ToCore/SampleToCore.h"
 #include "GUI/Util/Error.h"
 #include "Sample/Aggregate/IInterference.h"
 #include "Sample/Aggregate/ParticleLayout.h"
diff --git a/GUI/Support/Data/SimulationOptionsItem.cpp b/GUI/Support/Data/SimulationOptionsItem.cpp
index f85676b9812..e54eea0b30f 100644
--- a/GUI/Support/Data/SimulationOptionsItem.cpp
+++ b/GUI/Support/Data/SimulationOptionsItem.cpp
@@ -153,7 +153,6 @@ void SimulationOptionsItem::writeTo(QXmlStreamWriter* w) const
 void SimulationOptionsItem::readFrom(QXmlStreamReader* r)
 {
     const uint version = XML::readUIntAttribute(r, XML::Attrib::version);
-
     Q_UNUSED(version)
 
     while (r->readNextStartElement()) {
diff --git a/GUI/Support/XML/Streamer.cpp b/GUI/Support/XML/Streamer.cpp
deleted file mode 100644
index ac33040f98e..00000000000
--- a/GUI/Support/XML/Streamer.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-//  ************************************************************************************************
-//
-//  BornAgain: simulate and fit reflection and scattering
-//
-//! @file      GUI/Support/XML/Streamer.cpp
-//! @brief     Implements class Streamer
-//!
-//! @homepage  http://www.bornagainproject.org
-//! @license   GNU General Public License v3 or higher (see COPYING)
-//! @copyright Forschungszentrum Jülich GmbH 2021
-//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
-//
-//  ************************************************************************************************
-
-#include "GUI/Support/XML/Streamer.h"
-#include "GUI/Support/XML/UtilXML.h"
-#include "GUI/Util/DeserializationException.h"
-
-void Streamer::writeVersion(unsigned version) const
-{
-    if (!m_w)
-        return;
-    m_w->writeAttribute(StreamerXML::Tags::Version, QString::number(version));
-}
-
-void Streamer::assertVersion(unsigned expectedVersion) const
-{
-    if (!m_r)
-        return;
-
-    const auto foundAsStr = m_r->attributes().value(StreamerXML::Tags::Version);
-    const unsigned found = foundAsStr.isEmpty() ? 0 : foundAsStr.toUInt();
-    if (found < expectedVersion)
-        throw DeserializationException::tooOld();
-    if (found > expectedVersion)
-        throw DeserializationException::tooNew();
-}
-
-void Streamer::gotoEndElementOfTag(const QString& tag)
-{
-    if (m_r->name() != tag) {
-        if (!m_r->isEndElement())
-            m_r->skipCurrentElement();
-        m_r->skipCurrentElement();
-    }
-    assertCurrentTag(tag);
-    if (!m_r->isEndElement())
-        m_r->skipCurrentElement();
-
-    assertCurrentToken(QXmlStreamReader::EndElement);
-    assertCurrentTag(tag);
-}
-
-void Streamer::gotoStartElementOfTag(const QString& tag)
-{
-    ASSERT(m_r);
-    while (m_r->name() != tag && !m_r->hasError())
-        m_r->readNextStartElement();
-    assertCurrentToken(QXmlStreamReader::StartElement);
-}
-
-void Streamer::assertCurrentTag(const QString& expectedTag) const
-{
-    ASSERT(m_r);
-
-    if (m_r->name() != expectedTag) {
-#ifdef _DEBUG
-        // to simplify debugging: what is the current tag
-        QString foundTag = m_r->name().toString();
-        Q_UNUSED(foundTag);
-#endif
-        throw DeserializationException::streamError();
-    }
-}
-
-void Streamer::assertCurrentToken(QXmlStreamReader::TokenType token) const
-{
-    if (m_r->tokenType() != token)
-        throw DeserializationException::streamError();
-}
-
-void Streamer::start(const QString& tag)
-{
-    if (m_w)
-        m_w->writeStartElement(tag);
-    else
-        gotoStartElementOfTag(tag);
-}
-
-void Streamer::finish(const QString& tag)
-{
-    if (m_w)
-        m_w->writeEndElement();
-    else
-        gotoEndElementOfTag(tag);
-}
diff --git a/GUI/Support/XML/Streamer.h b/GUI/Support/XML/Streamer.h
deleted file mode 100644
index ec1ea12b4ba..00000000000
--- a/GUI/Support/XML/Streamer.h
+++ /dev/null
@@ -1,105 +0,0 @@
-//  ************************************************************************************************
-//
-//  BornAgain: simulate and fit reflection and scattering
-//
-//! @file      GUI/Support/XML/Streamer.h
-//! @brief     Defines class Streamer
-//!
-//! @homepage  http://www.bornagainproject.org
-//! @license   GNU General Public License v3 or higher (see COPYING)
-//! @copyright Forschungszentrum Jülich GmbH 2021
-//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
-//
-//  ************************************************************************************************
-
-#ifndef BORNAGAIN_GUI_SUPPORT_XML_STREAMER_H
-#define BORNAGAIN_GUI_SUPPORT_XML_STREAMER_H
-
-#include "Base/Util/Assert.h"
-#include <QXmlStreamWriter> // used in every including file
-#include <functional>
-#include <heinz/Vectors3D.h>
-
-namespace StreamerXML {
-namespace Tags {
-constexpr auto Id("id");
-constexpr auto Value("value");
-constexpr auto Decimals("decimals");
-constexpr auto Version("version");
-} // namespace Tags
-} // namespace StreamerXML
-
-//! Supports serialization to or deserialization from QXmlStream.
-//!
-//! Can be either a writer or a reader, depending on the constructor.
-
-class Streamer {
-public:
-    Streamer(QXmlStreamWriter* w)
-        : m_w(w)
-    {
-    }
-    Streamer(QXmlStreamReader* r)
-        : m_r(r)
-    {
-    }
-
-    QXmlStreamWriter* xmlWriter() { return m_w; } //!< Returns stream writer or nullptr.
-    QXmlStreamReader* xmlReader() { return m_r; } //!< Returns stream reader or nullptr.
-
-    //! As writer, serializes the given version number. As reader, does nothing.
-    void writeVersion(unsigned version) const;
-
-    //! As reader, throws DeserializationException unless the expected version is read.
-    //! As writer, does nothing.
-    void assertVersion(unsigned expectedVersion) const;
-
-    template <typename Catalog>
-    void write(const QString& tag, typename Catalog::CatalogedType* p);
-
-    template <typename Catalog, typename... Args>
-    void read(const QString& tag, typename Catalog::CatalogedType*& p, Args... argsForConstructor);
-
-    void gotoStartElementOfTag(const QString& tag);
-    void gotoEndElementOfTag(const QString& tag);
-    void assertCurrentTag(const QString& expectedTag) const;
-
-    void start(const QString& tag);
-    void finish(const QString& tag);
-
-private:
-    void assertCurrentToken(QXmlStreamReader::TokenType token) const;
-
-    QXmlStreamWriter* m_w = nullptr;
-    QXmlStreamReader* m_r = nullptr;
-};
-
-//  ************************************************************************************************
-//  Templates implementation
-//  ************************************************************************************************
-
-template <typename Catalog>
-void Streamer::write(const QString& tag, typename Catalog::CatalogedType* p)
-{
-    ASSERT(m_w);
-    m_w->writeStartElement(tag);
-    m_w->writeAttribute("type", QString::number(static_cast<uint8_t>(Catalog::type(p))));
-    if (p != nullptr)
-        p->serialize(*this);
-    m_w->writeEndElement();
-}
-
-template <typename Catalog, typename... Args>
-void Streamer::read(const QString& tag, typename Catalog::CatalogedType*& p,
-                    Args... argsForConstructor)
-{
-    ASSERT(m_r);
-    gotoStartElementOfTag(tag);
-    const auto type = static_cast<typename Catalog::Type>(m_r->attributes().value("type").toUInt());
-    p = Catalog::create(type, argsForConstructor...);
-    if (p != nullptr)
-        p->serialize(*this);
-    gotoEndElementOfTag(tag);
-}
-
-#endif // BORNAGAIN_GUI_SUPPORT_XML_STREAMER_H
diff --git a/GUI/View/Instrument/DistributionEditor.cpp b/GUI/View/Instrument/DistributionEditor.cpp
index c9e866bb995..9b5973cd6a6 100644
--- a/GUI/View/Instrument/DistributionEditor.cpp
+++ b/GUI/View/Instrument/DistributionEditor.cpp
@@ -17,7 +17,6 @@
 #include "GUI/Model/Descriptor/DistributionItems.h"
 #include "GUI/Model/Device/BeamDistributionItem.h"
 #include "GUI/Support/XML/Backup.h"
-#include "GUI/Support/XML/Streamer.h"
 #include "GUI/View/Common/DoubleSpinBox.h"
 #include "GUI/View/Common/SafeSpinBox.h"
 #include "GUI/View/Common/ScientificSpinBox.h"
diff --git a/GUI/View/Instrument/GISASBeamEditor.cpp b/GUI/View/Instrument/GISASBeamEditor.cpp
index 2cb6c38f628..1c7f3449f54 100644
--- a/GUI/View/Instrument/GISASBeamEditor.cpp
+++ b/GUI/View/Instrument/GISASBeamEditor.cpp
@@ -12,12 +12,13 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/View/Instrument/GISASBeamEditor.h"
+#include "Base/Util/Assert.h"
 #include "GUI/Model/Device/BeamAngleItems.h"
 #include "GUI/Model/Device/BeamItems.h"
 #include "GUI/Model/Device/BeamWavelengthItem.h"
 #include "GUI/View/Common/FixupDoubleValidator.h"
 #include "GUI/View/Instrument/DistributionEditor.h"
+#include "GUI/View/Instrument/GISASBeamEditor.h"
 #include "GUI/View/Tool/GroupBoxCollapser.h"
 #include <QDoubleValidator>
 #include <QFormLayout>
diff --git a/GUI/View/Instrument/InclinationAnglesEditor.cpp b/GUI/View/Instrument/InclinationAnglesEditor.cpp
index 972d464298b..daa0fc1ae7c 100644
--- a/GUI/View/Instrument/InclinationAnglesEditor.cpp
+++ b/GUI/View/Instrument/InclinationAnglesEditor.cpp
@@ -12,11 +12,12 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/View/Instrument/InclinationAnglesEditor.h"
+#include "Base/Util/Assert.h"
 #include "GUI/Model/Device/PointwiseAxisItem.h"
 #include "GUI/Model/Device/SpecularBeamInclinationItem.h"
 #include "GUI/View/Instrument/DistributionEditor.h"
 #include "GUI/View/Instrument/DistributionPlot.h"
+#include "GUI/View/Instrument/InclinationAnglesEditor.h"
 #include "GUI/View/Instrument/SphericalAxisEditor.h"
 #include "GUI/View/Tool/GroupBoxCollapser.h"
 #include <QComboBox>
diff --git a/GUI/View/Instrument/SpecularBeamEditor.cpp b/GUI/View/Instrument/SpecularBeamEditor.cpp
index 7d8c986b775..4d5cc5e6c83 100644
--- a/GUI/View/Instrument/SpecularBeamEditor.cpp
+++ b/GUI/View/Instrument/SpecularBeamEditor.cpp
@@ -12,7 +12,7 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/View/Instrument/SpecularBeamEditor.h"
+#include "Base/Util/Assert.h"
 #include "GUI/Model/Device/BeamItems.h"
 #include "GUI/Model/Device/BeamWavelengthItem.h"
 #include "GUI/View/Common/FixupDoubleValidator.h"
@@ -20,6 +20,7 @@
 #include "GUI/View/Instrument/FootprintCorrectionEditor.h"
 #include "GUI/View/Instrument/InclinationAnglesEditor.h"
 #include "GUI/View/Instrument/InstrumentEditController.h"
+#include "GUI/View/Instrument/SpecularBeamEditor.h"
 #include "GUI/View/Tool/GroupBoxCollapser.h"
 #include <QDoubleValidator>
 #include <QFormLayout>
diff --git a/GUI/View/SampleDesigner/CoreAndShellForm.cpp b/GUI/View/SampleDesigner/CoreAndShellForm.cpp
index c61fce2d4db..bc83475b485 100644
--- a/GUI/View/SampleDesigner/CoreAndShellForm.cpp
+++ b/GUI/View/SampleDesigner/CoreAndShellForm.cpp
@@ -12,12 +12,13 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/View/SampleDesigner/CoreAndShellForm.h"
+#include "Base/Util/Assert.h"
 #include "GUI/Model/CatSample/FormFactorItemCatalog.h"
 #include "GUI/Model/Sample/CoreAndShellItem.h"
 #include "GUI/Model/Sample/FormFactorItems.h"
 #include "GUI/Model/Sample/ParticleItem.h"
 #include "GUI/Util/ActionFactory.h"
+#include "GUI/View/SampleDesigner/CoreAndShellForm.h"
 #include "GUI/View/SampleDesigner/FormLayouter.h"
 #include "GUI/View/SampleDesigner/MaterialInplaceForm.h"
 #include "GUI/View/SampleDesigner/SampleEditorController.h"
diff --git a/GUI/View/SampleDesigner/LatticeTypeSelectionForm.cpp b/GUI/View/SampleDesigner/LatticeTypeSelectionForm.cpp
index 9f877bbedc2..9a07a04e088 100644
--- a/GUI/View/SampleDesigner/LatticeTypeSelectionForm.cpp
+++ b/GUI/View/SampleDesigner/LatticeTypeSelectionForm.cpp
@@ -12,9 +12,10 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/View/SampleDesigner/LatticeTypeSelectionForm.h"
+#include "Base/Util/Assert.h"
 #include "GUI/Model/Sample/InterferenceItems.h"
 #include "GUI/Model/Sample/Lattice2DItems.h"
+#include "GUI/View/SampleDesigner/LatticeTypeSelectionForm.h"
 #include <QCheckBox>
 #include <QLabel>
 
diff --git a/GUI/View/SampleDesigner/LayerEditorUtils.cpp b/GUI/View/SampleDesigner/LayerEditorUtils.cpp
index d199c2af404..ddf1004cb45 100644
--- a/GUI/View/SampleDesigner/LayerEditorUtils.cpp
+++ b/GUI/View/SampleDesigner/LayerEditorUtils.cpp
@@ -12,7 +12,7 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/View/SampleDesigner/LayerEditorUtils.h"
+#include "Base/Util/Assert.h"
 #include "GUI/Model/Sample/CompoundItem.h"
 #include "GUI/Model/Sample/CoreAndShellItem.h"
 #include "GUI/Model/Sample/FormFactorItems.h"
@@ -24,9 +24,9 @@
 #include "GUI/View/SampleDesigner/CompoundForm.h"
 #include "GUI/View/SampleDesigner/CoreAndShellForm.h"
 #include "GUI/View/SampleDesigner/FormLayouter.h"
+#include "GUI/View/SampleDesigner/LayerEditorUtils.h"
 #include "GUI/View/SampleDesigner/MesocrystalForm.h"
 #include "GUI/View/SampleDesigner/ParticleForm.h"
-
 #include <QLabel>
 #include <QMenu>
 #include <QPushButton>
diff --git a/GUI/View/SampleDesigner/MesocrystalForm.cpp b/GUI/View/SampleDesigner/MesocrystalForm.cpp
index 8a13ad160f6..b52a0653b9c 100644
--- a/GUI/View/SampleDesigner/MesocrystalForm.cpp
+++ b/GUI/View/SampleDesigner/MesocrystalForm.cpp
@@ -12,14 +12,14 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/View/SampleDesigner/MesocrystalForm.h"
+#include "Base/Util/Assert.h"
 #include "GUI/Model/Sample/FormFactorItems.h"
 #include "GUI/Model/Sample/MesocrystalItem.h"
 #include "GUI/Model/Sample/ParticleItem.h"
 #include "GUI/Util/ActionFactory.h"
 #include "GUI/View/SampleDesigner/FormLayouter.h"
+#include "GUI/View/SampleDesigner/MesocrystalForm.h"
 #include "GUI/View/Tool/GroupBoxCollapser.h"
-
 #include <QAction>
 
 MesocrystalForm::MesocrystalForm(QWidget* parent, MesocrystalItem* item, SampleEditorController* ec,
diff --git a/GUI/View/SampleDesigner/ParticleLayoutForm.cpp b/GUI/View/SampleDesigner/ParticleLayoutForm.cpp
index 70962d51580..fc00e0324a6 100644
--- a/GUI/View/SampleDesigner/ParticleLayoutForm.cpp
+++ b/GUI/View/SampleDesigner/ParticleLayoutForm.cpp
@@ -12,7 +12,7 @@
 //
 //  ************************************************************************************************
 
-#include "GUI/View/SampleDesigner/ParticleLayoutForm.h"
+#include "Base/Util/Assert.h"
 #include "GUI/Model/Sample/InterferenceItems.h"
 #include "GUI/Model/Sample/ItemWithParticles.h"
 #include "GUI/Model/Sample/LayerItem.h"
@@ -22,9 +22,9 @@
 #include "GUI/View/SampleDesigner/InterferenceForm.h"
 #include "GUI/View/SampleDesigner/LayerEditorUtils.h"
 #include "GUI/View/SampleDesigner/LayerForm.h"
+#include "GUI/View/SampleDesigner/ParticleLayoutForm.h"
 #include "GUI/View/SampleDesigner/SampleEditorController.h"
 #include "GUI/View/Tool/GroupBoxCollapser.h"
-
 #include <QAction>
 #include <QPushButton>
 
diff --git a/Tests/Unit/GUI/TestSessionXML.cpp b/Tests/Unit/GUI/TestSessionXML.cpp
index 8e7ba89426d..1e7927a2848 100644
--- a/Tests/Unit/GUI/TestSessionXML.cpp
+++ b/Tests/Unit/GUI/TestSessionXML.cpp
@@ -11,7 +11,6 @@
 #include "GUI/Model/Sample/ParticleLayoutItem.h"
 #include "GUI/Model/Sample/SampleItem.h"
 #include "GUI/Support/XML/Backup.h"
-#include "GUI/Support/XML/Streamer.h"
 #include "Tests/GTestWrapper/google_test.h"
 #include <QXmlStreamReader>
 #include <QXmlStreamWriter>
@@ -236,4 +235,4 @@ TEST(TestSessionXML, Alignment)
     r.setDetectorAlignment(RectangularDetector::GENERIC);
     deserialize(r, a1);
     EXPECT_EQ(r.detectorAlignment(), RectangularDetector::PERPENDICULAR_TO_REFLECTED_BEAM_DPOS);
-}
\ No newline at end of file
+}
-- 
GitLab