From e3926179f5559d95f2c8c153fbe0037a21267e08 Mon Sep 17 00:00:00 2001 From: nicolas Date: Wed, 18 Dec 2013 15:32:57 +0000 Subject: [PATCH] Correction du test sur le choix du repertoire du cas --- src/HOMARDGUI/MonCreateCase.cxx | 2 +- src/HOMARD_I/HOMARD_Cas_i.cxx | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/HOMARDGUI/MonCreateCase.cxx b/src/HOMARDGUI/MonCreateCase.cxx index 4738ba34..61e78011 100644 --- a/src/HOMARDGUI/MonCreateCase.cxx +++ b/src/HOMARDGUI/MonCreateCase.cxx @@ -160,7 +160,7 @@ bool MonCreateCase::PushOnApply() if ( aDirName != _aDirName) { QString CaseNameDir = myHomardGen->VerifieDir( aDirName.toStdString().c_str()) ; - if ( CaseNameDir != "" ) + if ( ( CaseNameDir != "" ) & ( CaseNameDir != aCaseName ) ) { QString texte ; texte = QObject::tr("HOM_CASE_DIRECTORY_2") + CaseNameDir ; diff --git a/src/HOMARD_I/HOMARD_Cas_i.cxx b/src/HOMARD_I/HOMARD_Cas_i.cxx index 6515972f..d8c23b2e 100755 --- a/src/HOMARD_I/HOMARD_Cas_i.cxx +++ b/src/HOMARD_I/HOMARD_Cas_i.cxx @@ -125,17 +125,21 @@ void HOMARD_Cas_i::SetDirName( const char* NomDir ) int codret ; // A. recuperation du nom ; on ne fait rien si c'est le meme char* oldrep = GetDirName() ; - if ( oldrep == NomDir ) { return ; } + if ( strcmp(oldrep,NomDir) == 0 ) + { + return ; + } MESSAGE ( "SetDirName : passage de oldrep = "<< oldrep << " a NomDir = "<VerifieDir(NomDir) ; - if ( std::string(casename).size() > 0 ) + char* CaseName = GetName() ; + char* casenamedir = _gen_i->VerifieDir(NomDir) ; + if ( ( std::string(casenamedir).size() > 0 ) & ( strcmp(CaseName,casenamedir)!=0 ) ) { - INFOS ( "Le repertoire " << NomDir << " est deja utilise pour le cas "<< casename ); + INFOS ( "Le repertoire " << NomDir << " est deja utilise pour le cas "<< casenamedir ); SALOME::ExceptionStruct es; es.type = SALOME::BAD_PARAM; std::string text ; - text = "The directory " + std::string(NomDir) + " is already used for the case " + std::string(casename) ; + text = "The directory " + std::string(NomDir) + " is already used for the case " + std::string(casenamedir) ; es.text = CORBA::string_dup(text.c_str()); throw SALOME::SALOME_Exception(es); } -- 2.39.2