From bb80e68f8440d2e5e61efca50a5c88a35fa3f93f Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 23 May 2016 17:16:25 +0300 Subject: [PATCH] Issue #1494: Filter already existing features from features list --- .../ParametersPlugin_WidgetParamsMgr.cpp | 12 ++++++------ .../ParametersPlugin_WidgetParamsMgr.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp index 26f185358..a340cdb3e 100644 --- a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp +++ b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.cpp @@ -297,7 +297,8 @@ void ParametersPlugin_WidgetParamsMgr::updateParametersFeatures() void ParametersPlugin_WidgetParamsMgr::updateFeaturesPart() { - updateItem(myFeatures, featuresItems(myParametersList)); + QList aFeatureList; + updateItem(myFeatures, featuresItems(myParametersList, aFeatureList)); } void ParametersPlugin_WidgetParamsMgr::updateParametersPart() @@ -309,11 +310,10 @@ void ParametersPlugin_WidgetParamsMgr::updateParametersPart() QList ParametersPlugin_WidgetParamsMgr:: - featuresItems(const QList& theFeatures) const + featuresItems(const QList& theFeatures, QList& theFeatureList) const { QList aItemsList; ResultParameterPtr aParam; - QList aFeatures; foreach(FeaturePtr aParameter, theFeatures) { aParam = std::dynamic_pointer_cast(aParameter->firstResult()); const std::set>& aRefs = aParam->data()->refsToMe(); @@ -326,10 +326,10 @@ QList ParametersPlugin_WidgetParamsMgr:: // Find referenced feature Recursive QList aList; aList.append(aReferenced); - QList aItems = featuresItems(aList); + QList aItems = featuresItems(aList, theFeatureList); aItemsList.append(aItems); } else { - if (!aFeatures.contains(aReferenced)) { + if (!theFeatureList.contains(aReferenced)) { QStringList aValNames; aValNames << aReferenced->data()->name().c_str(); @@ -345,7 +345,7 @@ QList ParametersPlugin_WidgetParamsMgr:: } } aItemsList.append(aValNames); - aFeatures.append(aReferenced); + theFeatureList.append(aReferenced); } } } diff --git a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.h b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.h index 4fe132ed7..8e32c3767 100644 --- a/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.h +++ b/src/ParametersPlugin/ParametersPlugin_WidgetParamsMgr.h @@ -127,7 +127,7 @@ private: bool checkIsValid(); - QList featuresItems(const QList& theFeatures) const; + QList featuresItems(const QList& theFeatures, QList& theFeatureList) const; QList parametersItems(const QList& theFeatures) const; void updateParametersFeatures(); -- 2.39.2