X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Recover.cpp;h=9082ea1684e52a6cc5d77e15f4de911fba3f2fa9;hb=c6071088b2f55168f5706ce97802095af868b5e3;hp=4cf0a75c315110abc23766fd59bbf105b8a81f61;hpb=31e2cf2bc019fab204d82cb916e1358730c6cb63;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Recover.cpp b/src/FeaturesPlugin/FeaturesPlugin_Recover.cpp index 4cf0a75c3..9082ea168 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Recover.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Recover.cpp @@ -34,6 +34,7 @@ #include FeaturesPlugin_Recover::FeaturesPlugin_Recover() + : myClearListOnTypeChange(true) { } @@ -43,6 +44,13 @@ void FeaturesPlugin_Recover::initAttributes() data()->addAttribute(RECOVERED_ENTITIES(), ModelAPI_AttributeRefList::typeId()); data()->addAttribute(METHOD(), ModelAPI_AttributeString::typeId()); + if (!string(METHOD())->isInitialized()) { + myClearListOnTypeChange = false; + data()->blockSendAttributeUpdated(true, false); + string(METHOD())->setValue(METHOD_DEFAULT()); + data()->blockSendAttributeUpdated(false, false); + myClearListOnTypeChange = true; + } ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), METHOD()); // set default method for recovering string(METHOD())->setValue(METHOD_DEFAULT()); @@ -89,6 +97,6 @@ void FeaturesPlugin_Recover::execute() void FeaturesPlugin_Recover::attributeChanged(const std::string& theID) { - if (theID == METHOD()) + if (theID == METHOD() && myClearListOnTypeChange) reflist(RECOVERED_ENTITIES())->clear(); }