Commit 37f2e008 authored by Ilkka Ollakka's avatar Ilkka Ollakka

qt4: remove basicly empty PLItem::update and refactor playlist_model UpdateTreeItem-methods

parent 02ff4f49
......@@ -102,10 +102,3 @@ int PLItem::row() const
return 0;
}
/* update the PL Item, get the good names and so on */
void PLItem::update( playlist_item_t *p_item )
{
assert( p_item->p_input == p_input);
}
......@@ -59,8 +59,6 @@ public:
PLItem *parent() { return parentItem; };
void update( playlist_item_t * );
protected:
QList<PLItem*> children;
int i_id;
......
......@@ -723,7 +723,7 @@ void PLModel::ProcessItemAppend( const playlist_add_t *p_add )
nodeItem->appendChild( newItem );
emit endInsertRows();
emit layoutChanged();
UpdateTreeItem( p_item, newItem, true );
UpdateTreeItem( newItem, true );
end:
PL_UNLOCK;
return;
......@@ -772,8 +772,7 @@ void PLModel::rebuild( playlist_item_t *p_root )
p_item->p_input->i_id );
if( currentItem )
{
UpdateTreeItem( p_item, currentItem,
true, false );
UpdateTreeItem( currentItem, true, false );
}
}
else
......@@ -816,19 +815,11 @@ void PLModel::UpdateNodeChildren( playlist_item_t *p_node, PLItem *root )
void PLModel::UpdateTreeItem( PLItem *item, bool signal, bool force )
{
playlist_item_t *p_item = playlist_ItemGetById( p_playlist, item->i_id );
UpdateTreeItem( p_item, item, signal, force );
}
/* This function must be entered WITH the playlist lock */
void PLModel::UpdateTreeItem( playlist_item_t *p_item, PLItem *item,
bool signal, bool force )
{
if ( !p_item )
return;
if( !force && i_depth == DEPTH_SEL && p_item->p_parent &&
p_item->p_parent->i_id != rootItem->i_id )
return;
item->update( p_item );
if( signal )
emit dataChanged( index( item, 0 ) , index( item, columnCount( QModelIndex() ) ) );
}
......
......@@ -146,7 +146,6 @@ private:
void ProcessItemAppend( const playlist_add_t *p_add );
void UpdateTreeItem( PLItem *, bool, bool force = false );
void UpdateTreeItem( playlist_item_t *, PLItem *, bool, bool forc = false );
void UpdateNodeChildren( PLItem * );
void UpdateNodeChildren( playlist_item_t *, PLItem * );
......
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