From d3b9aa19f04e6be78afb8497e7808a3d42042bf2 Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Thu, 26 Jan 2012 22:14:43 -0200 Subject: Better manage moreinfo hashes Have only one for the whole program and use per-module namespaces/prefixes so that each module can clear its own information easily. --- modules/devices/inputdevices.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'modules/devices/inputdevices.c') diff --git a/modules/devices/inputdevices.c b/modules/devices/inputdevices.c index 31f51fbb..5ff415cf 100644 --- a/modules/devices/inputdevices.c +++ b/modules/devices/inputdevices.c @@ -23,12 +23,6 @@ gchar *input_icons = NULL; -static gboolean -remove_input_devices(gpointer key, gpointer value, gpointer data) -{ - return g_str_has_prefix(key, "INP"); -} - static struct { char *name; char *icon; @@ -54,7 +48,7 @@ __scan_input_devices(void) return; if (input_list) { - g_hash_table_foreach_remove(moreinfo, remove_input_devices, NULL); + moreinfo_del_with_prefix("DEV:INP"); g_free(input_list); g_free(input_icons); } @@ -133,7 +127,8 @@ __scan_input_devices(void) strhash); } - g_hash_table_insert(moreinfo, tmp, strhash); + moreinfo_add_with_prefix("DEV", tmp, strhash); + g_free(tmp); g_free(phys); g_free(name); -- cgit v1.2.3