Bug fixed in the "recently played" functionnality
authorLudovic Fauvet <etix@l0cal.com>
Mon, 20 Oct 2008 19:54:27 +0000 (21:54 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 20 Oct 2008 11:08:03 +0000 (13:08 +0200)
* A connect was called multiple times causing a wrong behaviour in the playlist.
* playlist_AddInput was replaced by playlist_Add to simplify code.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/menus.cpp
modules/gui/qt4/recents.cpp

index 879980a..8143b28 100644 (file)
@@ -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 );
 }
index 1d2d01a..28f1802 100644 (file)
@@ -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() ) );
         }
index 9109989..b1bbf85 100644 (file)
@@ -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(