diff options
author | Burt P <pburt0@gmail.com> | 2017-09-03 08:04:37 -0500 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2017-09-03 10:41:53 -0700 |
commit | 1d04e81aa3fb36b7d8f6c371204775f47b38c8de (patch) | |
tree | c3fccc60f714352c1066c47a7bd61bbda4ff996c /modules | |
parent | 49c9e93745d3196f6d6342e6aae5e593a1741176 (diff) |
bench results: Show unknown instead of 0 kB for old results
Other minor tweaks.
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/benchmark/bench_results.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/modules/benchmark/bench_results.c b/modules/benchmark/bench_results.c index b69c1767..226f595c 100644 --- a/modules/benchmark/bench_results.c +++ b/modules/benchmark/bench_results.c @@ -18,6 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +/*/ Used for an unknown value. Having it in only one place cleans up the .po line references */ +static const char *unk = N_("(Unknown)"); + typedef struct { char *board; int memory_kiB; @@ -339,7 +342,12 @@ char *bench_result_benchmarkconf_line(bench_result *b) { } char *bench_result_more_info(bench_result *b) { - return g_strdup_printf("[%s]\n" + char *memory = + (b->machine->memory_kiB > 0) + ? g_strdup_printf("%d %s", b->machine->memory_kiB, _("kiB") ) + : g_strdup(_(unk) ); + + char *ret = g_strdup_printf("[%s]\n" /* threads */ "%s=%d\n" /* legacy */ "%s=%s\n" "[%s]\n" @@ -349,20 +357,22 @@ char *bench_result_more_info(bench_result *b) { /* cpucfg */ "%s=%s\n" /* threads */ "%s=%d\n" /* ogl rend */ "%s=%s\n" - /* mem */ "%s=%d %s\n", + /* mem */ "%s=%s\n", _("Benchmark Result"), _("Threads"), b->threads, b->legacy ? _("Note") : "#Note", b->legacy ? _("This result is from an old version of HardInfo. Results might not be comparable to current version. Some details are missing.") : "", _("Machine"), - _("Board"), (b->machine->board != NULL) ? b->machine->board : _("(Unknown)"), + _("Board"), (b->machine->board != NULL) ? b->machine->board : _(unk), _("CPU Name"), b->machine->cpu_name, - _("CPU Description"), (b->machine->cpu_desc != NULL) ? b->machine->cpu_desc : _("(Unknown)"), + _("CPU Description"), (b->machine->cpu_desc != NULL) ? b->machine->cpu_desc : _(unk), _("CPU Config"), b->machine->cpu_config, _("Threads Available"), b->machine->threads, - _("OpenGL Renderer"), (b->machine->ogl_renderer != NULL) ? b->machine->ogl_renderer : _("(Unknown)"), - _("Memory"), b->machine->memory_kiB, _("kiB") + _("OpenGL Renderer"), (b->machine->ogl_renderer != NULL) ? b->machine->ogl_renderer : _(unk), + _("Memory"), memory ); + free(memory); + return ret; } char *bench_result_more_info_complete(bench_result *b) { @@ -387,14 +397,14 @@ char *bench_result_more_info_complete(bench_result *b) { _("Result"), b->result, _("Threads"), b->threads, b->legacy ? _("Note") : "#Note", - b->legacy ? _("This result is from an old version of Hardinfo.") : "", + b->legacy ? _("This result is from an old version of HardInfo. Results might not be comparable to current version. Some details are missing.") : "", _("Machine"), - _("Board"), (b->machine->board != NULL) ? b->machine->board : _("(Unknown)"), + _("Board"), (b->machine->board != NULL) ? b->machine->board : _(unk), _("CPU Name"), b->machine->cpu_name, - _("CPU Description"), (b->machine->cpu_desc != NULL) ? b->machine->cpu_desc : _("(Unknown)"), + _("CPU Description"), (b->machine->cpu_desc != NULL) ? b->machine->cpu_desc : _(unk), _("CPU Config"), b->machine->cpu_config, _("Threads Available"), b->machine->threads, - _("OpenGL Renderer"), (b->machine->ogl_renderer != NULL) ? b->machine->ogl_renderer : _("(Unknown)"), + _("OpenGL Renderer"), (b->machine->ogl_renderer != NULL) ? b->machine->ogl_renderer : _(unk), _("Memory"), b->machine->memory_kiB, _("kiB"), _("Handles"), _("mid"), b->machine->mid, |