Commit 3f2ef26a authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: factorize code of opening MRL

parent 2f1adbff
...@@ -167,19 +167,12 @@ void RecentsMRL::playMRL( const QString &mrl ) ...@@ -167,19 +167,12 @@ void RecentsMRL::playMRL( const QString &mrl )
Open::openMRL( p_intf, mrl ); Open::openMRL( p_intf, mrl );
} }
void Open::openMRL( intf_thread_t *p_intf, int Open::openMRL( intf_thread_t *p_intf,
const QString &mrl, const QString &mrl,
bool b_start, bool b_start,
bool b_playlist) bool b_playlist)
{ {
playlist_Add( THEPL, qtu(mrl), NULL, return openMRLwithOptions( p_intf, mrl, NULL, b_start, b_playlist, NULL );
PLAYLIST_APPEND | (b_start ? PLAYLIST_GO : PLAYLIST_PREPARSE),
PLAYLIST_END,
b_playlist,
pl_Unlocked );
if( b_start && b_playlist )
RecentsMRL::getInstance( p_intf )->addRecent( mrl );
} }
int Open::openMRLwithOptions( intf_thread_t* p_intf, int Open::openMRLwithOptions( intf_thread_t* p_intf,
...@@ -206,7 +199,8 @@ int Open::openMRLwithOptions( intf_thread_t* p_intf, ...@@ -206,7 +199,8 @@ int Open::openMRLwithOptions( intf_thread_t* p_intf,
} }
} }
int i_ret = playlist_AddExt( THEPL, qtu(mrl), title, int i_ret = playlist_AddExt( THEPL,
qtu(mrl), title,
PLAYLIST_APPEND | (b_start ? PLAYLIST_GO : PLAYLIST_PREPARSE), PLAYLIST_APPEND | (b_start ? PLAYLIST_GO : PLAYLIST_PREPARSE),
PLAYLIST_END, PLAYLIST_END,
-1, -1,
......
...@@ -38,7 +38,7 @@ class QSignalMapper; ...@@ -38,7 +38,7 @@ class QSignalMapper;
class Open class Open
{ {
public: public:
void static openMRL( intf_thread_t*, int static openMRL( intf_thread_t*,
const QString &, const QString &,
bool b_start = true, bool b_start = true,
bool b_playlist = true); bool b_playlist = true);
......
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