Commit 155a3443 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

sd: add backward compatibility hack for Qt GUI

parent ab8caa5e
......@@ -392,8 +392,9 @@ void PLSelector::setSource( QTreeWidgetItem *item )
if( i_type == SD_TYPE )
{
/* Find the right item for the SD */
/* FIXME: searching by name - what could possibly go wrong? */
pl_item = playlist_ChildSearchName( THEPL->p_root,
qtu( item->data(0, LONGNAME_ROLE ).toString() ) );
vlc_gettext(qtu(item->data(0, LONGNAME_ROLE).toString())) );
/* Podcasts */
if( item->data( 0, SPECIAL_ROLE ).toInt() == IS_PODCAST )
......
......@@ -250,6 +250,14 @@ int playlist_ServicesDiscoveryAdd(playlist_t *playlist, const char *chain)
strcpy(sds->name, chain);
playlist_Lock(playlist);
/* Backward compatibility with Qt UI: create the node even if the SD
* has not discovered any item. */
if (sds->node == NULL && sds->sd->description != NULL)
sds->node = playlist_NodeCreate(playlist, sds->sd->description,
playlist->p_root, PLAYLIST_END,
PLAYLIST_RO_FLAG|PLAYLIST_SKIP_FLAG,
NULL);
TAB_APPEND(pl_priv(playlist)->i_sds, pl_priv(playlist)->pp_sds, sds);
playlist_Unlock(playlist);
return VLC_SUCCESS;
......
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