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/computer/modules.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/computer/modules.c')
-rw-r--r-- | modules/computer/modules.c | 11 |
1 files changed, 3 insertions, 8 deletions
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); |