diff options
author | Ted Gould <ted@gould.cx> | 2009-12-09 19:57:24 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2009-12-09 19:57:24 -0600 |
commit | 79f1234edad909f457e9571a05d90c7343c8acd6 (patch) | |
tree | 969a2448f0495fe18fd0bcec21a956a00ab9514d /libdbusmenu-glib | |
parent | bb0bab7e81c1ca6e5e4a6ddb33a124ae4e6e59ab (diff) | |
download | libdbusmenu-79f1234edad909f457e9571a05d90c7343c8acd6.tar.gz libdbusmenu-79f1234edad909f457e9571a05d90c7343c8acd6.tar.bz2 libdbusmenu-79f1234edad909f457e9571a05d90c7343c8acd6.zip |
Translating the table of string properties over to a hash of values.
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/server.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index f61b0fb..73c21e2 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -442,6 +442,16 @@ _dbusmenu_server_get_property (DbusmenuServer * server, guint id, gchar * proper return TRUE; } +static void +value_table (gpointer pkey, gpointer pvalue, gpointer phash) +{ + GValue * value = g_new0(GValue, 1); + g_value_init(value, G_TYPE_STRING); + g_value_set_string(value, (gchar *)pvalue); + g_hash_table_insert((GHashTable *)phash, g_strdup((gchar *)pkey), value); + return; +} + static gboolean _dbusmenu_server_get_properties (DbusmenuServer * server, guint id, GPtrArray * properties, GHashTable ** dict, GError ** error) { @@ -461,6 +471,12 @@ _dbusmenu_server_get_properties (DbusmenuServer * server, guint id, GPtrArray * *dict = dbusmenu_menuitem_properties_copy(mi); + GHashTable * newtable = g_hash_table_new(g_str_hash, g_str_equal); + g_hash_table_foreach(*dict, value_table, newtable); + g_hash_table_destroy(*dict); + + *dict = newtable; + return TRUE; } |