1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:57: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:
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

@ -29,11 +29,11 @@ void MapsSettingsWidget::apply_settings()
Config::remove_key("Maps"sv, "MapWidget"sv, "TileProviderAttributionText"sv);
Config::remove_key("Maps"sv, "MapWidget"sv, "TileProviderAttributionUrl"sv);
} else {
auto tile_provider_url_format = m_tile_provider_combobox->model()->index(m_tile_provider_combobox->selected_index(), 1).data().to_deprecated_string();
auto tile_provider_url_format = m_tile_provider_combobox->model()->index(m_tile_provider_combobox->selected_index(), 1).data().to_byte_string();
Config::write_string("Maps"sv, "MapWidget"sv, "TileProviderUrlFormat"sv, tile_provider_url_format);
auto tile_provider_attribution_text = m_tile_provider_combobox->model()->index(m_tile_provider_combobox->selected_index(), 2).data().to_deprecated_string();
auto tile_provider_attribution_text = m_tile_provider_combobox->model()->index(m_tile_provider_combobox->selected_index(), 2).data().to_byte_string();
Config::write_string("Maps"sv, "MapWidget"sv, "TileProviderAttributionText"sv, tile_provider_attribution_text);
auto tile_provider_attribution_url = m_tile_provider_combobox->model()->index(m_tile_provider_combobox->selected_index(), 3).data().to_deprecated_string();
auto tile_provider_attribution_url = m_tile_provider_combobox->model()->index(m_tile_provider_combobox->selected_index(), 3).data().to_byte_string();
Config::write_string("Maps"sv, "MapWidget"sv, "TileProviderAttributionUrl"sv, tile_provider_attribution_url);
}
}
@ -51,7 +51,7 @@ ErrorOr<void> MapsSettingsWidget::setup()
tile_provider_fields.empend("url_format", "URL format"_string, Gfx::TextAlignment::CenterLeft);
tile_provider_fields.empend("attribution_text", "Attribution text"_string, Gfx::TextAlignment::CenterLeft);
tile_provider_fields.empend("attribution_url", "Attribution URL"_string, Gfx::TextAlignment::CenterLeft);
auto tile_providers = GUI::JsonArrayModel::create(DeprecatedString::formatted("{}/MapsTileProviders.json", Core::StandardPaths::config_directory()), move(tile_provider_fields));
auto tile_providers = GUI::JsonArrayModel::create(ByteString::formatted("{}/MapsTileProviders.json", Core::StandardPaths::config_directory()), move(tile_provider_fields));
tile_providers->invalidate();
Vector<JsonValue> custom_tile_provider;
@ -71,8 +71,8 @@ ErrorOr<void> MapsSettingsWidget::setup()
m_custom_tile_provider_textbox->set_placeholder(Maps::default_tile_provider_url_format);
m_custom_tile_provider_textbox->on_change = [&]() { set_modified(true); };
m_tile_provider_combobox->on_change = [&](DeprecatedString const&, GUI::ModelIndex const& index) {
auto tile_provider_url_format = m_tile_provider_combobox->model()->index(index.row(), 1).data().to_deprecated_string();
m_tile_provider_combobox->on_change = [&](ByteString const&, GUI::ModelIndex const& index) {
auto tile_provider_url_format = m_tile_provider_combobox->model()->index(index.row(), 1).data().to_byte_string();
m_is_custom_tile_provider = tile_provider_url_format.is_empty();
m_custom_tile_provider_group->set_enabled(m_is_custom_tile_provider);
set_modified(true);
@ -86,7 +86,7 @@ void MapsSettingsWidget::set_tile_provider(StringView tile_provider_url_format)
{
bool found = false;
for (int index = 0; index < m_tile_provider_combobox->model()->row_count(); index++) {
auto url_format = m_tile_provider_combobox->model()->index(index, 1).data().to_deprecated_string();
auto url_format = m_tile_provider_combobox->model()->index(index, 1).data().to_byte_string();
if (url_format == tile_provider_url_format) {
m_tile_provider_combobox->set_selected_index(index, GUI::AllowCallback::No);
found = true;