A bunch of private symbols have escaped into the SO; let's rectify this
situation by using the '_' private prefix, or making them static as they
should have been.
GValueArray is on its way to deprecation in GLib; as far as the
ListModel class is concerned, a plain C array of GValue is a perfectly
suitable replacement for the GValueArray usage. It actually is an
improvement, given that it's going to take less memory.
Currently clutter_list_model_get_iter_at_row() always returns an
iterator to the last non-filtered row when asking for row [1-N].
Patch makes the function return an iterator to the Nth non-filtered
row or NULL.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2460
Since using addresses that might change is something that finally
the FSF acknowledge as a plausible scenario (after changing address
twice), the license blurb in the source files should use the URI
for getting the license in case the library did not come with it.
Not that URIs cannot possibly change, but at least it's easier to
set up a redirection at the same place.
As a side note: this commit closes the oldes bug in Clutter's bug
report tool.
http://bugzilla.openedhand.com/show_bug.cgi?id=521
If the filter means that the there should be no rows left in the model,
clutter_model_get_iter_at_row (model, 0) should return NULL.
Howevever the currene implementation misbehaves and returns a bad iterator.
This change resolves the issue by tracking if we actually found any
non-filtered rows in our pass through the sequence.
OH Bugzilla: 1591
When calling clutter_model_iter_next () / clutter_model_iter_prev () we need
to update the row for the iterator. In order to improve the peformance of
iterating this change adds a private row mutator and switches ClutterListModel
to use it.
In order to carry out various comparisons for e.g. identifying the first
iterator in the model we need a ClutterModelIter. This change switches from
creating a new iterator each time to reusing an existing iterator.
Currently ClutterModel::get_iter_at_row() ignores whether we have
a filter in place. This also extends to the get_n_rows() method.
The more consistent, more intuitive and surely more correct way to
handle a Model with a filter in place is to take into account the
presence of the filter itself -- that is:
- get_n_rows() should take into account the filter and return the
number of *filtered* rows
- get_iter_at_row() should also take the filter into account and
get the first non-filtered row
These two changes make the ClutterModel with a filter function
behave like a subset of the original Model without a filter in
place.
For instance, given a model with three rows:
- [row 0] <does not match filter>
- [row 1] <matches filter>
- [row 2] <matches filter>
- [row 3] <does not match filter>
The get_n_rows() method will return "2", since only two rows will
match the filter; the get_first_iter() method will ask for the
zero-eth row, which will return an iterator pointing to the contents
of row 1 (but the :row property of the iterator will be set to 0);
the get_last_iter() method will ask for the last row, which will
return an iterator pointing to the contents of row 2 (but the :row
property of the iterator will be set to 1).
This changes will hopefully make the Model API more consistent
in its usage whether there is a filter in place or not.
ClutterListModel has been added as a terminal class in case we
decided to change API or implementation.
Apparently, it's a lot more resilient than we expected -- or far
too few are using it and reporting bugs. Once common issue, though,
is that it cannot be subclassed, hence it's fairly limited in its
usage.
In the hope that more developers will start using it, here's a
patch that makes ListModel a fully subclassable object.
May whatever god you believe in have mercy on your eventual soul.
* clutter/clutter-model.[ch]: Add a ::copy() virtual function
for copying iterators.
* clutter/clutter-list-model.c:
(clutter_list_model_iter_copy),
(clutter_list_model_iter_class_init): Implement the ::copy()
function inside the ListModel iterator subclass.
* clutter/Makefile.am:
* clutter/clutter.h:
* clutter/clutter-list-model.[ch]: Complete the ClutterModelDefault
to ClutterListModel rename by renaming the source files
2008-01-09 14:40:31 +00:00
Renamed from clutter/clutter-model-default.c (Browse further)