[vlc-commits] qt4: Fix PLSelector when a discovery service fails to be created.

Hugo Beauzée-Luyssen git at videolan.org
Tue Mar 13 15:24:42 CET 2012


vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Tue Mar 13 15:14:51 2012 +0100| [043553e769dc66d1e891f68723456c294f1c31f5] | committer: Hugo Beauzée-Luyssen

qt4: Fix PLSelector when a discovery service fails to be created.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=043553e769dc66d1e891f68723456c294f1c31f5
---

 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