[vlc-devel] commit: qt4: rebuild tree on updateTreeItem (Ilkka Ollakka )

Jakob Leben jakob.leben at gmail.com
Mon Oct 26 10:21:33 CET 2009


On Sun, Oct 25, 2009 at 1:36 PM, git version control <git at videolan.org>wrote:

> diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp
> b/modules/gui/qt4/components/playlist/playlist_model.cpp
> index a61434c..6f762bf 100644
> --- a/modules/gui/qt4/components/playlist/playlist_model.cpp
> +++ b/modules/gui/qt4/components/playlist/playlist_model.cpp
> @@ -803,7 +803,8 @@ void PLModel::updateChildren( playlist_item_t *p_node,
> PLItem *root )
>  void PLModel::updateTreeItem( PLItem *item )
>  {
>     if( !item ) return;
> -    emit dataChanged( index( item, 0 ) , index( item, columnCount(
> QModelIndex() ) ) );
> +    rebuild();
> +    //emit dataChanged( index( item, 0 ) , index( item, columnCount(
> QModelIndex() ) ) );
>  }
>

Hi!

In my opinion, this is a rather crude way to fix the problem. It is a
trivial fact that rebuilding the tree fixes the problem. You could just as
well throw around rebuilds all over the code and any de-synchronization with
core playlist will always be silently hidden. However, my work on the qt4
playlist was in large part directed towards minimizing rebuilds to enhance
performance.

The real reason for the duplicate-items-bug must be in that the same item
gets inserted twice without one of the copies being removed in between.
Either a remove should happen in between the insertions, or the insertion
shouldnt happen twice at all.

I'll take a look at the issue some time soon.

Cheers, Jakob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20091026/d6b5b6ba/attachment.html>


More information about the vlc-devel mailing list