Salome HOME
Merge branch 'mbs/32757' of https://codev-tuleap.cea.fr/plugins/git/salome/shaper...
[modules/shaper.git] / src / ModelAPI / ModelAPI_Feature.cpp
index 7e408e3a3bb9cdc39a012015c0af02b5e9c99e25..4b0939fab5e3220691f8928583537a9f76fd6d41 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2021  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -74,17 +74,12 @@ void ModelAPI_Feature::setResult(const std::shared_ptr<ModelAPI_Result>& theResu
   if (!isDisabled()) // disabled feature may be executed when it is added as not enabled (#2078)
     theResult->setDisabled(theResult, false);
 
-  Config_Prop* aProp = Config_PropManager::findProp("Visualization", "result_group_auto_color");
-
-  if (aProp) {
-    bool anIsAutoColor = Config_PropManager::boolean("Visualization", "result_group_auto_color");
-
-    if (anIsAutoColor && theResult->groupName() == ModelAPI_ResultGroup::group()) {
+    if (Config_PropManager::getAutoColorStatus()
+                            && theResult->groupName() == ModelAPI_ResultGroup::group()) {
       std::vector<int> aColor;
       ModelAPI_Tools::findRandomColor(aColor);
       ModelAPI_Tools::setColor(theResult,  aColor);
     }
-  }
 }
 
 void ModelAPI_Feature::setResult(const std::shared_ptr<ModelAPI_Result>& theResult,