Commit 477de11a authored by François Cartegnie's avatar François Cartegnie 🤞

Qt: PLItem: constness and override

parent 3a3af320
......@@ -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:
......
......@@ -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 );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment