From f3a5d49434e761d282223ec34e398f5372558b34 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Thu, 8 Mar 2012 00:44:39 +0100 Subject: [PATCH] Use _katze_array_update consistently internally --- katze/katze-array.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/katze/katze-array.c b/katze/katze-array.c index 7e2e2e19..6d11b5ae 100644 --- a/katze/katze-array.c +++ b/katze/katze-array.c @@ -74,6 +74,13 @@ GList* kalistglobal; static void katze_array_finalize (GObject* object); +static void +_katze_array_update (KatzeArray* array) +{ + g_object_set_data (G_OBJECT (array), "last-update", + GINT_TO_POINTER (time (NULL))); +} + static void _katze_array_add_item (KatzeArray* array, gpointer item) @@ -84,8 +91,7 @@ _katze_array_add_item (KatzeArray* array, katze_item_set_parent (item, array); array->items = g_list_append (array->items, item); - g_object_set_data (G_OBJECT (array), "last-update", - GINT_TO_POINTER (time (NULL))); + _katze_array_update (array); } static void @@ -97,8 +103,7 @@ _katze_array_remove_item (KatzeArray* array, if (KATZE_IS_ITEM (item)) katze_item_set_parent (item, NULL); g_object_unref (item); - g_object_set_data (G_OBJECT (array), "last-update", - GINT_TO_POINTER (time (NULL))); + _katze_array_update (array); } static void @@ -108,8 +113,7 @@ _katze_array_move_item (KatzeArray* array, { array->items = g_list_remove (array->items, item); array->items = g_list_insert (array->items, item, position); - g_object_set_data (G_OBJECT (array), "last-update", - GINT_TO_POINTER (time (NULL))); + _katze_array_update (array); } static void @@ -121,15 +125,7 @@ _katze_array_clear (KatzeArray* array) g_signal_emit (array, signals[REMOVE_ITEM], 0, item); g_list_free (array->items); array->items = NULL; - g_object_set_data (G_OBJECT (array), "last-update", - GINT_TO_POINTER (time (NULL))); -} - -static void -_katze_array_update (KatzeArray* array) -{ - g_object_set_data (G_OBJECT (array), "last-update", - GINT_TO_POINTER (time (NULL))); + _katze_array_update (array); } static void -- 2.39.5