@@ -770,13 +770,14 @@ void MainWindow::exportModelFMU(LibraryTreeItem *pLibraryTreeItem)
770770 QSettings *pSettings = Utilities::getApplicationSettings ();
771771 QList<QString> platforms = pSettings->value (" FMIExport/Platforms" ).toStringList ();
772772 int index = platforms.indexOf (" none" );
773- if (index > -1 )
773+ if (index > -1 ) {
774774 platforms.removeAt (index);
775- if (mpOMCProxy->buildModelFMU (pLibraryTreeItem->getNameStructure (), version, type, FMUName, platforms)) {
776- MessagesWidget::instance ()->addGUIMessage (MessageItem (MessageItem::Modelica, " " , false , 0 , 0 , 0 , 0 , GUIMessages::getMessage (GUIMessages::FMU_GENERATED)
777- .arg (FMUName.isEmpty () ? pLibraryTreeItem->getNameStructure () : FMUName)
778- .arg (OptionsDialog::instance ()->getGeneralSettingsPage ()->getWorkingDirectory ()), Helper::scriptingKind,
779- Helper::notificationLevel));
775+ }
776+ QString fmuFileName = mpOMCProxy->buildModelFMU (pLibraryTreeItem->getNameStructure (), version, type, FMUName, platforms);
777+ if (!fmuFileName.isEmpty ()) {
778+ MessagesWidget::instance ()->addGUIMessage (MessageItem (MessageItem::Modelica, " " , false , 0 , 0 , 0 , 0 ,
779+ GUIMessages::getMessage (GUIMessages::FMU_GENERATED).arg (fmuFileName),
780+ Helper::scriptingKind, Helper::notificationLevel));
780781 }
781782 // hide progress bar
782783 hideProgressBar ();
@@ -797,10 +798,11 @@ void MainWindow::exportModelXML(LibraryTreeItem *pLibraryTreeItem)
797798 // show the progress bar
798799 mpProgressBar->setRange (0 , 0 );
799800 showProgressBar ();
800- if (mpOMCProxy->translateModelXML (pLibraryTreeItem->getNameStructure ())) {
801- MessagesWidget::instance ()->addGUIMessage (MessageItem (MessageItem::Modelica, " " , false , 0 , 0 , 0 , 0 , GUIMessages::getMessage (GUIMessages::XML_GENERATED)
802- .arg (OptionsDialog::instance ()->getGeneralSettingsPage ()->getWorkingDirectory ()).arg (pLibraryTreeItem->getNameStructure ()),
803- Helper::scriptingKind, Helper::notificationLevel));
801+ QString xmlFileName = mpOMCProxy->translateModelXML (pLibraryTreeItem->getNameStructure ());
802+ if (!xmlFileName.isEmpty ()) {
803+ MessagesWidget::instance ()->addGUIMessage (MessageItem (MessageItem::Modelica, " " , false , 0 , 0 , 0 , 0 ,
804+ GUIMessages::getMessage (GUIMessages::XML_GENERATED).arg (xmlFileName),
805+ Helper::scriptingKind, Helper::notificationLevel));
804806 }
805807 // hide progress bar
806808 hideProgressBar ();
0 commit comments