From: ribes Date: Wed, 6 Jan 2010 14:24:37 +0000 (+0000) Subject: - Check if we add a resource already added X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8e462ba3481c7eedf95ffb01551481f6f41df421;p=modules%2Fkernel.git - Check if we add a resource already added - Write a warning and kepp last resource found --- diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx index b41a5aa56..b5c52eba1 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx @@ -129,6 +129,9 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) _resource.DataForSort._Name = Kernel_Utils::GetHostname(); } } + map::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::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; } }