[vlc-devel] [PATCH] [Qt] Bug fixed in the "recently played" functionnality

Ludovic Fauvet etix at l0cal.com
Mon Oct 20 21:54:27 CEST 2008


* A connect was called multiple times causing a wrong behaviour in the playlist.
* playlist_AddInput was replaced by playlist_Add to simplify code.
---
 modules/gui/qt4/dialogs_provider.cpp |    7 ++-----
 modules/gui/qt4/menus.cpp            |    5 -----
 modules/gui/qt4/recents.cpp          |    5 +++++
 3 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index 879980a..8143b28 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -610,11 +610,8 @@ void DialogsProvider::SDMenuAction( QString data )
  **/
 void DialogsProvider::playMRL( const QString &mrl )
 {
-    input_item_t *p_input = input_item_New( p_intf,
-            qtu( mrl ), NULL );
-    playlist_AddInput( THEPL, p_input, PLAYLIST_GO,
-            PLAYLIST_END, true, pl_Unlocked );
-    vlc_gc_decref( p_input );
+    playlist_Add( THEPL, qtu( mrl ) , NULL,
+           PLAYLIST_APPEND | PLAYLIST_GO , PLAYLIST_END, true, false );
 
     RecentsMRL::getInstance( p_intf )->addRecent( mrl );
 }
diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 1d2d01a..28f1802 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -1328,11 +1328,6 @@ void QVLCMenu::updateRecents( intf_thread_t *p_intf )
                 rmrl->signalMapper->setMapping( action, l.at( i ) );
             }
 
-            CONNECT( rmrl->signalMapper,
-                     mapped(const QString & ),
-                     DialogsProvider::getInstance( p_intf ),
-                     playMRL( const QString & ) );
-
             recentsMenu->addSeparator();
             recentsMenu->addAction( "Clear", rmrl, SLOT( clear() ) );
         }
diff --git a/modules/gui/qt4/recents.cpp b/modules/gui/qt4/recents.cpp
index 9109989..b1bbf85 100644
--- a/modules/gui/qt4/recents.cpp
+++ b/modules/gui/qt4/recents.cpp
@@ -23,6 +23,7 @@
 
 
 #include "recents.hpp"
+#include "dialogs_provider.hpp"
 
 #include <QList>
 #include <QString>
@@ -37,6 +38,10 @@ RecentsMRL::RecentsMRL( intf_thread_t *_p_intf ) : p_intf( _p_intf )
 {
     stack = new QList<QString>;
     signalMapper = new QSignalMapper(this);
+    CONNECT( signalMapper,
+            mapped(const QString & ),
+            DialogsProvider::getInstance( p_intf ),
+            playMRL( const QString & ) );
 
     isActive = config_GetInt( p_intf, "qt-recentplay" );
     filter = new QRegExp(
-- 
1.5.6.4




More information about the vlc-devel mailing list