From: azakir Date: Thu, 17 Dec 2020 15:18:49 +0000 (+0100) Subject: change default med file out X-Git-Tag: V9_7_0a1~18^2~47 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=86be227dee12b1a2d7dafc3308597f1566ef950f;p=modules%2Fsmesh.git change default med file out --- diff --git a/src/SMESHGUI/MG_ADAPTGUI.cxx b/src/SMESHGUI/MG_ADAPTGUI.cxx index 928b93023..397bdb3be 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.cxx +++ b/src/SMESHGUI/MG_ADAPTGUI.cxx @@ -764,7 +764,8 @@ void SMESHGUI_MgAdaptArguments::onSelectMedFilebuttonClicked() *myFileInDir = myFileInfo.path(); *myFileOutDir = myFileInfo.path(); selectMedFileLineEdit->setText(myFileInfo.fileName()); - selectOutMedFileLineEdit->setText(myFileInfo.fileName()); + QString outF = QString( remove_extension(myFileInfo.fileName().toStdString() ).c_str() )+QString(".adapt.med"); + selectOutMedFileLineEdit->setText(outF); onLocalSelected(myFileInfo.filePath()); } @@ -1368,6 +1369,10 @@ std::map GetListeChamps(QString aFile, bool errorMessage) return ListeChamp; } - +std::string remove_extension(const std::string& filename) { + size_t lastdot = filename.find_last_of("."); + if (lastdot == std::string::npos) return filename; + return filename.substr(0, lastdot); +} diff --git a/src/SMESHGUI/MG_ADAPTGUI.hxx b/src/SMESHGUI/MG_ADAPTGUI.hxx index ced54d236..4cc94cca9 100644 --- a/src/SMESHGUI/MG_ADAPTGUI.hxx +++ b/src/SMESHGUI/MG_ADAPTGUI.hxx @@ -97,6 +97,7 @@ std::map GetListeChamps(QString aFile, bool errorMessage = true); QString lireNomMaillage(QString aFile); QString lireNomMaillage2(med_idt medIdt,int meshId); med_idt OuvrirFichier(QString aFile); +std::string remove_extension(const std::string& filename); //================================================================================= // class : SMESHGUI_MgAdaptDlg