[vlc-devel] commit: Revert "qt4: selector: switch source on single click" (Jakob Leben )

git version control git at videolan.org
Mon Sep 7 10:03:44 CEST 2009


vlc | branch: master | Jakob Leben <jleben at videolan.org> | Mon Sep  7 10:03:14 2009 +0200| [bc65454cabb4e1eb5379639173e934c4cf9395f9] | committer: Jakob Leben 

Revert "qt4: selector: switch source on single click"

This reverts commit 2d23529861a5eb27647adaa42ae8f4de5c23ce18.

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

 modules/gui/qt4/components/playlist/selector.cpp |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/selector.cpp b/modules/gui/qt4/components/playlist/selector.cpp
index a89c1cd..9f8097a 100644
--- a/modules/gui/qt4/components/playlist/selector.cpp
+++ b/modules/gui/qt4/components/playlist/selector.cpp
@@ -54,15 +54,12 @@ PLSelector::PLSelector( QWidget *p, intf_thread_t *_p_intf )
 //    view->setDropIndicatorShown(true);
 
     createItems();
-    /* CONNECT( view, itemActivated( QTreeWidgetItem *, int ),
-             this, setSource( QTreeWidgetItem *) ); */
+    CONNECT( view, itemActivated( QTreeWidgetItem *, int ),
+             this, setSource( QTreeWidgetItem *) );
     /* I believe this is unnecessary, seeing
-       QStyle::SH_ItemView_ActivateItemOnSingleClick */
-    /* <jleben> No, you can only make custom styles by creating whole new
-       or subclassing an existing QStyle.
-       Connecting itemClicked signal is easier, of course */
-    CONNECT( view, itemClicked( QTreeWidgetItem *, int ),
-          this, setSource( QTreeWidgetItem *) );
+       QStyle::SH_ItemView_ActivateItemOnSingleClick
+        CONNECT( view, itemClicked( QTreeWidgetItem *, int ),
+             this, setSource( QTreeWidgetItem *) ); */
 
     QVBoxLayout *layout = new QVBoxLayout;
     layout->setSpacing( 0 ); layout->setMargin( 0 );
@@ -78,10 +75,7 @@ void PLSelector::setSource( QTreeWidgetItem *item )
     if( !item )
         return;
 
-    QVariant type = item->data( 0, TYPE_ROLE );
-    if( type == QVariant() ) return;
-
-    int i_type = type.toInt();
+    int i_type = item->data( 0, TYPE_ROLE ).toInt();
 
     assert( ( i_type == PL_TYPE || i_type == ML_TYPE || i_type == SD_TYPE ) );
     if( i_type == SD_TYPE )




More information about the vlc-devel mailing list