diff options
author | Leandro Pereira <leandro@hardinfo.org> | 2012-01-26 22:14:43 -0200 |
---|---|---|
committer | Leandro Pereira <leandro@hardinfo.org> | 2012-01-26 22:14:43 -0200 |
commit | d3b9aa19f04e6be78afb8497e7808a3d42042bf2 (patch) | |
tree | 340e9be8f863e1ad29e1da91cd87a66409d6f706 /modules/devices/inputdevices.c | |
parent | d9e242117b7a73dd3057af25956027a361f7999f (diff) |
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.
Diffstat (limited to 'modules/devices/inputdevices.c')
-rw-r--r-- | modules/devices/inputdevices.c | 11 |
1 files changed, 3 insertions, 8 deletions
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); |