[vlc-commits] qt4: Fix PLSelector when a discovery service fails to be created.
Hugo Beauzée-Luyssen
git at videolan.org
Wed Mar 14 12:10:08 CET 2012
vlc/vlc-2.0 | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Tue Mar 13 15:14:51 2012 +0100| [1dac0eb8a4c2c02a98c293300ffa3409a9ac2ec7] | committer: Jean-Baptiste Kempf
qt4: Fix PLSelector when a discovery service fails to be created.
(cherry picked from commit 043553e769dc66d1e891f68723456c294f1c31f5)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=1dac0eb8a4c2c02a98c293300ffa3409a9ac2ec7
---
modules/gui/qt4/components/playlist/selector.cpp | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/selector.cpp b/modules/gui/qt4/components/playlist/selector.cpp
index bef865a..b78e9cb 100644
--- a/modules/gui/qt4/components/playlist/selector.cpp
+++ b/modules/gui/qt4/components/playlist/selector.cpp
@@ -265,8 +265,6 @@ void PLSelector::setSource( QTreeWidgetItem *item )
if( !item || item == curItem )
return;
- curItem = item;
-
bool b_ok;
int i_type = item->data( 0, TYPE_ROLE ).toInt( &b_ok );
if( !b_ok || i_type == CATEGORY_TYPE )
@@ -279,7 +277,8 @@ void PLSelector::setSource( QTreeWidgetItem *item )
sd_loaded = playlist_IsServicesDiscoveryLoaded( THEPL, qtu( qs ) );
if( !sd_loaded )
{
- playlist_ServicesDiscoveryAdd( THEPL, qtu( qs ) );
+ if ( playlist_ServicesDiscoveryAdd( THEPL, qtu( qs ) ) != VLC_SUCCESS )
+ return ;
services_discovery_descriptor_t *p_test = new services_discovery_descriptor_t;
playlist_ServicesDiscoveryControl( THEPL, qtu( qs ), SD_CMD_DESCRIPTOR, p_test );
@@ -295,6 +294,8 @@ void PLSelector::setSource( QTreeWidgetItem *item )
}
#endif
+ curItem = item;
+
/* */
playlist_Lock( THEPL );
playlist_item_t *pl_item = NULL;
More information about the vlc-commits
mailing list