[vlc-commits] Qt: save playlist: force native dialog
Francois Cartegnie
git at videolan.org
Fri Jan 4 19:56:30 CET 2013
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jan 4 19:54:09 2013 +0100| [2283cdda5f4e89953d62a3df7108c902c8c5a104] | committer: Francois Cartegnie
Qt: save playlist: force native dialog
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2283cdda5f4e89953d62a3df7108c902c8c5a104
---
modules/gui/qt4/dialogs_provider.cpp | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index 8b2e93e..3d47a06 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -595,19 +595,12 @@ void DialogsProvider::saveAPlaylist()
}
QString selected;
-
- QFileDialog *dialog = new QFileDialog( NULL,
- qtr( "Save playlist as..." ),
- QString( p_intf->p_sys->filepath ),
- filters.join( ";;" ) );
- dialog->setDefaultSuffix( qfu( types[0].filter_patterns ) );
- dialog->setAcceptMode( QFileDialog::AcceptSave );
- dialog->exec();
- QString file = dialog->selectedFiles().first();
- QString nameFilter = dialog->selectedNameFilter();
+ QString file = QFileDialog::getSaveFileName( NULL,
+ qtr( "Save playlist as..." ),
+ p_intf->p_sys->filepath, filters.join( ";;" ),
+ &selected );
const char *psz_selected_module = NULL;
const char *psz_last_playlist_ext = NULL;
- delete dialog;
if( file.isEmpty() )
return;
@@ -628,7 +621,7 @@ void DialogsProvider::saveAPlaylist()
{
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_last_playlist_ext = types[i].filter_patterns;
More information about the vlc-commits
mailing list