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

@ -6,9 +6,9 @@
#include "NetworkSettingsWidget.h"
#include <AK/DeprecatedString.h>
#include <AK/IPv4Address.h>
#include <AK/JsonParser.h>
#include <AK/String.h>
#include <Applications/NetworkSettings/NetworkSettingsGML.h>
#include <LibCore/Command.h>
#include <LibCore/File.h>
@ -100,8 +100,8 @@ NetworkSettingsWidget::NetworkSettingsWidget()
index++;
});
m_adapters_combobox->set_model(GUI::ItemListModel<String>::create(m_adapter_names));
m_adapters_combobox->on_change = [this](String const& text, GUI::ModelIndex const&) {
m_adapters_combobox->set_model(GUI::ItemListModel<DeprecatedString>::create(m_adapter_names));
m_adapters_combobox->on_change = [this](DeprecatedString const& text, GUI::ModelIndex const&) {
on_switch_adapter(text);
};
auto const& selected_adapter = selected_adapter_index;
@ -110,7 +110,7 @@ NetworkSettingsWidget::NetworkSettingsWidget()
on_switch_adapter(m_adapter_names[selected_adapter_index]);
}
void NetworkSettingsWidget::on_switch_adapter(String const& adapter)
void NetworkSettingsWidget::on_switch_adapter(DeprecatedString const& adapter)
{
auto& adapter_data = m_network_adapters.get(adapter).value();
m_current_adapter_data = &adapter_data;
@ -142,11 +142,11 @@ void NetworkSettingsWidget::apply_settings()
config_file->write_bool_entry(adapter_data.key, "DHCP", adapter_data.value.dhcp);
if (adapter_data.value.enabled && !adapter_data.value.dhcp) {
if (!IPv4Address::from_string(adapter_data.value.ip_address).has_value()) {
GUI::MessageBox::show_error(window(), String::formatted("Invalid IPv4 address for adapter {}", adapter_data.key));
GUI::MessageBox::show_error(window(), DeprecatedString::formatted("Invalid IPv4 address for adapter {}", adapter_data.key));
return;
}
if (!IPv4Address::from_string(adapter_data.value.default_gateway).has_value()) {
GUI::MessageBox::show_error(window(), String::formatted("Invalid IPv4 gateway for adapter {}", adapter_data.key));
GUI::MessageBox::show_error(window(), DeprecatedString::formatted("Invalid IPv4 gateway for adapter {}", adapter_data.key));
return;
}
}
@ -158,7 +158,7 @@ void NetworkSettingsWidget::apply_settings()
GUI::Process::spawn_or_show_error(window(), "/bin/NetworkServer"sv);
}
void NetworkSettingsWidget::switch_adapter(String const& adapter)
void NetworkSettingsWidget::switch_adapter(DeprecatedString const& adapter)
{
m_adapters_combobox->set_text(adapter, GUI::AllowCallback::No);
on_switch_adapter(adapter);