1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +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

@ -98,7 +98,7 @@ void TextEditor::create_actions()
if (is_multi_line()) {
m_go_to_line_action = Action::create(
"Go to line...", { Mod_Ctrl, Key_L }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-to.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) {
String value;
DeprecatedString value;
if (InputBox::show(window(), value, "Line:"sv, "Go to line"sv) == InputBox::ExecResult::OK) {
auto line_target = value.to_uint();
if (line_target.has_value()) {
@ -490,7 +490,7 @@ void TextEditor::paint_event(PaintEvent& event)
// NOTE: Use Painter::draw_text() directly here, as we want to always draw the line numbers in clear text.
painter.draw_text(
ruler_line_rect.shrunken(2, 0),
String::number(i + 1),
DeprecatedString::number(i + 1),
is_current_line ? font().bold_variant() : font(),
Gfx::TextAlignment::CenterRight,
is_current_line ? palette().ruler_active_text() : palette().ruler_inactive_text());
@ -1446,7 +1446,7 @@ void TextEditor::timer_event(Core::TimerEvent&)
update_cursor();
}
bool TextEditor::write_to_file(String const& path)
bool TextEditor::write_to_file(DeprecatedString const& path)
{
auto file = Core::File::construct(path);
if (!file->open(Core::OpenMode::WriteOnly | Core::OpenMode::Truncate)) {
@ -1500,7 +1500,7 @@ bool TextEditor::write_to_file(Core::File& file)
return true;
}
String TextEditor::text() const
DeprecatedString TextEditor::text() const
{
return document().text();
}
@ -1515,7 +1515,7 @@ void TextEditor::clear()
update();
}
String TextEditor::selected_text() const
DeprecatedString TextEditor::selected_text() const
{
if (!has_selection())
return {};
@ -1657,7 +1657,7 @@ void TextEditor::paste()
if (data.is_empty())
return;
dbgln_if(TEXTEDITOR_DEBUG, "Paste: \"{}\"", String::copy(data));
dbgln_if(TEXTEDITOR_DEBUG, "Paste: \"{}\"", DeprecatedString::copy(data));
TemporaryChange change(m_automatic_indentation_enabled, false);
insert_at_cursor_or_replace_selection(data);
@ -2080,7 +2080,7 @@ void TextEditor::cursor_did_change()
hide_autocomplete_if_needed();
}
void TextEditor::clipboard_content_did_change(String const& mime_type)
void TextEditor::clipboard_content_did_change(DeprecatedString const& mime_type)
{
m_paste_action->set_enabled(is_editable() && mime_type.starts_with("text/"sv));
}