From 50bca8fcefee78ae7855316753ac551ff325ba1b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 24 Aug 2020 12:36:23 +0200 Subject: [PATCH] SystemMonitor: Tweak processor feature display a little bit Flatten the CPU features array instead of showing it as raw JSON data. --- Applications/SystemMonitor/main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Applications/SystemMonitor/main.cpp b/Applications/SystemMonitor/main.cpp index ef4d4e1fd1..804891f150 100644 --- a/Applications/SystemMonitor/main.cpp +++ b/Applications/SystemMonitor/main.cpp @@ -583,7 +583,15 @@ NonnullRefPtr build_processors_tab() processors_field.empend("processor", "Processor", Gfx::TextAlignment::CenterRight); processors_field.empend("cpuid", "CPUID", Gfx::TextAlignment::CenterLeft); processors_field.empend("brandstr", "Brand", Gfx::TextAlignment::CenterLeft); - processors_field.empend("features", "Features", Gfx::TextAlignment::CenterLeft); + processors_field.empend("Features", Gfx::TextAlignment::CenterLeft, [](auto& object) { + StringBuilder builder; + auto features = object.get("features").as_array(); + for (auto& feature : features.values()) { + builder.append(feature.to_string()); + builder.append(' '); + } + return GUI::Variant(builder.to_string()); + }); processors_field.empend("family", "Family", Gfx::TextAlignment::CenterRight); processors_field.empend("model", "Model", Gfx::TextAlignment::CenterRight); processors_field.empend("stepping", "Stepping", Gfx::TextAlignment::CenterRight);