← Back to team overview

gtg-contributors team mailing list archive

Refactoring progress

 

Hello,

I've progressed quite a lot in my refactoring branch.

I've finally removed the gtk.TreeModelFilter. The current stack is then
the following :


Gtk.TreeView -> Gtk.TreeModelSort -> TaskTreeMdel -> FilteredTree -> Tree


It looks like my FilteredTree is working because if I put the
TaskTreeModel directly in the TreeView, everything is working fine.
(except, of course, that you don't have the sorting feature).


What is really bugging me is that the TreeModelSort seeems to break
everything and I don't understand. First, at start, the TreeView stays
empty. (but the TreeModelSort structure is fine and match the one in the
Tree).

As soon as you apply a filter, the structure in the TreeModelSort start to
become crazy (nodes are duplicated). The treeview is also crazy and display
only one or two nodes, I don't know why. Those issue are maybe not related
but I would first investigate why the treeview starts empty ! (I've no
idea, it happens since I removed the TreeModelFilter).

If you want to try it out, be aware that FilteredTree is currently a mess
(I know, I will clean it as soon as it works).

You will see, printed in the console, at each filter apply, the internal
state of the tree in FilteredTree. I didn't saw any bug in it.

The workview, for example, returns:
######### Starting refilter
## The tree:
4@1
1@1
5@1
2@1
3@1
### end of tree

You will also see those lines :

%%% 1@1 is at (3,) ((1,) in tm)(browser.py 1879)

It means that the node 1@1 has path (1,) in TasktreeModel  and path (3,)
in the TreeModelSort. What is awkward is that nodes are refered multiple
times in the treemodelsort !  And, more awkward, it's not even that that is
displayed in the treeview.

It probably means a bug in our TasktreeModel or that the TreeModelSort
receives wrong signals. I don't know.


Feedback is welcome.


Cheers, 

Lionel