diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index 4fba5c64857..55c199ca08d 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -352,9 +352,9 @@ void sf2Instrument::openFile( const QString & _sf2File, bool updateTrackName ) delete[] sf2Ascii; - if( updateTrackName ) + if( updateTrackName || instrumentTrack()->displayName() == displayName() ) { - instrumentTrack()->setName( QFileInfo( _sf2File ).baseName() ); + instrumentTrack()->setName( QFileInfo( _sf2File ).baseName() ); } } diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 4c907c9a232..7ae8dbcdd9d 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -237,9 +237,10 @@ void vestigeInstrument::loadFile( const QString & _file ) { m_pluginMutex.lock(); const bool set_ch_name = ( m_plugin != NULL && - instrumentTrack()->name() == m_plugin->name() ) || - instrumentTrack()->name() == - InstrumentTrack::tr( "Default preset" ); + instrumentTrack()->name() == m_plugin->name() ) || + instrumentTrack()->name() == InstrumentTrack::tr( "Default preset" ) || + instrumentTrack()->name() == displayName(); + m_pluginMutex.unlock(); if ( m_plugin != NULL ) diff --git a/src/core/song.cpp b/src/core/song.cpp index 5f3719a8ab5..0d8eaac4474 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -1195,12 +1195,28 @@ void song::exportProject(bool multiExport) efd.setAcceptMode( FileDialog::AcceptSave ); - if( efd.exec() == QDialog::Accepted && - !efd.selectedFiles().isEmpty() && !efd.selectedFiles()[0].isEmpty() ) + if( efd.exec() == QDialog::Accepted && !efd.selectedFiles().isEmpty() && !efd.selectedFiles()[0].isEmpty() ) { - const QString export_file_name = efd.selectedFiles()[0]; - exportProjectDialog epd( export_file_name, - engine::mainWindow(), multiExport ); + QString suffix = ""; + if ( !multiExport ) + { + int stx = efd.selectedNameFilter().indexOf( "(*." ); + int etx = efd.selectedNameFilter().indexOf( ")" ); + + if ( stx > 0 && etx > stx ) + { + // Get first extension from selected dropdown. + // i.e. ".wav" from "WAV-File (*.wav), Dummy-File (*.dum)" + suffix = efd.selectedNameFilter().mid( stx + 2, etx - stx - 2 ).split( " " )[0].trimmed(); + if ( efd.selectedFiles()[0].endsWith( suffix ) ) + { + suffix = ""; + } + } + } + + const QString export_file_name = efd.selectedFiles()[0] + suffix; + exportProjectDialog epd( export_file_name, engine::mainWindow(), multiExport ); epd.exec(); } }