From 8229bb63f89c55215a96fc47bee56510d4e229e8 Mon Sep 17 00:00:00 2001 From: ouv Date: Mon, 5 Aug 2013 11:23:13 +0000 Subject: [PATCH] Save/Open study. --- src/HYDROGUI/HYDROGUI_DataModel.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_DataModel.cxx b/src/HYDROGUI/HYDROGUI_DataModel.cxx index a2fda47a..30e21ed8 100644 --- a/src/HYDROGUI/HYDROGUI_DataModel.cxx +++ b/src/HYDROGUI/HYDROGUI_DataModel.cxx @@ -63,7 +63,7 @@ bool HYDROGUI_DataModel::open( const QString& theURL, LightApp_DataModel::open( theURL, theStudy, theFileList ); const int aStudyId = theStudy->id(); - bool res = false; + Data_DocError res = DocError_UnknownProblem; if( theFileList.count() == 2 ) { QString aTmpDir = theFileList[0]; @@ -78,9 +78,9 @@ bool HYDROGUI_DataModel::open( const QString& theURL, } catch(...) { - res = false; + res = DocError_UnknownProblem; } - if (!res) + if( res != DocError_OK ) { module()->application()->putInfo( tr( "LOAD_ERROR" ) ); return false; @@ -89,7 +89,7 @@ bool HYDROGUI_DataModel::open( const QString& theURL, // if the document open was successful, the data model update happens // in the set mode of the module - if( !res ) + if( res == DocError_OK ) update( aStudyId ); return true; @@ -114,11 +114,11 @@ bool HYDROGUI_DataModel::save( QStringList& theFileList ) // save data to temporary files LightApp_Study* aStudy = dynamic_cast( module()->application()->activeStudy() ); aTmpDir = aStudy->GetTmpDir( myStudyURL.toLatin1().constData(), isMultiFile ).c_str(); - aFileName = SUIT_Tools::file (myStudyURL, false ) + "_HYDRO.cbf"; + aFileName = SUIT_Tools::file( myStudyURL, false ) + "_HYDRO.cbf"; QString aFullPath = aTmpDir + aFileName; - bool res = HYDROData_Document::Document( aStudyId )->Save( (char*)aFullPath.toLatin1().constData() ); - if( !res ) + Data_DocError res = HYDROData_Document::Document( aStudyId )->Save( (char*)aFullPath.toLatin1().constData() ); + if( res != DocError_OK ) { module()->application()->putInfo( tr( "SAVE_ERROR" ) ); return false; -- 2.39.2