if( item->i_id == i_cached_id ) i_cached_id = -1;
i_cached_input_id = -1;
- if(item == rootItem)
- rootItem = NULL;
-
if( item->parentItem ) {
int i = item->parentItem->children.indexOf( item );
beginRemoveRows( index( item->parentItem, 0), i, i );
}
else delete item;
+ if(item == rootItem)
+ {
+ rootItem = NULL;
+ rebuild( p_playlist->p_playing );
+ emit rootChanged();
+ }
}
/* This function must be entered WITH the playlist lock */
signals:
void currentChanged( const QModelIndex& );
+ void rootChanged();
public slots:
void activateItem( const QModelIndex &index );
locationBar = new LocationBar( model );
layout->addWidget( locationBar, 0, 0 );
+ CONNECT( model, rootChanged(), locationBar, setRootIndex() );
/* A Spacer and the search possibilities */
layout->setColumnStretch( 1, 10 );
}
}
+void LocationBar::setRootIndex()
+{
+ setIndex( QModelIndex() );
+}
+
void LocationBar::invoke( int i_id )
{
QModelIndex index = model->index( i_id, 0 );
void setIndex( const QModelIndex & );
signals:
void invoked( const QModelIndex & );
+public slots:
+ void setRootIndex();
private slots:
void invoke( int i_item_id );
private:
class LocationButton : public QPushButton
{
- public:
- LocationButton( const QString &, bool bold, bool arrow );
- private:
- void paintEvent ( QPaintEvent * event );
- QSize sizeHint() const;
- QFontMetrics *metrics;
- bool b_arrow;
+public:
+ LocationButton( const QString &, bool bold, bool arrow );
+private:
+ void paintEvent ( QPaintEvent * event );
+ QSize sizeHint() const;
+ QFontMetrics *metrics;
+ bool b_arrow;
};
#endif