mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 17:17:45 +00:00
Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
This commit is contained in:
parent
e5f09ea170
commit
3f3f45580a
762 changed files with 8315 additions and 8316 deletions
|
@ -17,10 +17,10 @@
|
|||
|
||||
void MailSettingsWidget::reset_default_values()
|
||||
{
|
||||
m_server_inputbox->set_text("");
|
||||
m_port_combobox->set_text("993");
|
||||
m_server_inputbox->set_text(""sv);
|
||||
m_port_combobox->set_text("993"sv);
|
||||
m_tls_checkbox->set_checked(false);
|
||||
m_email_inputbox->set_text("");
|
||||
m_email_inputbox->set_text(""sv);
|
||||
}
|
||||
|
||||
void MailSettingsWidget::apply_settings()
|
||||
|
@ -30,10 +30,10 @@ void MailSettingsWidget::apply_settings()
|
|||
m_tls = m_tls_checkbox->is_checked();
|
||||
m_email = m_email_inputbox->get_text();
|
||||
|
||||
Config::write_string("Mail", "Connection", "Server", m_server);
|
||||
Config::write_string("Mail", "Connection", "Port", m_port);
|
||||
Config::write_bool("Mail", "Connection", "TLS", m_tls);
|
||||
Config::write_string("Mail", "User", "Username", m_email);
|
||||
Config::write_string("Mail"sv, "Connection"sv, "Server"sv, m_server);
|
||||
Config::write_string("Mail"sv, "Connection"sv, "Port"sv, m_port);
|
||||
Config::write_bool("Mail"sv, "Connection"sv, "TLS"sv, m_tls);
|
||||
Config::write_string("Mail"sv, "User"sv, "Username"sv, m_email);
|
||||
}
|
||||
|
||||
MailSettingsWidget::MailSettingsWidget()
|
||||
|
@ -45,13 +45,13 @@ MailSettingsWidget::MailSettingsWidget()
|
|||
load_from_gml(mail_settings_widget_gml);
|
||||
|
||||
m_server_inputbox = *find_descendant_of_type_named<GUI::TextBox>("server_input");
|
||||
m_server_inputbox->set_text(Config::read_string("Mail", "Connection", "Server", ""));
|
||||
m_server_inputbox->set_text(Config::read_string("Mail"sv, "Connection"sv, "Server"sv, ""sv));
|
||||
m_server_inputbox->on_change = [&]() {
|
||||
set_modified(true);
|
||||
};
|
||||
|
||||
m_port_combobox = *find_descendant_of_type_named<GUI::ComboBox>("port_input");
|
||||
m_port_combobox->set_text(Config::read_string("Mail", "Connection", "Port", "993"));
|
||||
m_port_combobox->set_text(Config::read_string("Mail"sv, "Connection"sv, "Port"sv, "993"sv));
|
||||
m_port_combobox->set_only_allow_values_from_model(false);
|
||||
m_port_combobox->set_model(*GUI::ItemListModel<String>::create(m_common_ports));
|
||||
m_port_combobox->on_change = [&](auto, auto) {
|
||||
|
@ -59,13 +59,13 @@ MailSettingsWidget::MailSettingsWidget()
|
|||
};
|
||||
|
||||
m_tls_checkbox = *find_descendant_of_type_named<GUI::CheckBox>("tls_input");
|
||||
m_tls_checkbox->set_checked(Config::read_bool("Mail", "Connection", "TLS", false));
|
||||
m_tls_checkbox->set_checked(Config::read_bool("Mail"sv, "Connection"sv, "TLS"sv, false));
|
||||
m_tls_checkbox->on_checked = [&](auto) {
|
||||
set_modified(true);
|
||||
};
|
||||
|
||||
m_email_inputbox = *find_descendant_of_type_named<GUI::TextBox>("email_input");
|
||||
m_email_inputbox->set_text(Config::read_string("Mail", "User", "Username", ""));
|
||||
m_email_inputbox->set_text(Config::read_string("Mail"sv, "User"sv, "Username"sv, ""sv));
|
||||
m_email_inputbox->on_change = [&]() {
|
||||
set_modified(true);
|
||||
};
|
||||
|
|
|
@ -31,10 +31,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::unveil("/res", "r"));
|
||||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
auto app_icon = GUI::Icon::default_icon("app-mail");
|
||||
auto app_icon = GUI::Icon::default_icon("app-mail"sv);
|
||||
|
||||
auto window = TRY(GUI::SettingsWindow::create("Mail Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes));
|
||||
(void)TRY(window->add_tab<MailSettingsWidget>("Mail", "mail"));
|
||||
(void)TRY(window->add_tab<MailSettingsWidget>("Mail"sv, "mail"sv));
|
||||
window->set_icon(app_icon.bitmap_for_size(16));
|
||||
window->set_active_tab(selected_tab);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue