[vlc-commits] Qt: provide an helper to open items

Jean-Baptiste Kempf git at videolan.org
Sun May 18 16:58:35 CEST 2014


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun May 18 16:54:24 2014 +0200| [d276f7551e051bf241a0b18cf0412749ba38fe7b] | committer: Jean-Baptiste Kempf

Qt: provide an helper to open items

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

 modules/gui/qt4/recents.cpp |   20 ++++++++++++++++++++
 modules/gui/qt4/recents.hpp |    6 ++++++
 2 files changed, 26 insertions(+)

diff --git a/modules/gui/qt4/recents.cpp b/modules/gui/qt4/recents.cpp
index 0a0fd13..03eb9a8 100755
--- a/modules/gui/qt4/recents.cpp
+++ b/modules/gui/qt4/recents.cpp
@@ -182,3 +182,23 @@ void Open::openMRL( intf_thread_t *p_intf,
     if( b_start && b_playlist )
         RecentsMRL::getInstance( p_intf )->addRecent( mrl );
 }
+
+int Open::openInput( intf_thread_t* p_intf,
+                      input_item_t *p_item,
+                      const QString &mrl,
+                      bool b_start,
+                      bool b_playlist)
+{
+    int i_ret = playlist_AddInput( THEPL, p_item,
+                  PLAYLIST_APPEND | (b_start ? PLAYLIST_GO : PLAYLIST_PREPARSE),
+                  PLAYLIST_END,
+                  b_playlist,
+                  pl_Unlocked );
+
+    if( i_ret == VLC_SUCCESS && b_start && b_playlist )
+        RecentsMRL::getInstance( p_intf )->addRecent( mrl );
+
+    return i_ret;
+}
+
+
diff --git a/modules/gui/qt4/recents.hpp b/modules/gui/qt4/recents.hpp
index ce6cfdd..530fd22 100644
--- a/modules/gui/qt4/recents.hpp
+++ b/modules/gui/qt4/recents.hpp
@@ -42,6 +42,12 @@ public:
                          const QString &,
                          bool b_start = true,
                          bool b_playlist = true);
+
+    int static openInput( intf_thread_t*,
+                          input_item_t *,
+                          const QString &,
+                          bool b_start = true,
+                          bool b_playlist = true);
 };
 
 class RecentsMRL : public QObject, public Singleton<RecentsMRL>



More information about the vlc-commits mailing list