SystemMonitor: Trim "VMObject" suffix from VMObject types

Every VMObject type ends in "VMObject" and it's just taking up space.
This commit is contained in:
Andreas Kling 2021-01-29 10:51:46 +01:00
parent ef06215e7a
commit 3c7f5392a9
Notes: sideshowbarker 2024-07-18 22:46:33 +09:00

View File

@ -93,7 +93,12 @@ ProcessMemoryMapWidget::ProcessMemoryMapWidget()
builder.append('T');
return builder.to_string();
});
pid_vm_fields.empend("vmobject", "VMObject type", Gfx::TextAlignment::CenterLeft);
pid_vm_fields.empend("VMObject type", Gfx::TextAlignment::CenterLeft, [](auto& object) {
auto type = object.get("vmobject").to_string();
if (type.ends_with("VMObject"))
type = type.substring(0, type.length() - 8);
return type;
});
pid_vm_fields.empend("Purgeable", Gfx::TextAlignment::CenterLeft, [](auto& object) {
if (object.get("volatile").to_bool())
return "Volatile";