mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:07:44 +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
|
@ -54,7 +54,7 @@ CharacterMapWidget::CharacterMapWidget()
|
|||
continue;
|
||||
builder.append_code_point(code_point);
|
||||
}
|
||||
GUI::Clipboard::the().set_plain_text(builder.to_deprecated_string());
|
||||
GUI::Clipboard::the().set_plain_text(builder.to_byte_string());
|
||||
});
|
||||
m_copy_selection_action->set_status_tip("Copy the highlighted characters to the clipboard"_string);
|
||||
|
||||
|
@ -139,7 +139,7 @@ CharacterMapWidget::CharacterMapWidget()
|
|||
for (auto& block : unicode_blocks)
|
||||
m_unicode_block_list.append(block.display_name);
|
||||
|
||||
m_unicode_block_model = GUI::ItemListModel<DeprecatedString>::create(m_unicode_block_list);
|
||||
m_unicode_block_model = GUI::ItemListModel<ByteString>::create(m_unicode_block_list);
|
||||
m_unicode_block_listview->set_model(*m_unicode_block_model);
|
||||
m_unicode_block_listview->set_activates_on_selection(true);
|
||||
m_unicode_block_listview->horizontal_scrollbar().set_visible(false);
|
||||
|
|
|
@ -42,6 +42,6 @@ private:
|
|||
RefPtr<GUI::Action> m_go_to_glyph_action;
|
||||
RefPtr<GUI::Action> m_find_glyphs_action;
|
||||
|
||||
Vector<DeprecatedString> m_unicode_block_list;
|
||||
Vector<ByteString> m_unicode_block_list;
|
||||
Unicode::CodePointRange m_range { 0x0000, 0x10FFFF };
|
||||
};
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
|
||||
struct SearchResult {
|
||||
u32 code_point;
|
||||
DeprecatedString code_point_string;
|
||||
DeprecatedString display_text;
|
||||
ByteString code_point_string;
|
||||
ByteString display_text;
|
||||
};
|
||||
|
||||
class CharacterSearchModel final : public GUI::Model {
|
||||
|
@ -93,7 +93,7 @@ void CharacterSearchWidget::search()
|
|||
StringBuilder builder;
|
||||
builder.append_code_point(code_point);
|
||||
|
||||
model.add_result({ code_point, builder.to_deprecated_string(), move(display_name) });
|
||||
model.add_result({ code_point, builder.to_byte_string(), move(display_name) });
|
||||
|
||||
// Stop when we reach 250 results.
|
||||
// This is already too many for the search to be useful, and means we don't spend forever recalculating the column size.
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
#include "SearchCharacters.h"
|
||||
#include <LibUnicode/CharacterTypes.h>
|
||||
|
||||
void for_each_character_containing(StringView query, Function<IterationDecision(u32 code_point, DeprecatedString const& display_name)> callback)
|
||||
void for_each_character_containing(StringView query, Function<IterationDecision(u32 code_point, ByteString const& display_name)> callback)
|
||||
{
|
||||
DeprecatedString uppercase_query = query.to_uppercase_string();
|
||||
ByteString uppercase_query = query.to_uppercase_string();
|
||||
StringView uppercase_query_view = uppercase_query.view();
|
||||
constexpr u32 maximum_code_point = 0x10FFFF;
|
||||
// FIXME: There's probably a better way to do this than just looping, but it still only takes ~150ms to run for me!
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/ByteString.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/IterationDecision.h>
|
||||
|
||||
void for_each_character_containing(StringView query, Function<IterationDecision(u32 code_point, DeprecatedString const& display_name)> callback);
|
||||
void for_each_character_containing(StringView query, Function<IterationDecision(u32 code_point, ByteString const& display_name)> callback);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include <LibGfx/Font/FontDatabase.h>
|
||||
#include <LibMain/Main.h>
|
||||
|
||||
static void search_and_print_results(DeprecatedString const& query)
|
||||
static void search_and_print_results(ByteString const& query)
|
||||
{
|
||||
outln("Searching for '{}'", query);
|
||||
u32 result_count = 0;
|
||||
|
@ -53,7 +53,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::unveil("/res", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
DeprecatedString query;
|
||||
ByteString query;
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.add_option(query, "Search character names using this query, and print them as a list.", "search", 's', "query");
|
||||
args_parser.parse(arguments);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue