1
0
Fork 0

[model] Add a private row mutator to ClutterModelIter

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.
This commit is contained in:
Rob Bradford 2009-05-05 20:15:01 +01:00
parent b2fbc2c95c
commit 41bb885486
3 changed files with 15 additions and 2 deletions

View file

@ -333,7 +333,7 @@ clutter_list_model_iter_next (ClutterModelIter *iter)
row += 1;
/* update the iterator and return it */
g_object_set (G_OBJECT (iter_default), "model", model, "row", row, NULL);
clutter_model_iter_set_row (CLUTTER_MODEL_ITER (iter_default), row);
iter_default->seq_iter = filter_next;
return CLUTTER_MODEL_ITER (iter_default);
@ -376,7 +376,7 @@ clutter_list_model_iter_prev (ClutterModelIter *iter)
row -= 1;
/* update the iterator and return it */
g_object_set (G_OBJECT (iter_default), "model", model, "row", row, NULL);
clutter_model_iter_set_row (CLUTTER_MODEL_ITER (iter_default), row);
iter_default->seq_iter = filter_prev;
return CLUTTER_MODEL_ITER (iter_default);

View file

@ -19,6 +19,9 @@ void clutter_model_set_column_name (ClutterModel *model,
gint column,
const gchar *name);
void clutter_model_iter_set_row (ClutterModelIter *iter,
guint row);
G_END_DECLS
#endif /* __CLUTTER_MODEL_PRIVATE_H__ */

View file

@ -441,6 +441,8 @@ clutter_model_check_type (GType gtype)
return FALSE;
}
/**
* clutter_model_resort:
* @model: a #ClutterModel
@ -1509,6 +1511,14 @@ clutter_model_iter_real_get_row (ClutterModelIter *iter)
return iter->priv->row;
}
/* private function */
void
clutter_model_iter_set_row (ClutterModelIter *iter,
guint row)
{
iter->priv->row = row;
}
static void
clutter_model_iter_get_value_unimplemented (ClutterModelIter *iter,
guint column,