From d1bce1a3b5cc2389a09dff96cd8fa58b30d9875a Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Mon, 22 Nov 2021 22:13:13 +0100
Subject: [PATCH] rename namespace

---
 GUI/Model/From/GUIExamplesFactory.cpp      | 12 ++++++------
 GUI/Model/From/GUIExamplesFactory.h        |  6 +++---
 GUI/Model/From/SampleListModel.cpp         |  2 +-
 GUI/View/SampleDesigner/SampleListView.cpp |  4 ++--
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/GUI/Model/From/GUIExamplesFactory.cpp b/GUI/Model/From/GUIExamplesFactory.cpp
index 6e264ee8e10..ad188135831 100644
--- a/GUI/Model/From/GUIExamplesFactory.cpp
+++ b/GUI/Model/From/GUIExamplesFactory.cpp
@@ -2,8 +2,8 @@
 //
 //  BornAgain: simulate and fit reflection and scattering
 //
-//! @file      GUI/Model/From/GUIExamplesFactory.cpp
-//! @brief     Implements class GUIExamplesFactory
+//! @file      GUI/Model/From/GUI::ExamplesFactory.cpp
+//! @brief     Implements class GUI::ExamplesFactory
 //!
 //! @homepage  http://www.bornagainproject.org
 //! @license   GNU General Public License v3 or higher (see COPYING)
@@ -63,13 +63,13 @@ const QMap<QString, std::tuple<QString, QString, std::function<MultiLayer*()>>>
 } // namespace
 
 
-bool GUIExamplesFactory::isValidExampleName(const QString& name)
+bool GUI::ExamplesFactory::isValidExampleName(const QString& name)
 {
     return builders.find(name) != builders.end();
 }
 
 //! Populate sample model with
-SessionItem* GUIExamplesFactory::createSampleItems(const QString& name, SampleModel* sampleModel,
+SessionItem* GUI::ExamplesFactory::createSampleItems(const QString& name, SampleModel* sampleModel,
                                                    MaterialModel* materialModel)
 {
     ASSERT(isValidExampleName(name));
@@ -78,12 +78,12 @@ SessionItem* GUIExamplesFactory::createSampleItems(const QString& name, SampleMo
     return GUIDomainSampleVisitor().populateSampleModel(sampleModel, materialModel, *sample, name);
 }
 
-QStringList GUIExamplesFactory::exampleNames()
+QStringList GUI::ExamplesFactory::exampleNames()
 {
     return builders.keys();
 }
 
-std::tuple<QString, QString> GUIExamplesFactory::exampleInfo(const QString& name)
+std::tuple<QString, QString> GUI::ExamplesFactory::exampleInfo(const QString& name)
 {
     ASSERT(isValidExampleName(name));
     auto [title, description, builder] = builders[name];
diff --git a/GUI/Model/From/GUIExamplesFactory.h b/GUI/Model/From/GUIExamplesFactory.h
index 1f668e3f817..1ab0aee9452 100644
--- a/GUI/Model/From/GUIExamplesFactory.h
+++ b/GUI/Model/From/GUIExamplesFactory.h
@@ -3,7 +3,7 @@
 //  BornAgain: simulate and fit reflection and scattering
 //
 //! @file      GUI/Model/From/GUIExamplesFactory.h
-//! @brief     Defines class GUIExamplesFactory
+//! @brief     Defines class GUI::ExamplesFactory
 //!
 //! @homepage  http://www.bornagainproject.org
 //! @license   GNU General Public License v3 or higher (see COPYING)
@@ -22,7 +22,7 @@ class SampleModel;
 class MaterialModel;
 
 //! Class that generates GUI model from
-namespace GUIExamplesFactory {
+namespace GUI::ExamplesFactory {
 
     bool isValidExampleName(const QString& name);
 
@@ -35,6 +35,6 @@ namespace GUIExamplesFactory {
     //! Returns human readable name and description
     std::tuple<QString, QString> exampleInfo(const QString& name);
 
-} // namespace GUIExamplesFactory
+} // namespace GUI::ExamplesFactory
 
 #endif // BORNAGAIN_GUI_MODEL_FROM_GUIEXAMPLESFACTORY_H
diff --git a/GUI/Model/From/SampleListModel.cpp b/GUI/Model/From/SampleListModel.cpp
index dfeee448da1..31898bd8e16 100644
--- a/GUI/Model/From/SampleListModel.cpp
+++ b/GUI/Model/From/SampleListModel.cpp
@@ -146,7 +146,7 @@ QModelIndex SampleListModel::createSampleFromExamples(const QString& className,
     beginInsertRows(QModelIndex(), row, row);
 
     auto* sample = dynamic_cast<MultiLayerItem*>(
-        GUIExamplesFactory::createSampleItems(className, m_sampleModel, materialModel));
+        GUI::ExamplesFactory::createSampleItems(className, m_sampleModel, materialModel));
     sample->setItemName(title);
     sample->setDescription(description);
 
diff --git a/GUI/View/SampleDesigner/SampleListView.cpp b/GUI/View/SampleDesigner/SampleListView.cpp
index 8ba24b1dd91..1b322e94145 100644
--- a/GUI/View/SampleDesigner/SampleListView.cpp
+++ b/GUI/View/SampleDesigner/SampleListView.cpp
@@ -96,9 +96,9 @@ SampleListView::SampleListView(QWidget* parent, SampleModel* sampleModel) : QLis
     auto* menu = new QMenu(this);
     m_chooseFromLibraryAction->setMenu(menu);
 
-    for (const auto& exampleName : GUIExamplesFactory::exampleNames()) {
+    for (const auto& exampleName : GUI::ExamplesFactory::exampleNames()) {
         QString title, description;
-        std::tie(title, description) = GUIExamplesFactory::exampleInfo(exampleName);
+        std::tie(title, description) = GUI::ExamplesFactory::exampleInfo(exampleName);
         auto icon = QIcon(":/SampleDesignerToolbox/images/sample_layers2.png");
         auto* action = menu->addAction(icon, title);
         action->setToolTip(description);
-- 
GitLab