diff options
author | Emmanuele Bassi <ebassi@openedhand.com> | 2008-06-01 19:57:42 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@openedhand.com> | 2008-06-01 19:57:42 +0000 |
commit | 3ab2ff9846ccdf0be7ace46a4ea90dd59fc366c4 (patch) | |
tree | 87f28415bb09cb4de09cef69ea3fa74a28d723f8 /clutter/clutter-model.c | |
parent | a4e4faff1d4c8546815926b8483b988a8c7cadb8 (diff) | |
download | clutter-3ab2ff9846ccdf0be7ace46a4ea90dd59fc366c4.tar.gz |
2008-06-01 Emmanuele Bassi <ebassi@openedhand.com>
Merge from clutter-0-6:
* clutter/clutter-model.c:
(clutter_model_iter_set_internal_valist): Add an internal function
wrapping ClutterModelIter::set_value that does not emit the
::row-changed signal. Emitting this signal before the ::row-added
one is wrong: a row cannot change before being inserted.
(clutter_model_append), (clutter_model_prepend),
(clutter_model_insert): Use the non-signal emitting variant of
clutter_model_iter_set_valist().
(clutter_model_iter_set_valist): Use the internal version and emit
the ::row-changed signal at the end.
Diffstat (limited to 'clutter/clutter-model.c')
-rw-r--r-- | clutter/clutter-model.c | 55 |
1 files changed, 37 insertions, 18 deletions
diff --git a/clutter/clutter-model.c b/clutter/clutter-model.c index 568e840b9..ecfe9d6ce 100644 --- a/clutter/clutter-model.c +++ b/clutter/clutter-model.c @@ -736,6 +736,10 @@ clutter_model_appendv (ClutterModel *model, g_object_unref (iter); } +/* forward declaration */ +static void clutter_model_iter_set_internal_valist (ClutterModelIter *iter, + va_list args); + /** * clutter_model_append: * @model: a #ClutterModel @@ -769,8 +773,9 @@ clutter_model_append (ClutterModel *model, iter = CLUTTER_MODEL_GET_CLASS (model)->insert_row (model, -1); g_assert (CLUTTER_IS_MODEL_ITER (iter)); + /* do not emit the ::row-changed signal */ va_start (args, model); - clutter_model_iter_set_valist (iter, args); + clutter_model_iter_set_internal_valist (iter, args); va_end (args); g_signal_emit (model, model_signals[ROW_ADDED], 0, iter); @@ -859,7 +864,7 @@ clutter_model_prepend (ClutterModel *model, g_assert (CLUTTER_IS_MODEL_ITER (iter)); va_start (args, model); - clutter_model_iter_set_valist (iter, args); + clutter_model_iter_set_internal_valist (iter, args); va_end (args); g_signal_emit (model, model_signals[ROW_ADDED], 0, iter); @@ -906,7 +911,7 @@ clutter_model_insert (ClutterModel *model, * passed columns matches the model sorting column index */ va_start (args, row); - clutter_model_iter_set_valist (iter, args); + clutter_model_iter_set_internal_valist (iter, args); va_end (args); g_signal_emit (model, model_signals[ROW_ADDED], 0, iter); @@ -1599,27 +1604,15 @@ clutter_model_iter_init (ClutterModelIter *self) * Public functions */ -/** - * clutter_model_iter_set_valist: - * @iter: a #ClutterModelIter - * @args: va_list of column/value pairs, terminiated by -1 - * - * See clutter_model_iter_set(); this version takes a va_list for language - * bindings. - * - * Since: 0.6 - */ -void -clutter_model_iter_set_valist (ClutterModelIter *iter, - va_list args) +static void +clutter_model_iter_set_internal_valist (ClutterModelIter *iter, + va_list args) { ClutterModel *model; ClutterModelIterPrivate *priv; guint column = 0; gboolean sort = FALSE; - g_return_if_fail (CLUTTER_IS_MODEL_ITER (iter)); - priv = iter->priv; model = priv->model; g_assert (CLUTTER_IS_MODEL (model)); @@ -1666,6 +1659,32 @@ clutter_model_iter_set_valist (ClutterModelIter *iter, priv->ignore_sort = FALSE; if (sort) clutter_model_resort (model); +} + +/** + * clutter_model_iter_set_valist: + * @iter: a #ClutterModelIter + * @args: va_list of column/value pairs, terminiated by -1 + * + * See clutter_model_iter_set(); this version takes a va_list for language + * bindings. + * + * Since: 0.6 + */ +void +clutter_model_iter_set_valist (ClutterModelIter *iter, + va_list args) +{ + ClutterModelIterPrivate *priv; + ClutterModel *model; + + g_return_if_fail (CLUTTER_IS_MODEL_ITER (iter)); + + clutter_model_iter_set_internal_valist (iter, args); + + priv = iter->priv; + model = priv->model; + g_assert (CLUTTER_IS_MODEL (model)); g_signal_emit (model, model_signals[ROW_CHANGED], 0, iter); } |