[vlc-devel] commit: Revert "qt4: use longname to search activated input-item" ( Rémi Denis-Courmont )

git version control git at videolan.org
Sun Oct 25 15:08:07 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Oct 25 16:07:03 2009 +0200| [2e50c820474b227821334dccd45139720d7d66d5] | committer: Rémi Denis-Courmont 

Revert "qt4: use longname to search activated input-item"

This reverts commit edcc45df28099534938f04f26b573449c5c897bf.

This causes segmentation faults and breaks SD categories.

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

 modules/gui/qt4/components/playlist/selector.cpp |   13 +++++++------
 modules/gui/qt4/components/playlist/selector.hpp |    1 -
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/selector.cpp b/modules/gui/qt4/components/playlist/selector.cpp
index 7bb9cd3..42076f9 100644
--- a/modules/gui/qt4/components/playlist/selector.cpp
+++ b/modules/gui/qt4/components/playlist/selector.cpp
@@ -82,21 +82,23 @@ void PLSelector::setSource( QTreeWidgetItem *item )
         if( !playlist_IsServicesDiscoveryLoaded( THEPL, qtu( qs ) ) )
         {
             playlist_ServicesDiscoveryAdd( THEPL, qtu( qs ) );
+#warning FIXME
+            playlist_item_t *pl_item =
+                    THEPL->p_root_category->pp_children[THEPL->p_root_category->i_children-1];
+            item->setData( 0, PPL_ITEM_ROLE, QVariant::fromValue( pl_item ) );
 
+            emit activated( pl_item );
+            return;
         }
     }
 
     if( i_type == SD_TYPE )
         msg_Dbg( p_intf, "SD already loaded, reloading" );
 
-    playlist_Lock( THEPL );
     playlist_item_t *pl_item =
-            playlist_ChildSearchName( THEPL->p_root_onelevel, qtu( item->data(0, LONGNAME_ROLE ).toString() ) );
-    playlist_Unlock( THEPL );
+            item->data( 0, PPL_ITEM_ROLE ).value<playlist_item_t *>();
     if( pl_item )
             emit activated( pl_item );
-    else
-            msg_Info( p_intf, "no node found for %s", qtu( item->data(0, LONGNAME_ROLE ).toString() ) );
 }
 
 void PLSelector::createItems()
@@ -133,7 +135,6 @@ void PLSelector::createItems()
         sd_item = new QTreeWidgetItem( QStringList( qfu(*ppsz_longname) ) );
         sd_item->setData( 0, TYPE_ROLE, SD_TYPE );
         sd_item->setData( 0, NAME_ROLE, qfu( *ppsz_name ) );
-        sd_item->setData( 0, LONGNAME_ROLE, qfu( *ppsz_longname ) );
         sd_item->setFlags( sd_item->flags() & ~Qt::ItemIsDropEnabled );
         sds->addChild( sd_item );
         free( *ppsz_name );
diff --git a/modules/gui/qt4/components/playlist/selector.hpp b/modules/gui/qt4/components/playlist/selector.hpp
index 758b35e..f0471a3 100644
--- a/modules/gui/qt4/components/playlist/selector.hpp
+++ b/modules/gui/qt4/components/playlist/selector.hpp
@@ -48,7 +48,6 @@ enum {
     TYPE_ROLE = Qt::UserRole,
     PPL_ITEM_ROLE,
     NAME_ROLE,
-    LONGNAME_ROLE,
 };
 
 Q_DECLARE_METATYPE( playlist_item_t *);




More information about the vlc-devel mailing list