← Back to team overview

gtg-contributors team mailing list archive

Re: Rename tag branch

 

On Sun, 30 May 2010 18:30:03 +0200, Bertrand Rousseau
<bertrand.rousseau@xxxxxxxxx> wrote:
> On Sun, May 30, 2010 at 6:06 PM, Lionel Dricot <ploum@xxxxxxxxx> wrote:
>> Dear all contributors,
>>
>> I've been working on a branch to enable tag renaming. It ended by
>> refactorizing most of the tagtree and the way it is handled in our UI.
>>
>>
>> I think that this refactorization is really interesting as a lot of
code
>> have been removed and that the tagtreemodel have been highly
simplified.
>>
>>
>> I would like you to test out that branch :
>> https://code.edge.launchpad.net/~gtg/gtg/rename-tag
>>
>>
>> Currently, I've only one remaining bug before it could be pushed : when
>> you modify a tag in a task, sometimes, the old tag is still displayed
>> (with number 0) or the new tag is doubled.
>>
>> As it is always for the last line of the tag list, I believe that it's
>> only an "artifact" because the tree is drawn only for the existing
tags.
>> So, if you had 7 tags and redrawn 6, the 7th is still displayed as a
>> "ghost".
>>
>> This sucks, this is so typical of Gtktreeview.
> 
> Yep it generally means that some signals are not sent, or sent too
> late, which means that the GtkTree holds obsolete node references. The
> only way to solve this is to track the row_added(), row_inserted() and
> row_deleted() signals when you modify the underlying data structure.

What is really funny is that the TreeModel by itself is fine.

As you know, we have a layer of TreeModel -> TreeModelFilter ->
TreeModelSort (Sidenote : I've rarely seen an architecture sucking so much
because each TreeModel have a different API)

If we remove the TreeModelSort in my branch, we don't see any difference.
It looks like this one is useless or not working properly.

If we remove the TreeModelFilter (thus displaying the bare TreeModel),
everything is works fine ! There are no "ghost" or anything. Of course,
tags with 0 tasks are displayed (beacuse we removed the filter).

This lead me to the question : if the TreeModel is fine, how the hell can
we have some tags remaining in the TreeModelFilter ? How can we force a
refresh of the TreeModelFilter ?


Lionel





References