[vlc-commits] Qt: kill a bunch of warnings
Jean-Baptiste Kempf
git at videolan.org
Sat May 14 13:33:26 CEST 2011
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat May 14 13:31:09 2011 +0200| [b6fa76eaf918ba2a6bbb2b56303d335bffc03a8b] | committer: Jean-Baptiste Kempf
Qt: kill a bunch of warnings
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b6fa76eaf918ba2a6bbb2b56303d335bffc03a8b
---
modules/gui/qt4/components/playlist/ml_item.cpp | 2 +-
modules/gui/qt4/components/playlist/ml_item.hpp | 2 +-
modules/gui/qt4/components/playlist/ml_model.cpp | 5 ++++-
modules/gui/qt4/components/playlist/playlist.cpp | 2 +-
modules/gui/qt4/components/playlist/selector.cpp | 2 +-
.../gui/qt4/components/playlist/standardpanel.cpp | 10 ++++++----
.../gui/qt4/components/playlist/standardpanel.hpp | 5 ++---
modules/gui/qt4/components/playlist/vlc_model.cpp | 2 +-
modules/gui/qt4/util/customwidgets.cpp | 2 +-
9 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/modules/gui/qt4/components/playlist/ml_item.cpp b/modules/gui/qt4/components/playlist/ml_item.cpp
index 89b5829..8e72f7e 100644
--- a/modules/gui/qt4/components/playlist/ml_item.cpp
+++ b/modules/gui/qt4/components/playlist/ml_item.cpp
@@ -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 );
diff --git a/modules/gui/qt4/components/playlist/ml_item.hpp b/modules/gui/qt4/components/playlist/ml_item.hpp
index 0a9257f..6c781f4 100644
--- a/modules/gui/qt4/components/playlist/ml_item.hpp
+++ b/modules/gui/qt4/components/playlist/ml_item.hpp
@@ -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
diff --git a/modules/gui/qt4/components/playlist/ml_model.cpp b/modules/gui/qt4/components/playlist/ml_model.cpp
index 623fdbf..3841371 100644
--- a/modules/gui/qt4/components/playlist/ml_model.cpp
+++ b/modules/gui/qt4/components/playlist/ml_model.cpp
@@ -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();
}
diff --git a/modules/gui/qt4/components/playlist/playlist.cpp b/modules/gui/qt4/components/playlist/playlist.cpp
index fd46068..87ef990 100644
--- a/modules/gui/qt4/components/playlist/playlist.cpp
+++ b/modules/gui/qt4/components/playlist/playlist.cpp
@@ -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 );
diff --git a/modules/gui/qt4/components/playlist/selector.cpp b/modules/gui/qt4/components/playlist/selector.cpp
index 1486513..c542577 100644
--- a/modules/gui/qt4/components/playlist/selector.cpp
+++ b/modules/gui/qt4/components/playlist/selector.cpp
@@ -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();
diff --git a/modules/gui/qt4/components/playlist/standardpanel.cpp b/modules/gui/qt4/components/playlist/standardpanel.cpp
index ca0e16b..240701b 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.cpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.cpp
@@ -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;
diff --git a/modules/gui/qt4/components/playlist/standardpanel.hpp b/modules/gui/qt4/components/playlist/standardpanel.hpp
index 9e34a58..14c0791 100644
--- a/modules/gui/qt4/components/playlist/standardpanel.hpp
+++ b/modules/gui/qt4/components/playlist/standardpanel.hpp
@@ -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;
diff --git a/modules/gui/qt4/components/playlist/vlc_model.cpp b/modules/gui/qt4/components/playlist/vlc_model.cpp
index 5103fcf..cd1ec1d 100644
--- a/modules/gui/qt4/components/playlist/vlc_model.cpp
+++ b/modules/gui/qt4/components/playlist/vlc_model.cpp
@@ -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)
{
}
diff --git a/modules/gui/qt4/util/customwidgets.cpp b/modules/gui/qt4/util/customwidgets.cpp
index aedc13d..f144671 100644
--- a/modules/gui/qt4/util/customwidgets.cpp
+++ b/modules/gui/qt4/util/customwidgets.cpp
@@ -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 )
More information about the vlc-commits
mailing list