[evolution/wip/gsettings: 21/29] Use a GPtrArray instead of GArray to build the array string to use for g_settings_set_strv



commit 805d8c25ac6c8f58c8e17f3b89fa50f17cfdf27b
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Thu Oct 13 16:18:42 2011 +0200

    Use a GPtrArray instead of GArray to build the array string to use for g_settings_set_strv

 calendar/gui/alarm-notify/config-data.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/calendar/gui/alarm-notify/config-data.c b/calendar/gui/alarm-notify/config-data.c
index 3275c4d..b9f2be4 100644
--- a/calendar/gui/alarm-notify/config-data.c
+++ b/calendar/gui/alarm-notify/config-data.c
@@ -341,18 +341,18 @@ config_data_save_blessed_program (const gchar *program)
 {
 	gchar **list;
 	gint i;
-	GArray *array = g_array_new (TRUE, FALSE, sizeof (gchar *));
+	GPtrArray *array = g_ptr_array_new ();
 
 	list = g_settings_get_strv (calendar_settings, "notify-programs");
 	for (i = 0; i < g_strv_length (list); i++)
-		g_array_append_val (array, list[i]);
+		g_ptr_array_add (array, list[i]);
 
-	g_array_append_val (array, program);
-	g_array_append_val (array, NULL);
-	g_settings_set_strv (calendar_settings, "notify-programs", (const gchar *const *) array->data);
+	g_ptr_array_add (array, program);
+	g_ptr_array_add (array, NULL);
+	g_settings_set_strv (calendar_settings, "notify-programs", (const gchar *const *) array->pdata);
 
 	g_strfreev (list);
-	g_array_free (array, TRUE);
+	g_ptr_array_free (array, TRUE);
 }
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]