]> git.sesse.net Git - vlc/commitdiff
Qt: kill a bunch of warnings
authorJean-Baptiste Kempf <jb@videolan.org>
Sat, 14 May 2011 11:31:09 +0000 (13:31 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Sat, 14 May 2011 11:33:25 +0000 (13:33 +0200)
modules/gui/qt4/components/playlist/ml_item.cpp
modules/gui/qt4/components/playlist/ml_item.hpp
modules/gui/qt4/components/playlist/ml_model.cpp
modules/gui/qt4/components/playlist/playlist.cpp
modules/gui/qt4/components/playlist/selector.cpp
modules/gui/qt4/components/playlist/standardpanel.cpp
modules/gui/qt4/components/playlist/standardpanel.hpp
modules/gui/qt4/components/playlist/vlc_model.cpp
modules/gui/qt4/util/customwidgets.cpp

index 89b58296adc4a6313b42ade87b6e6886b15d30f5..8e72f7e3982da7b236b5fc77df92bb7676ac803b 100644 (file)
@@ -87,7 +87,7 @@ MLItem::MLItem( const MLModel *p_model,
                             intf_thread_t* _p_intf,
                             ml_media_t *p_media,
                             MLItem *p_parent )
-        : model( p_model ), children(), parentItem( p_parent ), p_intf( _p_intf )
+        : p_intf( _p_intf ), model( p_model ), children(), parentItem( p_parent )
 {
     if( p_media )
         ml_gc_incref( p_media );
index 0a9257f58d4e649be20c1e54821d0d5cc4d05efe..6c781f425156e19d27b01a95c8f70e231abd25b6 100644 (file)
@@ -74,10 +74,10 @@ public:
 private:
     ml_media_t* media;
     intf_thread_t* p_intf;
+    const MLModel *model;
     media_library_t* p_ml;
     QList< MLItem* > children;
     MLItem *parentItem;
-    const MLModel *model;
 };
 
 #endif
index 623fdbfc7c72a161096f74e19733c2efd712e9b2..3841371e652369b9b7b6d3ae4583dd5a2a72422e 100644 (file)
@@ -193,8 +193,9 @@ bool MLModel::isEditable( const QModelIndex &index ) const
     case ML_VOTE:
     case ML_YEAR:
         return true;
+    default:
+        return false;
     }
-    return false;
 }
 
 QMimeData* MLModel::mimeData( const QModelIndexList &indexes ) const
@@ -261,6 +262,7 @@ int MLModel::getId( QModelIndex index ) const
 QVariant MLModel::data( const QModelIndex &index, int role ) const
 {
     if( index.isValid() )
+    {
         if( role == Qt::DisplayRole || role == Qt::EditRole )
         {
             MLItem *it = static_cast<MLItem*>( index.internalPointer() );
@@ -272,6 +274,7 @@ QVariant MLModel::data( const QModelIndex &index, int role ) const
             return QVariant( true );
         else if( role == VLCModel::IsCurrentsParentNodeRole )
             return QVariant( false );
+    }
     return QVariant();
 }
 
index fd46068ff216be037fa3f74ff060694a0d81c277..87ef9901a7c55aa141d1a55029cd93edf6709766 100644 (file)
@@ -377,7 +377,7 @@ QSize LocationBar::sizeHint() const
 
 LocationButton::LocationButton( const QString &text, bool bold,
                                 bool arrow, QWidget * parent )
-  : b_arrow( arrow ), QPushButton( parent )
+  : QPushButton( parent ), b_arrow( arrow )
 {
     QFont font;
     font.setBold( bold );
index 1486513275865a9b2a17ce1f0dcfc7e3e5303b1d..c542577ad543ec724c57ed7df6cb6e859649e1d9 100644 (file)
@@ -195,7 +195,7 @@ void PLSelector::createItems()
     ml->treeItem()->setData( 0, SPECIAL_ROLE, QVariant( IS_ML ) );
 
     /* SQL ML */
-    QTreeWidgetItem *sql_ml =  addItem( SQL_ML_TYPE, "SQL Media Library" )->treeItem();
+    addItem( SQL_ML_TYPE, "SQL Media Library" )->treeItem();
 
     /* SD nodes */
     QTreeWidgetItem *mycomp = addItem( CATEGORY_TYPE, N_("My Computer") )->treeItem();
index ca0e16b597d8f34cfb8f9cee384a4a9c8b487bf5..240701b645048ae73a18f488dd8b894b1540bd3b 100644 (file)
@@ -57,9 +57,11 @@ StandardPLPanel::StandardPLPanel( PlaylistWidget *_parent,
                                   PLSelector *_p_selector,
                                   PLModel *_p_model,
                                   MLModel *_p_plmodel)
-                : QWidget( _parent ), p_intf( _p_intf ),
-                  p_selector( _p_selector ), model( _p_model ),
-                  mlmodel( _p_plmodel)
+                : QWidget( _parent ),
+                  model( _p_model ),
+                  mlmodel( _p_plmodel),
+                  p_intf( _p_intf ),
+                  p_selector( _p_selector )
 {
     viewStack = new QStackedLayout( this );
     viewStack->setSpacing( 0 ); viewStack->setMargin( 0 );
@@ -401,7 +403,7 @@ void StandardPLPanel::showView( int i_view )
     gotoPlayingItem();
 }
 
-const int StandardPLPanel::currentViewIndex()
+int StandardPLPanel::currentViewIndex() const
 {
     if( currentView == treeView )
         return TREE_VIEW;
index 9e34a582de6a3cc1af8530cab7da19940f5ab463..14c0791be8ded71669f595d20a702c2da3afc61c 100644 (file)
@@ -68,14 +68,13 @@ public:
            PICTUREFLOW_VIEW,
            VIEW_COUNT };
 
-    const int currentViewIndex();
-
+    int currentViewIndex() const;
 
 protected:
-
     PLModel *model;
     MLModel *mlmodel;
     virtual void wheelEvent( QWheelEvent *e );
+
 private:
     intf_thread_t *p_intf;
 
index 5103fcf9e2fe480da79c3bd06c75b49460dfd780..cd1ec1dc041e19cd16c441138eb63e8c2c740d07 100644 (file)
@@ -24,7 +24,7 @@
 #include "vlc_model.hpp"
 
 VLCModel::VLCModel( intf_thread_t *_p_intf, QObject *parent )
-        : p_intf(_p_intf), QAbstractItemModel( parent )
+        : QAbstractItemModel( parent ), p_intf(_p_intf)
 {
 }
 
index aedc13d5904a9e02132b349137ab785e9c74e48c..f144671bad229b3b2df02b31149d2c72fa0f6683 100644 (file)
@@ -54,7 +54,7 @@ void QFramelessButton::paintEvent( QPaintEvent * )
 }
 
 QElidingLabel::QElidingLabel( const QString &s, Qt::TextElideMode mode, QWidget * parent )
-                 : elideMode( mode ), QLabel( s, parent )
+                 : QLabel( s, parent ), elideMode( mode )
 { }
 
 void QElidingLabel::setElideMode( Qt::TextElideMode mode )