← Back to team overview

gtg-contributors team mailing list archive

Multiple parents

 

Hello people,

I finally solved one of the last important regression due to my
refactoring : multiple parents support.

In order to gain speed and to write good code, my refactorization was
centered around being as close as possible to the GTK level itself.

That's where I discovered that GTK was so 20th century.

1) In a GTK TreeView, if you parent is hidden by a filter, all the
children are also hidden, regardless of what the filter think about
them.

2) In a GTK TreeView, each node exists only once and has one parent. It
means that there's a node/path direct relationship. This is not the case
in GTG as a node can have multiple paths.


To bypass 1), I started FilteredTree and FiltersBank. This was huge work
(and I was expecting it to work out of the box at first… Innocence…)

The good things is that now, they are starting to work fairly well.

So I've attacked 2). The first good news is that I was able, with a few
trick, to implement Multiple parent support without any major change.

This is rev. 762.

With rev. 762, everything seems to work fine. But, in theory, multiple
parents support is still incomplete are there were a few places were we
randomly choose a parent in the list if many. (I was not able to find
any usecase where it was visible for the user)

Rev. 763 introduces the final touch by making our FilteredTree
completely aware of multiple parents. The trick I used was to create a
new type, TaskIter (in fact a (node,path) tuple) in the TaskTree.


It works well but, sometimes, the following error is displayed :

/home/ploum/gtg/GTG/taskbrowser/browser.py:927: GtkWarning:
gtk_tree_model_sort_build_level: assertion `length > 0' failed
  self.ctask_tv.set_model(ctask_modelsort)


This error was not appearing in rev.762 and, AFAIK, does not cause any
visible problem.

But, as you can understand, I want to get rid of it.

So any help is warmly welcome on this, I need to sleep a bit :-)


Cheers,

Lionel