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