From 196f7067f7d3b9401a7f42505541fe986fc2b513 Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 10 Jun 2019 12:49:34 +0300 Subject: [PATCH] Remove already installed filters from combo box for choice --- src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp b/src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp index 44079aea4..4146656b0 100644 --- a/src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSelectionFilter.cpp @@ -576,13 +576,17 @@ bool ModuleBase_WidgetSelectionFilter::storeValueCustom() bool ModuleBase_WidgetSelectionFilter::restoreValueCustom() { + ModelAPI_FiltersFactory* aFactory = ModelAPI_Session::get()->filters(); FiltersFeaturePtr aFiltersFeature = std::dynamic_pointer_cast(myFeature); std::list aFilters = aFiltersFeature->filters(); std::list::const_iterator aIt; for (aIt = aFilters.cbegin(); aIt != aFilters.cend(); aIt++) { std::string aStr = (*aIt); onAddFilter(aStr); - myFiltersCombo->removeItem(myFiltersCombo->findText(aStr.c_str())); + FilterPtr aFilterObj = aFactory->filter(aStr); + int aId = myFiltersCombo->findText(aFilterObj->name().c_str()); + if (aId != -1) + myFiltersCombo->removeItem(aId); } // Init filters member of the parent attribute AttributeSelectionListPtr aAttrList = mySelectorFeature->selectionList(mySelectorAttribute); -- 2.39.2