1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:17:35 +00:00

Everywhere: Rename to_{string => deprecated_string}() where applicable

This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
This commit is contained in:
Linus Groh 2022-12-06 01:12:49 +00:00 committed by Andreas Kling
parent 6e19ab2bbc
commit 57dc179b1f
597 changed files with 1973 additions and 1972 deletions

View file

@ -106,7 +106,7 @@ BrowserSettingsWidget::BrowserSettingsWidget()
m_search_engine_combobox->set_model(move(search_engines_model));
m_search_engine_combobox->set_only_allow_values_from_model(true);
m_search_engine_combobox->on_change = [this](AK::DeprecatedString const&, GUI::ModelIndex const& cursor_index) {
auto url_format = m_search_engine_combobox->model()->index(cursor_index.row(), 1).data().to_string();
auto url_format = m_search_engine_combobox->model()->index(cursor_index.row(), 1).data().to_deprecated_string();
m_is_custom_search_engine = url_format.is_empty();
m_custom_search_engine_group->set_enabled(m_is_custom_search_engine);
set_modified(true);
@ -122,7 +122,7 @@ void BrowserSettingsWidget::set_color_scheme(StringView color_scheme)
{
bool found_color_scheme = false;
for (int item_index = 0; item_index < m_color_scheme_combobox->model()->row_count(); ++item_index) {
auto scheme = m_color_scheme_combobox->model()->index(item_index, 1).data().to_string();
auto scheme = m_color_scheme_combobox->model()->index(item_index, 1).data().to_deprecated_string();
if (scheme == color_scheme) {
m_color_scheme_combobox->set_selected_index(item_index, GUI::AllowCallback::No);
found_color_scheme = true;
@ -146,7 +146,7 @@ void BrowserSettingsWidget::set_search_engine_url(StringView url)
bool found_url = false;
for (int item_index = 0; item_index < m_search_engine_combobox->model()->row_count(); ++item_index) {
auto url_format = m_search_engine_combobox->model()->index(item_index, 1).data().to_string();
auto url_format = m_search_engine_combobox->model()->index(item_index, 1).data().to_deprecated_string();
if (url_format == url) {
m_search_engine_combobox->set_selected_index(item_index, GUI::AllowCallback::No);
found_url = true;
@ -189,7 +189,7 @@ void BrowserSettingsWidget::apply_settings()
Config::write_bool("Browser"sv, "Preferences"sv, "ShowBookmarksBar"sv, m_show_bookmarks_bar_checkbox->is_checked());
auto color_scheme_index = m_color_scheme_combobox->selected_index();
auto color_scheme = m_color_scheme_combobox->model()->index(color_scheme_index, 1).data().to_string();
auto color_scheme = m_color_scheme_combobox->model()->index(color_scheme_index, 1).data().to_deprecated_string();
Config::write_string("Browser"sv, "Preferences"sv, "ColorScheme"sv, color_scheme);
if (!m_enable_search_engine_checkbox->is_checked()) {
@ -198,7 +198,7 @@ void BrowserSettingsWidget::apply_settings()
Config::write_string("Browser"sv, "Preferences"sv, "SearchEngine"sv, m_custom_search_engine_textbox->text());
} else {
auto selected_index = m_search_engine_combobox->selected_index();
auto url = m_search_engine_combobox->model()->index(selected_index, 1).data().to_string();
auto url = m_search_engine_combobox->model()->index(selected_index, 1).data().to_deprecated_string();
Config::write_string("Browser"sv, "Preferences"sv, "SearchEngine"sv, url);
}