[vlc-commits] sd: add backward compatibility hack for Qt GUI
Rémi Denis-Courmont
git at videolan.org
Tue Nov 15 19:02:05 CET 2016
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Nov 15 19:45:44 2016 +0200| [155a3443e8c9d15cc4b587206963141539925e3e] | committer: Rémi Denis-Courmont
sd: add backward compatibility hack for Qt GUI
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=155a3443e8c9d15cc4b587206963141539925e3e
---
modules/gui/qt/components/playlist/selector.cpp | 3 ++-
src/playlist/services_discovery.c | 8 ++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/modules/gui/qt/components/playlist/selector.cpp b/modules/gui/qt/components/playlist/selector.cpp
index 2761903..7f2631c 100644
--- a/modules/gui/qt/components/playlist/selector.cpp
+++ b/modules/gui/qt/components/playlist/selector.cpp
@@ -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 )
diff --git a/src/playlist/services_discovery.c b/src/playlist/services_discovery.c
index 7f724e9..4867158 100644
--- a/src/playlist/services_discovery.c
+++ b/src/playlist/services_discovery.c
@@ -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;
More information about the vlc-commits
mailing list