ADD_ICON( NODE, ":/type/node" );
#undef ADD_ICON
- rebuild( p_root );
+ rebuild( p_root, true );
CONNECT( THEMIM->getIM(), metaChanged( input_item_t *),
this, processInputItemUpdate( input_item_t *) );
CONNECT( THEMIM, inputChanged( input_thread_t * ),
void PLModel::rebuild()
{
- rebuild( NULL );
+ rebuild( NULL, false );
}
-void PLModel::rebuild( playlist_item_t *p_root )
+void PLModel::rebuild( playlist_item_t *p_root, bool b_first )
{
playlist_item_t* p_item;
- /* Remove callbacks before locking to avoid deadlocks */
- delCallbacks();
+ /* Remove callbacks before locking to avoid deadlocks
+ The first time the callbacks are not present so
+ don't try to delete them */
+ if( !b_first )
+ delCallbacks();
+
/* Invalidate cache */
i_cached_id = i_cached_input_id = -1;
void sort( int column, Qt::SortOrder order );
void sort( int i_root_id, int column, Qt::SortOrder order );
void removeItem( int );
- void rebuild(); void rebuild( playlist_item_t * );
+ void rebuild(); void rebuild( playlist_item_t *, bool b_first = false );
private: