mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +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:
parent
38d62563b3
commit
5e1499d104
1615 changed files with 10257 additions and 10257 deletions
|
@ -15,52 +15,52 @@
|
|||
|
||||
namespace GUI {
|
||||
|
||||
NonnullRefPtr<Action> Action::create(DeprecatedString text, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
NonnullRefPtr<Action> Action::create(ByteString text, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), move(callback), parent));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create(DeprecatedString text, RefPtr<Gfx::Bitmap const> icon, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
NonnullRefPtr<Action> Action::create(ByteString text, RefPtr<Gfx::Bitmap const> icon, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), move(icon), move(callback), parent));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create(DeprecatedString text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
NonnullRefPtr<Action> Action::create(ByteString text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), shortcut, move(callback), parent));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create(DeprecatedString text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
NonnullRefPtr<Action> Action::create(ByteString text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), shortcut, alternate_shortcut, move(callback), parent));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create(DeprecatedString text, Shortcut const& shortcut, RefPtr<Gfx::Bitmap const> icon, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
NonnullRefPtr<Action> Action::create(ByteString text, Shortcut const& shortcut, RefPtr<Gfx::Bitmap const> icon, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), shortcut, Shortcut {}, move(icon), move(callback), parent));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create(DeprecatedString text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, RefPtr<Gfx::Bitmap const> icon, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
NonnullRefPtr<Action> Action::create(ByteString text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, RefPtr<Gfx::Bitmap const> icon, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), shortcut, alternate_shortcut, move(icon), move(callback), parent));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create_checkable(DeprecatedString text, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
NonnullRefPtr<Action> Action::create_checkable(ByteString text, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), move(callback), parent, true));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create_checkable(DeprecatedString text, RefPtr<Gfx::Bitmap const> icon, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
NonnullRefPtr<Action> Action::create_checkable(ByteString text, RefPtr<Gfx::Bitmap const> icon, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), move(icon), move(callback), parent, true));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create_checkable(DeprecatedString text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
NonnullRefPtr<Action> Action::create_checkable(ByteString text, Shortcut const& shortcut, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), shortcut, move(callback), parent, true));
|
||||
}
|
||||
|
||||
NonnullRefPtr<Action> Action::create_checkable(DeprecatedString text, Shortcut const& shortcut, RefPtr<Gfx::Bitmap const> icon, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
NonnullRefPtr<Action> Action::create_checkable(ByteString text, Shortcut const& shortcut, RefPtr<Gfx::Bitmap const> icon, Function<void(Action&)> callback, Core::EventReceiver* parent)
|
||||
{
|
||||
return adopt_ref(*new Action(move(text), shortcut, Shortcut {}, move(icon), move(callback), parent, true));
|
||||
}
|
||||
|
@ -78,27 +78,27 @@ RefPtr<Action> Action::find_action_for_shortcut(Core::EventReceiver& object, Sho
|
|||
return found_action;
|
||||
}
|
||||
|
||||
Action::Action(DeprecatedString text, Function<void(Action&)> on_activation_callback, Core::EventReceiver* parent, bool checkable)
|
||||
Action::Action(ByteString text, Function<void(Action&)> on_activation_callback, Core::EventReceiver* parent, bool checkable)
|
||||
: Action(move(text), Shortcut {}, Shortcut {}, nullptr, move(on_activation_callback), parent, checkable)
|
||||
{
|
||||
}
|
||||
|
||||
Action::Action(DeprecatedString text, RefPtr<Gfx::Bitmap const> icon, Function<void(Action&)> on_activation_callback, Core::EventReceiver* parent, bool checkable)
|
||||
Action::Action(ByteString text, RefPtr<Gfx::Bitmap const> icon, Function<void(Action&)> on_activation_callback, Core::EventReceiver* parent, bool checkable)
|
||||
: Action(move(text), Shortcut {}, Shortcut {}, move(icon), move(on_activation_callback), parent, checkable)
|
||||
{
|
||||
}
|
||||
|
||||
Action::Action(DeprecatedString text, Shortcut const& shortcut, Function<void(Action&)> on_activation_callback, Core::EventReceiver* parent, bool checkable)
|
||||
Action::Action(ByteString text, Shortcut const& shortcut, Function<void(Action&)> on_activation_callback, Core::EventReceiver* parent, bool checkable)
|
||||
: Action(move(text), shortcut, Shortcut {}, nullptr, move(on_activation_callback), parent, checkable)
|
||||
{
|
||||
}
|
||||
|
||||
Action::Action(DeprecatedString text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, Function<void(Action&)> on_activation_callback, Core::EventReceiver* parent, bool checkable)
|
||||
Action::Action(ByteString text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, Function<void(Action&)> on_activation_callback, Core::EventReceiver* parent, bool checkable)
|
||||
: Action(move(text), shortcut, alternate_shortcut, nullptr, move(on_activation_callback), parent, checkable)
|
||||
{
|
||||
}
|
||||
|
||||
Action::Action(DeprecatedString text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, RefPtr<Gfx::Bitmap const> icon, Function<void(Action&)> on_activation_callback, Core::EventReceiver* parent, bool checkable)
|
||||
Action::Action(ByteString text, Shortcut const& shortcut, Shortcut const& alternate_shortcut, RefPtr<Gfx::Bitmap const> icon, Function<void(Action&)> on_activation_callback, Core::EventReceiver* parent, bool checkable)
|
||||
: Core::EventReceiver(parent)
|
||||
, on_activation(move(on_activation_callback))
|
||||
, m_text(move(text))
|
||||
|
@ -284,31 +284,31 @@ void Action::set_icon(Gfx::Bitmap const* icon)
|
|||
});
|
||||
}
|
||||
|
||||
void Action::set_text(DeprecatedString text)
|
||||
void Action::set_text(ByteString text)
|
||||
{
|
||||
if (m_text == text)
|
||||
return;
|
||||
m_text = move(text);
|
||||
for_each_toolbar_button([&](auto& button) {
|
||||
button.set_text(String::from_deprecated_string(m_text).release_value_but_fixme_should_propagate_errors());
|
||||
button.set_text(String::from_byte_string(m_text).release_value_but_fixme_should_propagate_errors());
|
||||
});
|
||||
for_each_menu_item([&](auto& menu_item) {
|
||||
menu_item.update_from_action({});
|
||||
});
|
||||
}
|
||||
|
||||
DeprecatedString Action::tooltip() const
|
||||
ByteString Action::tooltip() const
|
||||
{
|
||||
return m_tooltip.value_or_lazy_evaluated([this] { return Gfx::parse_ampersand_string(m_text); });
|
||||
}
|
||||
|
||||
void Action::set_tooltip(DeprecatedString tooltip)
|
||||
void Action::set_tooltip(ByteString tooltip)
|
||||
{
|
||||
if (m_tooltip == tooltip)
|
||||
return;
|
||||
m_tooltip = move(tooltip);
|
||||
for_each_toolbar_button([&](auto& button) {
|
||||
button.set_tooltip(MUST(String::from_deprecated_string(*m_tooltip)));
|
||||
button.set_tooltip(MUST(String::from_byte_string(*m_tooltip)));
|
||||
});
|
||||
for_each_menu_item([&](auto& menu_item) {
|
||||
menu_item.update_from_action({});
|
||||
|
@ -320,7 +320,7 @@ Optional<String> Action::status_tip() const
|
|||
if (!m_status_tip.is_empty())
|
||||
return m_status_tip;
|
||||
|
||||
auto maybe_parsed_action_text = String::from_deprecated_string(Gfx::parse_ampersand_string(m_text));
|
||||
auto maybe_parsed_action_text = String::from_byte_string(Gfx::parse_ampersand_string(m_text));
|
||||
if (maybe_parsed_action_text.is_error())
|
||||
return {};
|
||||
return maybe_parsed_action_text.release_value();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue