[vlc-commits] Qt: PLItem: constness and override
Francois Cartegnie
git at videolan.org
Tue May 10 19:30:36 CEST 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue May 10 18:02:00 2016 +0200| [477de11ad421dac4def73cd46a246e71768da141] | committer: Francois Cartegnie
Qt: PLItem: constness and override
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=477de11ad421dac4def73cd46a246e71768da141
---
modules/gui/qt/components/playlist/playlist_item.cpp | 4 ++--
modules/gui/qt/components/playlist/playlist_item.hpp | 16 +++++++++-------
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/modules/gui/qt/components/playlist/playlist_item.cpp b/modules/gui/qt/components/playlist/playlist_item.cpp
index 08e78f3..f1d9a09 100644
--- a/modules/gui/qt/components/playlist/playlist_item.cpp
+++ b/modules/gui/qt/components/playlist/playlist_item.cpp
@@ -85,12 +85,12 @@ PLItem::~PLItem()
children.clear();
}
-int PLItem::id( int type )
+int PLItem::id( int type ) const
{
switch( type )
{
case INPUTITEM_ID:
- return inputItem()->i_id;
+ return p_input->i_id;
case PLAYLIST_ID:
return i_playlist_id;
default:
diff --git a/modules/gui/qt/components/playlist/playlist_item.hpp b/modules/gui/qt/components/playlist/playlist_item.hpp
index 599fd84..23a6629 100644
--- a/modules/gui/qt/components/playlist/playlist_item.hpp
+++ b/modules/gui/qt/components/playlist/playlist_item.hpp
@@ -28,6 +28,8 @@
# include "config.h"
#endif
+#include "qt.hpp"
+
#include <QList>
#include <QString>
#include <QUrl>
@@ -51,7 +53,7 @@ public:
virtual ~AbstractPLItem() {}
protected:
- virtual int id( int type ) = 0;
+ virtual int id( int type ) const = 0;
int childCount() const { return children.count(); }
int indexOf( AbstractPLItem *item ) const { return children.indexOf( item ); };
int lastIndexOf( AbstractPLItem *item ) const { return children.lastIndexOf( item ); };
@@ -81,12 +83,12 @@ public:
private:
/* AbstractPLItem */
- int id( int type );
- input_item_t *inputItem() { return p_input; }
- AbstractPLItem *child( int id ) const { return children.value( id ); };
- virtual QUrl getURI() const;
- virtual QString getTitle() const;
- virtual bool readOnly() const;
+ int id( int type ) const Q_DECL_OVERRIDE;
+ input_item_t *inputItem() Q_DECL_OVERRIDE { return p_input; }
+ AbstractPLItem *child( int id ) const Q_DECL_OVERRIDE { return children.value( id ); };
+ virtual QUrl getURI() const Q_DECL_OVERRIDE;
+ virtual QString getTitle() const Q_DECL_OVERRIDE;
+ virtual bool readOnly() const Q_DECL_OVERRIDE;
/* Local */
PLItem( playlist_item_t *, PLItem *parent );
More information about the vlc-commits
mailing list