[vlc-commits] Qt: factorize code of opening MRL

Jean-Baptiste Kempf git at videolan.org
Sun May 18 23:21:21 CEST 2014


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun May 18 18:09:34 2014 +0200| [3f2ef26a3b31be95577526e2bc6a13929b76f6e9] | committer: Jean-Baptiste Kempf

Qt: factorize code of opening MRL

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

 modules/gui/qt4/recents.cpp |   14 ++++----------
 modules/gui/qt4/recents.hpp |    2 +-
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/modules/gui/qt4/recents.cpp b/modules/gui/qt4/recents.cpp
index 6c5113a..23266ca 100755
--- a/modules/gui/qt4/recents.cpp
+++ b/modules/gui/qt4/recents.cpp
@@ -167,19 +167,12 @@ void RecentsMRL::playMRL( const QString &mrl )
     Open::openMRL( p_intf, mrl );
 }
 
-void Open::openMRL( intf_thread_t *p_intf,
+int Open::openMRL( intf_thread_t *p_intf,
                     const QString &mrl,
                     bool b_start,
                     bool b_playlist)
 {
-    playlist_Add( THEPL, qtu(mrl), NULL,
-                  PLAYLIST_APPEND | (b_start ? PLAYLIST_GO : PLAYLIST_PREPARSE),
-                  PLAYLIST_END,
-                  b_playlist,
-                  pl_Unlocked );
-
-    if( b_start && b_playlist )
-        RecentsMRL::getInstance( p_intf )->addRecent( mrl );
+    return openMRLwithOptions( p_intf, mrl, NULL, b_start, b_playlist, NULL );
 }
 
 int Open::openMRLwithOptions( intf_thread_t* p_intf,
@@ -206,7 +199,8 @@ int Open::openMRLwithOptions( intf_thread_t* p_intf,
         }
     }
 
-    int i_ret = playlist_AddExt( THEPL, qtu(mrl), title,
+    int i_ret = playlist_AddExt( THEPL,
+                  qtu(mrl), title,
                   PLAYLIST_APPEND | (b_start ? PLAYLIST_GO : PLAYLIST_PREPARSE),
                   PLAYLIST_END,
                   -1,
diff --git a/modules/gui/qt4/recents.hpp b/modules/gui/qt4/recents.hpp
index 35daec2..6a45834 100644
--- a/modules/gui/qt4/recents.hpp
+++ b/modules/gui/qt4/recents.hpp
@@ -38,7 +38,7 @@ class QSignalMapper;
 class Open
 {
 public:
-    void static openMRL( intf_thread_t*,
+    int static openMRL( intf_thread_t*,
                          const QString &,
                          bool b_start = true,
                          bool b_playlist = true);



More information about the vlc-commits mailing list