Merged "treemodel-fix" branch



Hi all,

In May of this year, I announced I would be fixing the handling of
GtkTreeModel:row-deleted in GtkTreeModelSort and GtkTreeModelFilter
together with bringing more parts of this code under unit test and
fixing/reviewing some bugs[1].  Three months later, I seem to be
finally done.  The work has been carried out in a local treemodel-fix
branch, which I just merged into master.  If no big regressions turn
up in the coming 1 to 2 months, I will consider merging this into 2-24
as well.  Unless there are objections to that of course.

So what has been done exactly?  This is easiest to grasp in categories:

Unit testing
------------
- All GtkTreeModel.* unit tests have been put into a single binary
(named treemodel).
- Many unit test clean ups, improvements and additions in order to be
able to refactor parts of the code.
- Addition of "GtkTreeModelRefCount" to the gtk/tests/ directory to
help with unit testing model reference counting. GtkTreeModelRefCount
is not available in the public API nor is it intended to be in the
future.
- The reference counting mechanisms of GtkTreeModelSort and
GtkTreeModelFilter are now unit tested.

Performance
-----------
- Bug 611922 - gtk_tree_model_sort_ref_node() is too slow
  This affected tree models with a deep hierarchy which were wrapped
in a GtkTreeModelSort.
- Bug 616871 - GtkTreeModelFilter wasting CPU in g_array_remove_index()
  Xavier Claessens provided a patch to replace the usage of GArray in
GtkTreeModelFilter with GSequence.  This has greatly increased the
performance of the filter model, especially in cases where many rows
are being removed/added (e.g. live filtering views).
- A similar patch was written and applied to GtkTreeModelSort.

Misc.
-----
- Reference counting in GtkTreeModelFilter has been reworked to
function properly.  Before, unused levels were never released from the
cache, because the implementation was flawed.
- Both GtkTreeModelSort and GtkTreeModelFilter now emit row-deleted
*after* removing the node from their internal data structures.
Furthermore, both models have been fixed to never unref an already
deleted node.
- Various large functions in GtkTreeModelFilter have been factored
into smaller ones.  Code duplication has been reduced.
- Bug 621076 - GtkTreeModelFilter does not emit all signals in some cases

Documentation
-------------
- General documentation has been added on the reference counting
methods of GtkTreeModel and rules that should be taken into account
when these are used. See [2].
- Also, I wrote extensive documentation about the internals of
GtkTreeModelSort [3] and GtkTreeModelFilter [4].
- In the public documentation for GtkTreeModelFilter, a section was
added about limitations that apply to visible functions [5].


Finally, I would like to thank the following people for their
contributions in the form of test cases, notes, analyses and patches:

  Xavier Claessens
  Alberto Garcia
  Federico Mena-Quintero


In the case I introduced new bugs (hopefully not ...) or if the newly
written documentation is not clear in some places, please file a bug
or send me mail so it can be fixed. I will also blog about this merge,
which will hopefully result in some more testing of the changes.


regards,

-kris.


[1] http://mail.gnome.org/archives/gtk-devel-list/2011-May/msg00036.html
[2] http://git.gnome.org/browse/gtk+/tree/gtk/gtktreemodel.c#n200
[3] http://git.gnome.org/browse/gtk+/tree/gtk/gtktreemodelsort.c#n140
[4] http://git.gnome.org/browse/gtk+/tree/gtk/gtktreemodelfilter.c#n106
[5] http://git.gnome.org/browse/gtk+/tree/gtk/gtktreemodelfilter.c#n60


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]