diff options
author | Burt P <pburt0@gmail.com> | 2019-06-28 22:43:08 -0500 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2019-06-29 17:58:52 -0700 |
commit | 6bf10e09a097edf4c2a6de6966b159f8375c1acc (patch) | |
tree | 6c5f49b6f9f535ab6604250232ef1295a07463cf /modules/computer.c | |
parent | 31a69327e922297fcb0647e6ca0256da83218548 (diff) |
Computer Summary: use info from Memory Devices in RAM field
Show size and type if SPD or DMI memory information was available.
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules/computer.c')
-rw-r--r-- | modules/computer.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/modules/computer.c b/modules/computer.c index b3c01ce0..bf2ad16e 100644 --- a/modules/computer.c +++ b/modules/computer.c @@ -825,6 +825,22 @@ gchar *get_memory_total(void) return moreinfo_lookup ("DEV:MemTotal"); } +gchar *memory_devices_get_system_memory_str(); /* in dmi_memory.c */ +gchar *memory_devices_get_system_memory_types_str(); +gchar *get_memory_desc(void) +{ + gchar *mem = memory_devices_get_system_memory_str(); + if (mem) { + gchar *types = memory_devices_get_system_memory_types_str(); + gchar *ret = g_strdup_printf("%s\n%s", mem, types); + g_free(mem); + g_free(types); + return ret; + } + scan_memory_usage(FALSE); + return moreinfo_lookup ("DEV:MemTotal"); +} + ShellModuleMethod *hi_exported_methods(void) { static ShellModuleMethod m[] = { @@ -835,6 +851,7 @@ ShellModuleMethod *hi_exported_methods(void) {"getAudioCards", get_audio_cards}, {"getKernelModuleDescription", get_kernel_module_description}, {"getMemoryTotal", get_memory_total}, + {"getMemoryDesc", get_memory_desc}, {NULL} }; @@ -878,7 +895,7 @@ gchar *hi_module_get_summary(void) "Method=devices::getProcessorNameAndDesc\n" "[%s]\n" "Icon=memory.png\n" - "Method=computer::getMemoryTotal\n" + "Method=computer::getMemoryDesc\n" "[%s]\n" "Icon=module.png\n" "Method=devices::getMotherboard\n" |