Skip to content

Commit

Permalink
update display e2k processors: always in table
Browse files Browse the repository at this point in the history
  • Loading branch information
afonot authored and lpereira committed Jul 24, 2022
1 parent 5acf7ea commit d59a39c
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions modules/devices/e2k/processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,35 +346,30 @@ gchar *processor_get_info(GSList * processors)
{
Processor *processor;

if (g_slist_length(processors) > 1) {
gchar *ret, *tmp, *hashkey;
GSList *l;
gchar *ret, *tmp, *hashkey;
GSList *l;

tmp = g_strdup("");
tmp = g_strdup("");

for (l = processors; l; l = l->next) {
processor = (Processor *) l->data;

tmp = g_strdup_printf("%s$CPU%d$%s=%.2f %s\n",
tmp, processor->id,
processor->model_name,
processor->cpu_mhz, _("MHz"));

hashkey = g_strdup_printf("CPU%d", processor->id);
moreinfo_add_with_prefix("DEV", hashkey,
processor_get_detailed_info(processor));
g_free(hashkey);
}
for (l = processors; l; l = l->next) {
processor = (Processor *) l->data;

ret = g_strdup_printf("[$ShellParam$]\n"
"ViewType=1\n"
"[Processors]\n"
"%s", tmp);
g_free(tmp);
tmp = g_strdup_printf("%s$CPU%d$%s=%.2f %s\n",
tmp, processor->id,
processor->model_name,
processor->cpu_mhz, _("MHz"));

return ret;
hashkey = g_strdup_printf("CPU%d", processor->id);
moreinfo_add_with_prefix("DEV", hashkey,
processor_get_detailed_info(processor));
g_free(hashkey);
}

processor = (Processor *) processors->data;
return processor_get_detailed_info(processor);
ret = g_strdup_printf("[$ShellParam$]\n"
"ViewType=1\n"
"[Processors]\n"
"%s", tmp);
g_free(tmp);

return ret;
}

0 comments on commit d59a39c

Please sign in to comment.