Commit 2283cdda authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: save playlist: force native dialog

parent 2e2de104
...@@ -595,19 +595,12 @@ void DialogsProvider::saveAPlaylist() ...@@ -595,19 +595,12 @@ void DialogsProvider::saveAPlaylist()
} }
QString selected; QString selected;
QString file = QFileDialog::getSaveFileName( NULL,
QFileDialog *dialog = new QFileDialog( NULL, qtr( "Save playlist as..." ),
qtr( "Save playlist as..." ), p_intf->p_sys->filepath, filters.join( ";;" ),
QString( p_intf->p_sys->filepath ), &selected );
filters.join( ";;" ) );
dialog->setDefaultSuffix( qfu( types[0].filter_patterns ) );
dialog->setAcceptMode( QFileDialog::AcceptSave );
dialog->exec();
QString file = dialog->selectedFiles().first();
QString nameFilter = dialog->selectedNameFilter();
const char *psz_selected_module = NULL; const char *psz_selected_module = NULL;
const char *psz_last_playlist_ext = NULL; const char *psz_last_playlist_ext = NULL;
delete dialog;
if( file.isEmpty() ) if( file.isEmpty() )
return; return;
...@@ -628,7 +621,7 @@ void DialogsProvider::saveAPlaylist() ...@@ -628,7 +621,7 @@ void DialogsProvider::saveAPlaylist()
{ {
for( size_t i = 0; i < sizeof (types) / sizeof (types[0]); i++) for( size_t i = 0; i < sizeof (types) / sizeof (types[0]); i++)
{ {
if ( nameFilter.startsWith( vlc_gettext( types[i].filter_name ) ) ) if ( selected.startsWith( vlc_gettext( types[i].filter_name ) ) )
{ {
psz_selected_module = types[i].module; psz_selected_module = types[i].module;
psz_last_playlist_ext = types[i].filter_patterns; psz_last_playlist_ext = types[i].filter_patterns;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment