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

Qt4: ensure to give a valid URI to the playlist

The URI is only given to the core while the original mrl is kept for the
display.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent ca60719c
...@@ -474,12 +474,17 @@ void DialogsProvider::openUrlDialog() ...@@ -474,12 +474,17 @@ void DialogsProvider::openUrlDialog()
QString url = oud->url(); QString url = oud->url();
if( !url.isEmpty() ) if( !url.isEmpty() )
{ {
playlist_Add( THEPL, qtu( url ), char *uri = make_URI( qtu( url ), NULL );
NULL, !oud->shouldEnqueue() ? if( likely( uri != NULL ) )
( PLAYLIST_APPEND | PLAYLIST_GO ) {
: ( PLAYLIST_APPEND | PLAYLIST_PREPARSE ), playlist_Add( THEPL, uri,
PLAYLIST_END, true, false ); NULL, !oud->shouldEnqueue() ?
RecentsMRL::getInstance( p_intf )->addRecent( url ); ( PLAYLIST_APPEND | PLAYLIST_GO )
: ( PLAYLIST_APPEND | PLAYLIST_PREPARSE ),
PLAYLIST_END, true, false );
RecentsMRL::getInstance( p_intf )->addRecent( url );
free( uri );
}
} }
} }
delete oud; delete oud;
...@@ -739,7 +744,12 @@ void DialogsProvider::SDMenuAction( const QString& data ) ...@@ -739,7 +744,12 @@ void DialogsProvider::SDMenuAction( const QString& data )
**/ **/
void DialogsProvider::playMRL( const QString &mrl ) void DialogsProvider::playMRL( const QString &mrl )
{ {
playlist_Add( THEPL, qtu(mrl), NULL, char *uri = make_URI( qtu( mrl ), NULL );
if( unlikely( uri == NULL ) )
return;
playlist_Add( THEPL, uri, NULL,
PLAYLIST_APPEND | PLAYLIST_GO , PLAYLIST_END, true, false ); PLAYLIST_APPEND | PLAYLIST_GO , PLAYLIST_END, true, false );
RecentsMRL::getInstance( p_intf )->addRecent( mrl ); RecentsMRL::getInstance( p_intf )->addRecent( mrl );
free( uri );
} }
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