void PLModel::processInputItemUpdate( input_thread_t *p_input )
{
if( !p_input ) return;
- processInputItemUpdate( input_GetItem( p_input ) );
if( p_input && !( p_input->b_dead || !vlc_object_alive( p_input ) ) )
{
PLItem *item = findByInput( rootItem, input_GetItem( p_input )->i_id );
{
currentItem = NULL;
}
+ processInputItemUpdate( input_GetItem( p_input ) );
}
+
void PLModel::processInputItemUpdate( input_item_t *p_item )
{
if( !p_item || p_item->i_id <= 0 ) return;
{
playlist_item_t *p_item = NULL;
PLItem *newItem = NULL;
+ input_thread_t *currentInputThread;
PLItem *nodeItem = findById( rootItem, i_parent );
if( !nodeItem ) return;
newItem = new PLItem( p_item, nodeItem );
PL_UNLOCK;
+ currentInputThread = THEMIM->getInput();
+ if( currentInputThread &&
+ newItem->p_input == input_GetItem( currentInputThread ) )
+ currentItem = newItem;
+
beginInsertRows( index( nodeItem, 0 ), nodeItem->childCount(), nodeItem->childCount() );
nodeItem->appendChild( newItem );
endInsertRows();
- updateTreeItem( newItem );
+
+ if( currentItem == newItem )
+ emit currentChanged( index( newItem, 0 ) );
+
return;
end:
PL_UNLOCK;