[vlc-devel] commit: Qt: cosmetics and code-cleaning (Jean-Baptiste Kempf )

git version control git at videolan.org
Mon Sep 7 00:04:55 CEST 2009


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Sep  6 20:57:42 2009 +0200| [9ce7dea98540bb7c6bdbcda0a96adaefbfab8359] | committer: Jean-Baptiste Kempf 

Qt: cosmetics and code-cleaning

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

 modules/gui/qt4/components/playlist/selector.cpp |   33 ++++++++++++----------
 modules/gui/qt4/components/playlist/selector.hpp |   10 ++++--
 2 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/modules/gui/qt4/components/playlist/selector.cpp b/modules/gui/qt4/components/playlist/selector.cpp
index 2a35181..dd5462d 100644
--- a/modules/gui/qt4/components/playlist/selector.cpp
+++ b/modules/gui/qt4/components/playlist/selector.cpp
@@ -38,28 +38,30 @@
 #include <vlc_playlist.h>
 #include <vlc_services_discovery.h>
 
-PLSelector::PLSelector( QWidget *p, intf_thread_t *_p_intf ) : QWidget( p ), p_intf(_p_intf)
+PLSelector::PLSelector( QWidget *p, intf_thread_t *_p_intf )
+           : QWidget( p ), p_intf(_p_intf)
 {
-//    model = new PLModel( THEPL, p_intf, THEPL->p_root_category, 1, this );
     view = new QTreeWidget;
+
     view->setIconSize( QSize( 24,24 ) );
 //    view->setAlternatingRowColors( true );
     view->setIndentation( 10 );
     view->header()->hide();
     view->setRootIsDecorated( false );
+//    model = new PLModel( THEPL, p_intf, THEPL->p_root_category, 1, this );
 //    view->setModel( model );
-
-    view->setAcceptDrops(true);
-    view->setDropIndicatorShown(true);
-
+//    view->setAcceptDrops(true);
+//    view->setDropIndicatorShown(true);
 
     createItems();
     CONNECT( view, itemActivated( QTreeWidgetItem *, int ),
              this, setSource( QTreeWidgetItem *) );
-    CONNECT( view, itemClicked( QTreeWidgetItem *, int ),
-             this, setSource( QTreeWidgetItem *) );
+    /* I believe this is unnecessary, seeing
+       QStyle::SH_ItemView_ActivateItemOnSingleClick
+        CONNECT( view, itemClicked( QTreeWidgetItem *, int ),
+             this, setSource( QTreeWidgetItem *) ); */
 
-    QVBoxLayout *layout = new QVBoxLayout();
+    QVBoxLayout *layout = new QVBoxLayout;
     layout->setSpacing( 0 ); layout->setMargin( 0 );
     layout->addWidget( view );
     setLayout( layout );
@@ -103,15 +105,16 @@ void PLSelector::createItems()
     pl->setText( 0, qtr( "Playlist" ) );
     pl->setData( 0, Qt::UserRole, PL_TYPE );
     pl->setData( 0, Qt::UserRole + 1, QVariant::fromValue( THEPL->p_local_category ) );
-/*    QTreeWidgetItem *empty = new QTreeWidgetItem( view );
-    empty->setFlags(Qt::NoItemFlags);
-*/
+
+/*  QTreeWidgetItem *empty = new QTreeWidgetItem( view );
+    empty->setFlags(Qt::NoItemFlags); */
+
     QTreeWidgetItem *lib = new QTreeWidgetItem( view );
     lib->setText( 0, qtr( "Library" ) );
     lib->setData( 0, Qt::UserRole, ML_TYPE );
     lib->setData( 0, Qt::UserRole + 1, QVariant::fromValue( THEPL->p_ml_category ) );
-/*
-    QTreeWidgetItem *empty2 = new QTreeWidgetItem( view );
+
+/*  QTreeWidgetItem *empty2 = new QTreeWidgetItem( view );
     empty2->setFlags(Qt::NoItemFlags);*/
 
     QTreeWidgetItem *sds = new QTreeWidgetItem( view );
@@ -132,8 +135,8 @@ void PLSelector::createItems()
         sd_item->setData( 0, Qt::UserRole + 1, qfu( *ppsz_name ) );
         sds->addChild( sd_item );
     }
-
 }
+
 PLSelector::~PLSelector()
 {
 }
diff --git a/modules/gui/qt4/components/playlist/selector.hpp b/modules/gui/qt4/components/playlist/selector.hpp
index f2c367e..14f2b90 100644
--- a/modules/gui/qt4/components/playlist/selector.hpp
+++ b/modules/gui/qt4/components/playlist/selector.hpp
@@ -1,10 +1,11 @@
 /*****************************************************************************
  * selector.hpp : Playlist source selector
  ****************************************************************************
- * Copyright (C) 2000-2005 the VideoLAN team
+ * Copyright (C) 2000-2009 the VideoLAN team
  * $Id$
  *
  * Authors: Clément Stenac <zorglub at videolan.org>
+ *          Jean-Baptiste Kempf
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -28,11 +29,13 @@
 # include "config.h"
 #endif
 
-#include "components/playlist/playlist_model.hpp"
-
 #include <QWidget>
 #include <QTreeWidgetItem>
 
+#include <vlc_playlist.h>
+
+#include "qt4.hpp"
+
 class QTreeWidget;
 class PlaylistWidget;
 
@@ -50,7 +53,6 @@ public:
     PLSelector( QWidget *p, intf_thread_t *_p_intf );
     virtual ~PLSelector();
 protected:
-    PLModel *model;
     friend class PlaylistWidget;
 private:
     intf_thread_t *p_intf;




More information about the vlc-devel mailing list