Index: xfconf/xfconf-channel.c =================================================================== --- xfconf/xfconf-channel.c (revision 27392) +++ xfconf/xfconf-channel.c (working copy) @@ -141,7 +141,7 @@ * G_VALUE_TYPE(value) == G_TYPE_INVALID * **/ - signals[SIG_PROPERTY_CHANGED] = g_signal_new("property-changed", + signals[SIG_PROPERTY_CHANGED] = g_signal_new(I_("property-changed"), XFCONF_TYPE_CHANNEL, G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, Index: xfconf/xfconf-binding.c =================================================================== --- xfconf/xfconf-binding.c (revision 27392) +++ xfconf/xfconf-binding.c (working copy) @@ -27,6 +27,7 @@ #include "xfconf-binding.h" #include "xfconf-alias.h" +#include "xfconf-common-private.h" typedef struct { @@ -77,7 +78,7 @@ g_free(binding->xfconf_property); g_free(binding->object_property); - g_free(binding); + _xfconf_slice_free(XfconfGBinding, binding); } static void @@ -94,14 +95,14 @@ GObject *where_the_object_was) { XfconfGBinding *binding = data; - GList *bindings = g_object_steal_data(G_OBJECT(binding->channel), - "--xfconf-g-bindings"); + GSList *bindings = g_object_steal_data(G_OBJECT(binding->channel), + I_("--xfconf-g-bindings")); - bindings = g_list_remove(bindings, binding); + bindings = g_slist_remove(bindings, binding); if(bindings) { g_object_set_data_full(G_OBJECT(binding->channel), - "--xfconf-g-bindings", - bindings, (GDestroyNotify)g_list_free); + I_("--xfconf-g-bindings"), + bindings, (GDestroyNotify)g_slist_free); } binding->object = NULL; @@ -191,7 +192,7 @@ XfconfGBinding *binding; GParamSpec *pspec; gchar buf[1024]; - GList *bindings; + GSList *bindings; GValue value = { 0, }; g_return_if_fail(XFCONF_IS_CHANNEL(channel) @@ -228,7 +229,7 @@ } - binding = g_new0(XfconfGBinding, 1); + binding = _xfconf_slice_new0(XfconfGBinding); binding->channel = channel; binding->xfconf_property = g_strdup(xfconf_property); binding->xfconf_property_type = xfconf_property_type; @@ -253,13 +254,13 @@ G_CALLBACK(xfconf_g_binding_object_property_changed), binding); - bindings = g_object_get_data(G_OBJECT(channel), "--xfconf-g-bindings"); + bindings = g_object_get_data(G_OBJECT(channel), I_("--xfconf-g-bindings")); if(bindings) - bindings = g_list_append(bindings, binding); + bindings = g_slist_append(bindings, binding); else { - bindings = g_list_append(bindings, binding); - g_object_set_data_full(G_OBJECT(channel), "--xfconf-g-bindings", - bindings, (GDestroyNotify)g_list_free); + bindings = g_slist_append(bindings, binding); + g_object_set_data_full(G_OBJECT(channel), I_("--xfconf-g-bindings"), + bindings, (GDestroyNotify)g_slist_free); } if(xfconf_channel_get_property(channel, xfconf_property, &value)) { @@ -285,9 +286,9 @@ GObject *object, const gchar *object_property) { - GList *bindings = g_object_steal_data(G_OBJECT(channel), - "--xfconf-g-bindings"); - GList *l; + GSList *bindings = g_object_steal_data(G_OBJECT(channel), + I_("--xfconf-g-bindings")); + GSList *l; for(l = bindings; l; l = l->next) { XfconfGBinding *binding = l->data; @@ -296,15 +297,15 @@ && !strcmp(xfconf_property, binding->xfconf_property) && !strcmp(object_property, binding->object_property)) { - bindings = g_list_delete_link(bindings, l); + bindings = g_slist_delete_link(bindings, l); xfconf_g_binding_free(binding); break; } } if(bindings) { - g_object_set_data_full(G_OBJECT(channel), "--xfconf-g-bindings", - bindings, (GDestroyNotify)g_list_free); + g_object_set_data_full(G_OBJECT(channel), I_("--xfconf-g-bindings"), + bindings, (GDestroyNotify)g_slist_free); } } Index: xfconfd/xfconf-backend-perchannel-xml.c =================================================================== --- xfconfd/xfconf-backend-perchannel-xml.c (revision 27392) +++ xfconfd/xfconf-backend-perchannel-xml.c (working copy) @@ -69,7 +69,7 @@ #define CONFIG_DIR_STEM "xfce4/xfconf/" XFCONF_BACKEND_PERCHANNEL_XML_TYPE_ID "/" #define CONFIG_FILE_FMT CONFIG_DIR_STEM "%s.xml" #define CACHE_TIMEOUT (20*60*1000) /* 20 minutes */ -#define WRITE_TIMEOUT (5*1000) /* 5 secionds */ +#define WRITE_TIMEOUT (5) /* 5 seconds */ #define MAX_PROP_PATH (4096) struct _XfconfBackendPerchannelXml @@ -81,7 +81,7 @@ GTree *channels; guint save_id; - GList *dirty_channels; + GSList *dirty_channels; XfconfPropertyChangedFunc prop_changed_func; gpointer prop_changed_data; @@ -519,12 +519,12 @@ { XfconfBackendPerchannelXml *xbpx = XFCONF_BACKEND_PERCHANNEL_XML(backend); gchar *filename; - GList *dirty; + GSList *dirty; - if((dirty = g_list_find_custom(xbpx->dirty_channels, channel, - (GCompareFunc)g_ascii_strcasecmp))) + if((dirty = g_slist_find_custom(xbpx->dirty_channels, channel, + (GCompareFunc)g_ascii_strcasecmp))) { - xbpx->dirty_channels = g_list_remove(xbpx->dirty_channels, dirty); + xbpx->dirty_channels = g_slist_remove(xbpx->dirty_channels, dirty); if(!xbpx->dirty_channels && xbpx->save_id) { g_source_remove(xbpx->save_id); xbpx->save_id = 0; @@ -633,7 +633,7 @@ GError **error) { XfconfBackendPerchannelXml *xbpx = XFCONF_BACKEND_PERCHANNEL_XML(backend); - GList *l; + GSList *l; for(l = xbpx->dirty_channels; l; l = l->next) xfconf_backend_perchannel_xml_flush_channel(xbpx, l->data, error); @@ -732,7 +732,7 @@ parent = xfconf_proptree_add_property(proptree, tmp, NULL, FALSE); } - prop = g_new0(XfconfProperty, 1); + prop = _xfconf_slice_new0(XfconfProperty); prop->name = g_strdup(strrchr(name, '/')+1); if(value) { g_value_init(&prop->value, G_VALUE_TYPE(value)); @@ -813,7 +813,7 @@ g_free(property->name); if(G_IS_VALUE(&property->value)) g_value_unset(&property->value); - g_free(property); + _xfconf_slice_free(XfconfProperty, property); } static gboolean @@ -829,8 +829,8 @@ xfconf_backend_perchannel_xml_schedule_save(XfconfBackendPerchannelXml *xbpx, const gchar *channel) { - if(!g_list_find_custom(xbpx->dirty_channels, channel, - (GCompareFunc)g_ascii_strcasecmp)) + if(!g_slist_find_custom(xbpx->dirty_channels, channel, + (GCompareFunc)g_ascii_strcasecmp)) { gpointer orig_key = NULL, val = NULL; @@ -839,15 +839,21 @@ return; } - xbpx->dirty_channels = g_list_prepend(xbpx->dirty_channels, orig_key); + xbpx->dirty_channels = g_slist_prepend(xbpx->dirty_channels, orig_key); } if(xbpx->save_id) g_source_remove(xbpx->save_id); - xbpx->save_id = g_timeout_add(WRITE_TIMEOUT, +#if GLIB_CHECK_VERSION(2,14,0) + xbpx->save_id = g_timeout_add_seconds(WRITE_TIMEOUT, + xfconf_backend_perchannel_xml_save_timeout, + xbpx); +#else + xbpx->save_id = g_timeout_add(WRITE_TIMEOUT*1000, xfconf_backend_perchannel_xml_save_timeout, xbpx); +#endif } static GNode * @@ -862,7 +868,7 @@ return properties; } - prop = g_new0(XfconfProperty, 1); + prop = _xfconf_slice_new0(XfconfProperty); prop->name = g_strdup("/"); properties = g_node_new(prop); g_tree_insert(xbpx->channels, g_ascii_strdown(channel, -1), properties); @@ -975,7 +981,7 @@ xfconf_proptree_destroy(state->properties); - prop = g_new0(XfconfProperty, 1); + prop = _xfconf_slice_new0(XfconfProperty); prop->name = g_strdup("/"); state->properties = g_node_new(prop); } @@ -1407,7 +1413,7 @@ goto out; } - prop = g_new0(XfconfProperty, 1); + prop = _xfconf_slice_new0(XfconfProperty); prop->name = g_strdup("/"); properties = g_node_new(prop); Index: xfconfd/xfconf-daemon.c =================================================================== --- xfconfd/xfconf-daemon.c (revision 27392) +++ xfconfd/xfconf-daemon.c (working copy) @@ -105,7 +105,7 @@ object_class->finalize = xfconf_daemon_finalize; - signals[SIG_PROPERTY_CHANGED] = g_signal_new("property-changed", + signals[SIG_PROPERTY_CHANGED] = g_signal_new(I_("property-changed"), XFCONF_TYPE_DAEMON, G_SIGNAL_RUN_LAST, 0, @@ -116,7 +116,7 @@ G_TYPE_STRING, G_TYPE_VALUE); - signals[SIG_PROPERTY_REMOVED] = g_signal_new("property-removed", + signals[SIG_PROPERTY_REMOVED] = g_signal_new(I_("property-removed"), XFCONF_TYPE_DAEMON, G_SIGNAL_RUN_LAST, 0, Index: common/xfconf-common-private.h =================================================================== --- common/xfconf-common-private.h (revision 27392) +++ common/xfconf-common-private.h (working copy) @@ -24,4 +24,26 @@ #define XFCONF_TYPE_G_VALUE_ARRAY (dbus_g_type_get_collection("GPtrArray", G_TYPE_VALUE)) +#if GLIB_CHECK_VERSION(2,10,0) +#define _xfconf_slice_alloc(block_size) (g_slice_alloc ((block_size))) +#define _xfconf_slice_alloc0(block_size) (g_slice_alloc0 ((block_size))) +#define _xfconf_slice_free1(block_size, mem_block) G_STMT_START{ g_slice_free1 ((block_size), (mem_block)); }G_STMT_END +#define _xfconf_slice_new(type) (g_slice_new (type)) +#define _xfconf_slice_new0(type) (g_slice_new0 (type)) +#define _xfconf_slice_free(type, ptr) G_STMT_START{ g_slice_free (type, (ptr)); }G_STMT_END +#else +#define _xfconf_slice_alloc(block_size) (g_malloc ((block_size))) +#define _xfconf_slice_alloc0(block_size) (g_malloc0 ((block_size))) +#define _xfconf_slice_free1(block_size, mem_block) G_STMT_START{ g_free ((mem_block)); }G_STMT_END +#define _xfconf_slice_new(type) (g_new (type, 1)) +#define _xfconf_slice_new0(type) (g_new0 (type, 1)) +#define _xfconf_slice_free(type, ptr) G_STMT_START{ g_free ((ptr)); }G_STMT_END +#endif + +#if GLIB_CHECK_VERSION(2,9,0) +#define I_(string) (g_intern_static_string ((string))) +#else +#define I_(string) (string) +#endif + #endif /* __XFCONF_COMMON_PRIVATE_H__ */