]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
- Check if we add a resource already added
authorribes <ribes>
Wed, 6 Jan 2010 14:24:37 +0000 (14:24 +0000)
committerribes <ribes>
Wed, 6 Jan 2010 14:24:37 +0000 (14:24 +0000)
- Write a warning and kepp last resource found

src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx

index b41a5aa567034fba237607aaf7feb28d03e80931..b5c52eba17a7678a7b6d6e53d0ebdd65435e1db0 100755 (executable)
@@ -129,6 +129,9 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
            _resource.DataForSort._Name = Kernel_Utils::GetHostname();
          }
        }
+       map<string, ParserResourcesType>::const_iterator iter = _resources_list.find(_resource.Name);
+       if (iter != _resources_list.end())
+         RES_INFOS("Warning resource " << _resource.Name << " already added, keep last resource found !");
        _resources_list[_resource.Name] = _resource;
       }
     }
@@ -138,6 +141,9 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
       _resource.Clear();
       if(ProcessCluster(aCurNode, _resource))
       {
+       map<string, ParserResourcesType>::const_iterator iter = _resources_list.find(_resource.Name);
+       if (iter != _resources_list.end())
+         RES_INFOS("Warning resource " << _resource.Name << " already added, keep last resource found !");
        _resources_list[_resource.Name] = _resource;
       }
     }