mirror of
https://github.com/brl/mutter.git
synced 2025-02-04 07:34:09 +00:00
01d172293c
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.