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.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.c')
-rw-r--r-- | modules/computer.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/modules/computer.c b/modules/computer.c index 7d3c5d8d..8656b361 100644 --- a/modules/computer.c +++ b/modules/computer.c @@ -81,13 +81,12 @@ static ModuleEntry entries[] = { {NULL}, }; -GHashTable *moreinfo = NULL; gchar *module_list = NULL; Computer *computer = NULL; gchar *hi_more_info(gchar * entry) { - gchar *info = (gchar *) g_hash_table_lookup(moreinfo, entry); + gchar *info = moreinfo_lookup_with_prefix("COMP", entry); if (info) return g_strdup(info); @@ -684,15 +683,12 @@ void hi_module_deinit(void) g_free(computer->date_time); g_free(computer); - h_hash_table_remove_all(moreinfo); - g_hash_table_destroy(moreinfo); + moreinfo_del_with_prefix("COMP"); } void hi_module_init(void) { computer = g_new0(Computer, 1); - moreinfo = - g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); } ModuleAbout *hi_module_get_about(void) |