From: mzn Date: Fri, 24 Oct 2014 12:23:19 +0000 (+0000) Subject: Minor changes. X-Git-Tag: BR_hydro_v_1_0_4~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f499e28961344db8429c02de5ae962a1bb40b323;p=modules%2Fhydro.git Minor changes. --- diff --git a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx index 5cac3dc1..9d78d3cc 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationOp.cxx +++ b/src/HYDROGUI/HYDROGUI_CalculationOp.cxx @@ -668,15 +668,18 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex ) QString aNewCaseName = aPanel->getObjectName(); QString anOldCaseName = myEditedObject->GetName(); + bool isNameChanged = anOldCaseName != aNewCaseName; - bool anIsToUpdateOb = false; + bool anIsToUpdateOb = isNameChanged; // At first we must to update the case name because of // automatic names generation for regions and zones myEditedObject->SetName( aNewCaseName ); // Clear rules - myEditedObject->ClearRules(); + if ( myEditedObject->GetRulesCount() > 0 ) { + myEditedObject->ClearRules(); + } // Set parameters for automatic mode int aMode = aPanel->getMode(); @@ -717,6 +720,10 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex ) else { setZonesVisible( true ); + + if ( isNameChanged ) { + module()->getDataModel()->updateObjectTree( myEditedObject ); + } } if ( anIsToUpdateOb ) { diff --git a/src/HYDROGUI/HYDROGUI_DataObject.cxx b/src/HYDROGUI/HYDROGUI_DataObject.cxx index 9701970a..6f2b9cce 100644 --- a/src/HYDROGUI/HYDROGUI_DataObject.cxx +++ b/src/HYDROGUI/HYDROGUI_DataObject.cxx @@ -234,11 +234,6 @@ void HYDROGUI_DataObject::updateBy( SUIT_DataObject* theObj ) setModified( true ); } - - - - - HYDROGUI_NamedObject::HYDROGUI_NamedObject( SUIT_DataObject* theParent, const QString& theName, const QString& theParentEntry,