From 2bdf4440c6079f4637edf1b9816cd08390ab9ce3 Mon Sep 17 00:00:00 2001 From: sbh Date: Tue, 2 Sep 2014 18:21:02 +0400 Subject: [PATCH] Treat "Model_FeatureValidator" as default validator (no need to declare it in an XML) --- src/Model/Model_Validator.cpp | 10 ++++++++++ src/Model/Model_Validator.h | 1 + src/SketchPlugin/plugin-Sketch.xml | 1 - 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Model/Model_Validator.cpp b/src/Model/Model_Validator.cpp index 90a281c86..eaab5d3c3 100644 --- a/src/Model/Model_Validator.cpp +++ b/src/Model/Model_Validator.cpp @@ -64,6 +64,7 @@ void Model_ValidatorsFactory::validators(const std::string& theFeatureID, } } } + addDefaultValidators(theResult); } void Model_ValidatorsFactory::validators(const std::string& theFeatureID, @@ -108,3 +109,12 @@ const ModelAPI_Validator* Model_ValidatorsFactory::validator(const std::string& } return NULL; } + +void Model_ValidatorsFactory::addDefaultValidators(std::list& theValidators) const +{ + std::string anId = "Model_FeatureValidator"; + std::map::const_iterator it = myIDs.find(anId); + if(it == myIDs.end()) + return; + theValidators.push_back(it->second); +} diff --git a/src/Model/Model_Validator.h b/src/Model/Model_Validator.h index 0be3d21c8..56d65d181 100644 --- a/src/Model/Model_Validator.h +++ b/src/Model/Model_Validator.h @@ -65,6 +65,7 @@ class Model_ValidatorsFactory : public ModelAPI_ValidatorsFactory // const boost::shared_ptr& theFeature, const std::string& theAttrID) const; protected: + void addDefaultValidators(std::list& theValidators) const; /// Get instance from PluginManager Model_ValidatorsFactory(); diff --git a/src/SketchPlugin/plugin-Sketch.xml b/src/SketchPlugin/plugin-Sketch.xml index b343b57ca..804f1bb32 100644 --- a/src/SketchPlugin/plugin-Sketch.xml +++ b/src/SketchPlugin/plugin-Sketch.xml @@ -11,7 +11,6 @@ - -- 2.39.2