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/computer/modules.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'modules/computer/modules.c') diff --git a/modules/computer/modules.c b/modules/computer/modules.c index 743ba176..dc4c1815 100644 --- a/modules/computer/modules.c +++ b/modules/computer/modules.c @@ -28,12 +28,6 @@ continue; \ } -static gboolean -remove_module_devices(gpointer key, gpointer value, gpointer data) -{ - return g_str_has_prefix(key, "MOD"); -} - GHashTable *_module_hash_table = NULL; void @@ -50,7 +44,7 @@ scan_modules_do(void) g_free(module_list); module_list = NULL; - g_hash_table_foreach_remove(moreinfo, remove_module_devices, NULL); + moreinfo_del_with_prefix("COMP:MOD"); lsmod_path = find_program("lsmod"); lsmod = popen(lsmod_path, "r"); @@ -158,7 +152,8 @@ scan_modules_do(void) g_free(deps); } - g_hash_table_insert(moreinfo, hashkey, strmodule); + moreinfo_add_with_prefix("COMP", hashkey, strmodule); + g_free(hashkey); g_free(license); g_free(description); -- cgit v1.2.3