1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 15:45:08 +00:00

Use new format functions in remaining DevTools. (#3755)

* AK: Add formatter for JsonValue.

* Inspector: Use new format functions.

* Profiler: Use new format functions.

* UserspaceEmulator: Use new format functions.
This commit is contained in:
Paul Scharnofske 2020-10-13 18:34:27 +02:00 committed by GitHub
parent 626bb1be9c
commit d94f674bbb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 45 additions and 37 deletions

View file

@ -77,9 +77,9 @@ GUI::Variant RemoteObjectPropertyModel::data(const GUI::ModelIndex& index, GUI::
case Column::Value: {
auto data = path->resolve(m_object.json);
if (data.is_array())
return String::format("<Array with %d element%s", data.as_array().size(), data.as_array().size() == 1 ? ">" : "s>");
return String::formatted("<Array with {} element{}", data.as_array().size(), data.as_array().size() == 1 ? ">" : "s>");
if (data.is_object())
return String::format("<Object with %d entr%s", data.as_object().size(), data.as_object().size() == 1 ? "y>" : "ies>");
return String::formatted("<Object with {} entr{}", data.as_object().size(), data.as_object().size() == 1 ? "y>" : "ies>");
return data;
}
}
@ -189,7 +189,7 @@ GUI::ModelIndex RemoteObjectPropertyModel::parent_index(const GUI::ModelIndex& i
return create_index(index_in_parent, 0, cpath);
}
dbg() << "No cached path found for path " << path.to_string();
dbgln("No cached path found for path {}", path.to_string());
return {};
}