]> git.sesse.net Git - vlc/commitdiff
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 879980ad931433737e7c8df605024f4bff7a75d3..8143b28e9e292fec32d61a9fc79aa075261fccd4 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 1d2d01a08b7b019a3c85b342b60873adc351f133..28f1802f0d139df475781379e4455c4ac3e05f18 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 9109989434fa1b0955e090927b6a3ef906d70192..b1bbf8535fd2d68e9672a2302d43587c2de4c08a 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(