Commit 9a38b276 authored by Ludovic Fauvet's avatar Ludovic Fauvet Committed by Jean-Baptiste Kempf

Bug fixed in the "recently played" functionnality

* 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: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent e925457d
...@@ -610,11 +610,8 @@ void DialogsProvider::SDMenuAction( QString data ) ...@@ -610,11 +610,8 @@ void DialogsProvider::SDMenuAction( QString data )
**/ **/
void DialogsProvider::playMRL( const QString &mrl ) void DialogsProvider::playMRL( const QString &mrl )
{ {
input_item_t *p_input = input_item_New( p_intf, playlist_Add( THEPL, qtu( mrl ) , NULL,
qtu( mrl ), NULL ); PLAYLIST_APPEND | PLAYLIST_GO , PLAYLIST_END, true, false );
playlist_AddInput( THEPL, p_input, PLAYLIST_GO,
PLAYLIST_END, true, pl_Unlocked );
vlc_gc_decref( p_input );
RecentsMRL::getInstance( p_intf )->addRecent( mrl ); RecentsMRL::getInstance( p_intf )->addRecent( mrl );
} }
......
...@@ -1328,11 +1328,6 @@ void QVLCMenu::updateRecents( intf_thread_t *p_intf ) ...@@ -1328,11 +1328,6 @@ void QVLCMenu::updateRecents( intf_thread_t *p_intf )
rmrl->signalMapper->setMapping( action, l.at( i ) ); rmrl->signalMapper->setMapping( action, l.at( i ) );
} }
CONNECT( rmrl->signalMapper,
mapped(const QString & ),
DialogsProvider::getInstance( p_intf ),
playMRL( const QString & ) );
recentsMenu->addSeparator(); recentsMenu->addSeparator();
recentsMenu->addAction( "Clear", rmrl, SLOT( clear() ) ); recentsMenu->addAction( "Clear", rmrl, SLOT( clear() ) );
} }
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "recents.hpp" #include "recents.hpp"
#include "dialogs_provider.hpp"
#include <QList> #include <QList>
#include <QString> #include <QString>
...@@ -37,6 +38,10 @@ RecentsMRL::RecentsMRL( intf_thread_t *_p_intf ) : p_intf( _p_intf ) ...@@ -37,6 +38,10 @@ RecentsMRL::RecentsMRL( intf_thread_t *_p_intf ) : p_intf( _p_intf )
{ {
stack = new QList<QString>; stack = new QList<QString>;
signalMapper = new QSignalMapper(this); signalMapper = new QSignalMapper(this);
CONNECT( signalMapper,
mapped(const QString & ),
DialogsProvider::getInstance( p_intf ),
playMRL( const QString & ) );
isActive = config_GetInt( p_intf, "qt-recentplay" ); isActive = config_GetInt( p_intf, "qt-recentplay" );
filter = new QRegExp( filter = new QRegExp(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment