Skip to content
Snippets Groups Projects
Commit b478fcca authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

member variable -> static local

parent eb108c74
No related branches found
No related tags found
2 merge requests!327rename files and classes -> "Toolbar", "Toolbox",!326make DesignerScene code more compact
...@@ -32,28 +32,31 @@ ...@@ -32,28 +32,31 @@
#include "GUI/Views/SampleDesigner/ParticleView.h" #include "GUI/Views/SampleDesigner/ParticleView.h"
#include "GUI/Views/SampleDesigner/TransformationView.h" #include "GUI/Views/SampleDesigner/TransformationView.h"
QStringList SampleViewFactory::m_valid_item_types = {MultiLayerItem::M_TYPE, namespace {
LayerItem::M_TYPE,
ParticleLayoutItem::M_TYPE, QStringList valid_item_types = {MultiLayerItem::M_TYPE,
ParticleItem::M_TYPE, LayerItem::M_TYPE,
TransformationItem::M_TYPE, ParticleLayoutItem::M_TYPE,
ParticleCoreShellItem::M_TYPE, ParticleItem::M_TYPE,
ParticleCompositionItem::M_TYPE, TransformationItem::M_TYPE,
MesoCrystalItem::M_TYPE, ParticleCoreShellItem::M_TYPE,
Interference1DLatticeItem::M_TYPE, ParticleCompositionItem::M_TYPE,
Interference2DLatticeItem::M_TYPE, MesoCrystalItem::M_TYPE,
Interference2DParaCrystalItem::M_TYPE, Interference1DLatticeItem::M_TYPE,
InterferenceFinite2DLatticeItem::M_TYPE, Interference2DLatticeItem::M_TYPE,
InterferenceHardDiskItem::M_TYPE, Interference2DParaCrystalItem::M_TYPE,
InterferenceRadialParaCrystalItem::M_TYPE}; InterferenceFinite2DLatticeItem::M_TYPE,
InterferenceHardDiskItem::M_TYPE,
InterferenceRadialParaCrystalItem::M_TYPE};
} // namespace
bool SampleViewFactory::isValidType(const QString& model_type) bool SampleViewFactory::isValidType(const QString& model_type)
{ {
if (model_type.startsWith("FormFactor")) { if (model_type.startsWith("FormFactor")) {
return true; return true;
} else {
return m_valid_item_types.contains(model_type);
} }
return valid_item_types.contains(model_type);
} }
IView* SampleViewFactory::createSampleView(const QString& model_type) IView* SampleViewFactory::createSampleView(const QString& model_type)
......
...@@ -23,9 +23,6 @@ class SampleViewFactory { ...@@ -23,9 +23,6 @@ class SampleViewFactory {
public: public:
static bool isValidType(const QString& model_type); static bool isValidType(const QString& model_type);
static IView* createSampleView(const QString& model_type); static IView* createSampleView(const QString& model_type);
private:
static QStringList m_valid_item_types;
}; };
#endif // BORNAGAIN_GUI_VIEWS_SAMPLEDESIGNER_SAMPLEVIEWFACTORY_H #endif // BORNAGAIN_GUI_VIEWS_SAMPLEDESIGNER_SAMPLEVIEWFACTORY_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment