[vlc-commits] commit: Qt4: simplification ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Wed Nov 10 17:24:14 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Nov 10 18:23:39 2010 +0200| [f73e107172463eeceff084b528e1f56f5ccb37e8] | committer: Rémi Denis-Courmont 

Qt4: simplification

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f73e107172463eeceff084b528e1f56f5ccb37e8
---

 modules/gui/qt4/dialogs_provider.cpp |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index 97a754b..7cb0037 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -433,19 +433,16 @@ QStringList DialogsProvider::showSimpleOpen( const QString& help,
 void DialogsProvider::addFromSimple( bool pl, bool go)
 {
     QStringList files = DialogsProvider::showSimpleOpen();
-    int i = 0;
+    int mode = go ? PLAYLIST_GO : PLAYLIST_PREPARSE;
+
     files.sort();
     foreach( const QString &file, files )
     {
-        char* psz_uri = make_URI( qtu( toNativeSeparators(file) ), NULL );
-        playlist_Add( THEPL, psz_uri, NULL,
-                      go ? ( PLAYLIST_APPEND | ( i ? PLAYLIST_PREPARSE : PLAYLIST_GO ) )
-                         : ( PLAYLIST_APPEND | PLAYLIST_PREPARSE ),
+        QString url = toURI( file );
+        playlist_Add( THEPL, qtu( url ), NULL, PLAYLIST_APPEND | mode,
                       PLAYLIST_END, pl, pl_Unlocked );
-        free( psz_uri );
-        RecentsMRL::getInstance( p_intf )->addRecent(
-                toNativeSeparators( file ) );
-        i++;
+        RecentsMRL::getInstance( p_intf )->addRecent( url );
+        mode = PLAYLIST_PREPARSE;
     }
 }
 



More information about the vlc-commits mailing list