1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:17:35 +00:00

AK+Everywhere: Rename String to DeprecatedString

We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
This commit is contained in:
Linus Groh 2022-12-04 18:02:33 +00:00 committed by Andreas Kling
parent f74251606d
commit 6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions

View file

@ -6,9 +6,9 @@
#pragma once
#include <AK/DeprecatedString.h>
#include <AK/JsonObject.h>
#include <AK/NonnullOwnPtrVector.h>
#include <AK/String.h>
namespace Inspector {
@ -25,8 +25,8 @@ public:
FlatPtr address { 0 };
FlatPtr parent_address { 0 };
String class_name;
String name;
DeprecatedString class_name;
DeprecatedString name;
JsonObject json;

View file

@ -87,7 +87,7 @@ GUI::Variant RemoteObjectGraphModel::data(const GUI::ModelIndex& index, GUI::Mod
return m_object_icon;
}
if (role == GUI::ModelRole::Display)
return String::formatted("{}({:p})", remote_object->class_name, remote_object->address);
return DeprecatedString::formatted("{}({:p})", remote_object->class_name, remote_object->address);
return {};
}

View file

@ -33,7 +33,7 @@ int RemoteObjectPropertyModel::row_count(const GUI::ModelIndex& index) const
}
}
String RemoteObjectPropertyModel::column_name(int column) const
DeprecatedString RemoteObjectPropertyModel::column_name(int column) const
{
switch (column) {
case Column::Name:
@ -57,9 +57,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::formatted("<Array with {} element{}", data.as_array().size(), data.as_array().size() == 1 ? ">" : "s>");
return DeprecatedString::formatted("<Array with {} element{}", data.as_array().size(), data.as_array().size() == 1 ? ">" : "s>");
if (data.is_object())
return String::formatted("<Object with {} entr{}", data.as_object().size(), data.as_object().size() == 1 ? "y>" : "ies>");
return DeprecatedString::formatted("<Object with {} entr{}", data.as_object().size(), data.as_object().size() == 1 ? "y>" : "ies>");
return data;
}
}
@ -90,7 +90,7 @@ GUI::ModelIndex RemoteObjectPropertyModel::index(int row, int column, const GUI:
path->extend(parent_path);
int row_index = n;
if (value.is_object()) {
String property_name;
DeprecatedString property_name;
auto& object = value.as_object();
object.for_each_member([&](auto& name, auto&) {
if (row_index > 0) {

View file

@ -31,7 +31,7 @@ public:
virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override;
virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return Column::__Count; }
virtual String column_name(int) const override;
virtual DeprecatedString column_name(int) const override;
virtual GUI::Variant data(const GUI::ModelIndex&, GUI::ModelRole) const override;
virtual void set_data(const GUI::ModelIndex&, const GUI::Variant&) override;
virtual bool is_editable(const GUI::ModelIndex& index) const override { return index.column() == Column::Value; }

View file

@ -22,7 +22,7 @@ public:
void update();
pid_t pid() const { return m_pid; }
String const& process_name() const { return m_process_name; }
DeprecatedString const& process_name() const { return m_process_name; }
RemoteObjectGraphModel& object_graph_model() { return *m_object_graph_model; }
NonnullOwnPtrVector<RemoteObject> const& roots() const { return m_roots; }
@ -42,7 +42,7 @@ private:
void send_request(JsonObject const&);
pid_t m_pid { -1 };
String m_process_name;
DeprecatedString m_process_name;
NonnullRefPtr<RemoteObjectGraphModel> m_object_graph_model;
NonnullOwnPtrVector<RemoteObject> m_roots;
RefPtr<InspectorServerClient> m_client;

View file

@ -56,7 +56,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
return 0;
pid = process_chooser->pid();
} else {
auto pid_opt = String(arguments.strings[1]).to_int();
auto pid_opt = DeprecatedString(arguments.strings[1]).to_int();
if (!pid_opt.has_value())
print_usage_and_exit();
pid = pid_opt.value();
@ -74,7 +74,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
RemoteProcess remote_process(pid);
if (!remote_process.is_inspectable()) {
GUI::MessageBox::show(window, String::formatted("Process pid={} is not inspectable", remote_process.pid()), "Error"sv, GUI::MessageBox::Type::Error);
GUI::MessageBox::show(window, DeprecatedString::formatted("Process pid={} is not inspectable", remote_process.pid()), "Error"sv, GUI::MessageBox::Type::Error);
if (gui_mode) {
goto choose_pid;
} else {
@ -107,7 +107,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
remote_process.on_update = [&] {
if (!remote_process.process_name().is_null())
window->set_title(String::formatted("{} ({}) - Inspector", remote_process.process_name(), remote_process.pid()));
window->set_title(DeprecatedString::formatted("{} ({}) - Inspector", remote_process.process_name(), remote_process.pid()));
};
auto& tree_view = splitter.add<GUI::TreeView>();