1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:57:35 +00:00

Everywhere: Rename {Deprecated => Byte}String

This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
This commit is contained in:
Ali Mohammad Pur 2023-12-16 17:49:34 +03:30 committed by Ali Mohammad Pur
parent 38d62563b3
commit 5e1499d104
1615 changed files with 10257 additions and 10257 deletions

View file

@ -9,7 +9,7 @@
#include "ProgressWindow.h"
#include "Tree.h"
#include <AK/Array.h>
#include <AK/DeprecatedString.h>
#include <AK/ByteString.h>
#include <AK/NumberFormat.h>
#include <LibGUI/ConnectionToWindowServer.h>
#include <LibGUI/Painter.h>
@ -97,7 +97,7 @@ void TreeMapWidget::paint_cell_frame(GUI::Painter& painter, TreeNode const& node
text_rect.take_from_top(font().presentation_size() + 1);
painter.draw_text(text_rect, human_readable_size(node.area()), font(), Gfx::TextAlignment::TopLeft, Color::Black);
} else {
painter.draw_text(text_rect, DeprecatedString::formatted("{} - {}", node.name(), human_readable_size(node.area())), font(), Gfx::TextAlignment::TopLeft, Color::Black);
painter.draw_text(text_rect, ByteString::formatted("{} - {}", node.name(), human_readable_size(node.area())), font(), Gfx::TextAlignment::TopLeft, Color::Black);
}
painter.clear_clip_rect();
}
@ -261,13 +261,13 @@ void TreeMapWidget::paint_event(GUI::PaintEvent& event)
}
}
Vector<DeprecatedString> TreeMapWidget::path_to_position(Gfx::IntPoint position)
Vector<ByteString> TreeMapWidget::path_to_position(Gfx::IntPoint position)
{
TreeNode const* node = path_node(m_viewpoint);
if (!node) {
return {};
}
Vector<DeprecatedString> path;
Vector<ByteString> path;
lay_out_children(*node, frame_inner_rect(), m_viewpoint, [&](TreeNode const& node, int, Gfx::IntRect const& rect, Gfx::IntRect const&, int, HasLabel, IsRemainder is_remainder) {
if (is_remainder == IsRemainder::No && rect.contains(position)) {
path.append(node.name());
@ -381,8 +381,8 @@ static ErrorOr<void> fill_mounts(Vector<MountInfo>& output)
TRY(json.as_array().try_for_each([&output](JsonValue const& value) -> ErrorOr<void> {
auto& filesystem_object = value.as_object();
MountInfo mount_info;
mount_info.mount_point = filesystem_object.get_deprecated_string("mount_point"sv).value_or({});
mount_info.source = filesystem_object.get_deprecated_string("source"sv).value_or("none");
mount_info.mount_point = filesystem_object.get_byte_string("mount_point"sv).value_or({});
mount_info.source = filesystem_object.get_byte_string("source"sv).value_or("none");
TRY(output.try_append(mount_info));
return {};
}));
@ -420,7 +420,7 @@ ErrorOr<void> TreeMapWidget::analyze(GUI::Statusbar& statusbar)
builder.append({ error, strlen(error) });
builder.append(" ("sv);
int value = errors.get(key).value();
builder.append(DeprecatedString::number(value));
builder.append(ByteString::number(value));
if (value == 1) {
builder.append(" time"sv);
} else {