~PLItem();
int row() const;
- void insertChild( PLItem *, int );
+ void insertChild( PLItem *, int p, bool signal = true );
- void appendChild( PLItem *item ) { insertChild( item, children.count() ); };
+ void appendChild( PLItem *item, bool signal = true )
+ {
+ insertChild( item, children.count(), signal );
+ };
PLItem *child( int row ) { return children.value( row ); };
int childCount() const { return children.count(); };
QString columnString( int col ) { return strings.value( col ); };
PLItem *parent() { return parentItem; };
+
+ void update( playlist_item_t *);
protected:
QList<PLItem*> children;
int i_id;
int i_input_id;
friend class PLModel;
private:
+ void init( int, int, PLItem *, PLModel * );
QList<QString> strings;
PLItem *parentItem;
Q_OBJECT
public:
- PLModel( playlist_item_t *, int, QObject *parent = 0);
+ PLModel( playlist_t *, playlist_item_t *, int, QObject *parent = 0);
~PLModel();
void customEvent( QEvent * );
QModelIndex parent( const QModelIndex &index) const;
int childrenCount( const QModelIndex &parent = QModelIndex() ) const;
+ int rowCount( const QModelIndex &parent = QModelIndex() ) const;
+ int columnCount( const QModelIndex &parent = QModelIndex() ) const;
bool b_need_update;
int i_items_to_append;
+ void Rebuild();
private:
+ void addCallbacks();
+ void delCallbacks();
PLItem *rootItem;
playlist_t *p_playlist;
void ProcessInputItemUpdate( int i_input_id );
void ProcessItemRemoval( int i_id );
void ProcessItemAppend( playlist_add_t *p_add );
-
+
+ void UpdateTreeItem( PLItem *, bool );
+ void UpdateTreeItem( playlist_item_t *, PLItem *, bool );
+ void UpdateNodeChildren( PLItem * );
+ void UpdateNodeChildren( playlist_item_t *, PLItem * );
+
/* Lookups */
PLItem *FindById( PLItem *, int );
PLItem *FindByInput( PLItem *, int );