mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 11:30:45 -05:00
[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:
parent
b2fbc2c95c
commit
41bb885486
@ -333,7 +333,7 @@ clutter_list_model_iter_next (ClutterModelIter *iter)
|
|||||||
row += 1;
|
row += 1;
|
||||||
|
|
||||||
/* update the iterator and return it */
|
/* 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;
|
iter_default->seq_iter = filter_next;
|
||||||
|
|
||||||
return CLUTTER_MODEL_ITER (iter_default);
|
return CLUTTER_MODEL_ITER (iter_default);
|
||||||
@ -376,7 +376,7 @@ clutter_list_model_iter_prev (ClutterModelIter *iter)
|
|||||||
row -= 1;
|
row -= 1;
|
||||||
|
|
||||||
/* update the iterator and return it */
|
/* 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;
|
iter_default->seq_iter = filter_prev;
|
||||||
|
|
||||||
return CLUTTER_MODEL_ITER (iter_default);
|
return CLUTTER_MODEL_ITER (iter_default);
|
||||||
|
@ -19,6 +19,9 @@ void clutter_model_set_column_name (ClutterModel *model,
|
|||||||
gint column,
|
gint column,
|
||||||
const gchar *name);
|
const gchar *name);
|
||||||
|
|
||||||
|
void clutter_model_iter_set_row (ClutterModelIter *iter,
|
||||||
|
guint row);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_MODEL_PRIVATE_H__ */
|
#endif /* __CLUTTER_MODEL_PRIVATE_H__ */
|
||||||
|
@ -441,6 +441,8 @@ clutter_model_check_type (GType gtype)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_model_resort:
|
* clutter_model_resort:
|
||||||
* @model: a #ClutterModel
|
* @model: a #ClutterModel
|
||||||
@ -1509,6 +1511,14 @@ clutter_model_iter_real_get_row (ClutterModelIter *iter)
|
|||||||
return iter->priv->row;
|
return iter->priv->row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* private function */
|
||||||
|
void
|
||||||
|
clutter_model_iter_set_row (ClutterModelIter *iter,
|
||||||
|
guint row)
|
||||||
|
{
|
||||||
|
iter->priv->row = row;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_model_iter_get_value_unimplemented (ClutterModelIter *iter,
|
clutter_model_iter_get_value_unimplemented (ClutterModelIter *iter,
|
||||||
guint column,
|
guint column,
|
||||||
|
Loading…
Reference in New Issue
Block a user