[Xfce4-commits] r26807 - xfconf/trunk/common
Brian Tarricone
kelnos at xfce.org
Wed Apr 9 08:53:02 CEST 2008
Author: kelnos
Date: 2008-04-09 06:53:02 +0000 (Wed, 09 Apr 2008)
New Revision: 26807
Modified:
xfconf/trunk/common/xfconf-gvaluefuncs.c
Log:
convert string list (as semicolon-delim list) into GValue properly
Modified: xfconf/trunk/common/xfconf-gvaluefuncs.c
===================================================================
--- xfconf/trunk/common/xfconf-gvaluefuncs.c 2008-04-09 06:22:20 UTC (rev 26806)
+++ xfconf/trunk/common/xfconf-gvaluefuncs.c 2008-04-09 06:53:02 UTC (rev 26807)
@@ -164,9 +164,22 @@
HANDLE_INT(G_MINSHORT, G_MAXSHORT, xfconf_g_value_set_int16);
return TRUE;
} else if(XFCONF_TYPE_G_VALUE_ARRAY == G_VALUE_TYPE(value)) {
- GPtrArray *arr = g_ptr_array_sized_new(1);
- g_ptr_array_add(arr, g_strdup(str));
+ gchar **strings = g_strsplit_set(str, ";", -1);
+ gint i = 0;
+ GPtrArray *arr;
+
+ if(!strings)
+ return FALSE;
+
+ while(strings[i])
+ ++i;
+
+ arr = g_ptr_array_sized_new(i);
+ for(i = 0; strings[i]; ++i)
+ g_ptr_array_add(arr, strings[i]);
g_value_take_boxed(value, arr);
+
+ g_free(strings);
return TRUE;
}
return FALSE;
More information about the Xfce4-commits
mailing list