mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:07:45 +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
|
@ -26,7 +26,7 @@ NumericInput::NumericInput()
|
|||
first = false;
|
||||
}
|
||||
|
||||
auto new_number_opt = builder.to_deprecated_string().to_int();
|
||||
auto new_number_opt = builder.to_byte_string().to_int();
|
||||
if (!new_number_opt.has_value()) {
|
||||
m_needs_text_reset = true;
|
||||
return;
|
||||
|
@ -34,7 +34,7 @@ NumericInput::NumericInput()
|
|||
m_needs_text_reset = false;
|
||||
}
|
||||
|
||||
set_text(builder.to_deprecated_string());
|
||||
set_text(builder.to_byte_string());
|
||||
set_current_number(new_number_opt.value(), GUI::AllowCallback::No);
|
||||
};
|
||||
|
||||
|
@ -70,7 +70,7 @@ void NumericInput::set_max_number(i32 number)
|
|||
void NumericInput::on_focus_lost()
|
||||
{
|
||||
if (m_needs_text_reset) {
|
||||
set_text(DeprecatedString::number(m_current_number));
|
||||
set_text(ByteString::number(m_current_number));
|
||||
m_needs_text_reset = false;
|
||||
}
|
||||
if (on_number_changed)
|
||||
|
@ -83,7 +83,7 @@ void NumericInput::set_current_number(i32 number, GUI::AllowCallback allow_callb
|
|||
return;
|
||||
|
||||
m_current_number = clamp(number, m_min_number, m_max_number);
|
||||
set_text(DeprecatedString::number(m_current_number));
|
||||
set_text(ByteString::number(m_current_number));
|
||||
if (on_number_changed && allow_callback == GUI::AllowCallback::Yes)
|
||||
on_number_changed(m_current_number);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "PDFViewerWidget.h"
|
||||
#include <AK/Assertions.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/ByteString.h>
|
||||
#include <AK/Format.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/HashTable.h>
|
||||
|
@ -38,7 +38,7 @@ class PagedErrorsModel : public GUI::Model {
|
|||
_Count
|
||||
};
|
||||
|
||||
using PageErrors = AK::OrderedHashTable<DeprecatedString>;
|
||||
using PageErrors = AK::OrderedHashTable<ByteString>;
|
||||
using PagedErrors = HashMap<u32, PageErrors>;
|
||||
|
||||
public:
|
||||
|
@ -102,7 +102,7 @@ public:
|
|||
case Columns::Page:
|
||||
return m_pages_with_errors[index.row()] + 1;
|
||||
case Columns::Message:
|
||||
return DeprecatedString::formatted("{} errors", error_count_in_page(index));
|
||||
return ByteString::formatted("{} errors", error_count_in_page(index));
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
@ -366,14 +366,14 @@ void PDFViewerWidget::open_file(StringView path, NonnullOwnPtr<Core::File> file)
|
|||
if (maybe_error.is_error()) {
|
||||
auto error = maybe_error.release_error();
|
||||
warnln("{}", error.message());
|
||||
auto user_error_message = DeprecatedString::formatted("Failed to load the document. Error:\n{}.", error.message());
|
||||
auto user_error_message = ByteString::formatted("Failed to load the document. Error:\n{}.", error.message());
|
||||
GUI::MessageBox::show_error(nullptr, user_error_message.view());
|
||||
}
|
||||
}
|
||||
|
||||
PDF::PDFErrorOr<void> PDFViewerWidget::try_open_file(StringView path, NonnullOwnPtr<Core::File> file)
|
||||
{
|
||||
window()->set_title(DeprecatedString::formatted("{} - PDF Viewer", path));
|
||||
window()->set_title(ByteString::formatted("{} - PDF Viewer", path));
|
||||
|
||||
m_buffer = TRY(file->read_until_eof());
|
||||
auto document = TRY(PDF::Document::create(m_buffer));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue