mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
Everywhere: Use _{short_,}string to create Strings from literals
This commit is contained in:
parent
85414d9338
commit
09d40bfbb2
Notes:
sideshowbarker
2024-07-16 23:45:42 +09:00
Author: https://github.com/linusg
Commit: 09d40bfbb2
Pull-request: https://github.com/SerenityOS/serenity/pull/17619
Reviewed-by: https://github.com/AtkinsSJ
Reviewed-by: https://github.com/MacDue
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/trflynn89
92 changed files with 334 additions and 310 deletions
|
@ -43,7 +43,7 @@ ErrorOr<NonnullRefPtr<SettingsWindow>> SettingsWindow::create(DeprecatedString t
|
|||
TRY(button_container->try_set_layout<GUI::HorizontalBoxLayout>(GUI::Margins {}, 6));
|
||||
|
||||
if (show_defaults_button == ShowDefaultsButton::Yes) {
|
||||
window->m_reset_button = TRY(button_container->try_add<GUI::DialogButton>(TRY(String::from_utf8("Defaults"sv))));
|
||||
window->m_reset_button = TRY(button_container->try_add<GUI::DialogButton>(TRY("Defaults"_string)));
|
||||
window->m_reset_button->on_click = [window = window->make_weak_ptr<SettingsWindow>()](auto) {
|
||||
window->reset_default_values();
|
||||
};
|
||||
|
@ -51,19 +51,19 @@ ErrorOr<NonnullRefPtr<SettingsWindow>> SettingsWindow::create(DeprecatedString t
|
|||
|
||||
TRY(button_container->add_spacer());
|
||||
|
||||
window->m_ok_button = TRY(button_container->try_add<GUI::DialogButton>(String::from_utf8_short_string("OK"sv)));
|
||||
window->m_ok_button = TRY(button_container->try_add<GUI::DialogButton>("OK"_short_string));
|
||||
window->m_ok_button->on_click = [window = window->make_weak_ptr<SettingsWindow>()](auto) {
|
||||
window->apply_settings();
|
||||
GUI::Application::the()->quit();
|
||||
};
|
||||
|
||||
window->m_cancel_button = TRY(button_container->try_add<GUI::DialogButton>(String::from_utf8_short_string("Cancel"sv)));
|
||||
window->m_cancel_button = TRY(button_container->try_add<GUI::DialogButton>("Cancel"_short_string));
|
||||
window->m_cancel_button->on_click = [window = window->make_weak_ptr<SettingsWindow>()](auto) {
|
||||
window->cancel_settings();
|
||||
GUI::Application::the()->quit();
|
||||
};
|
||||
|
||||
window->m_apply_button = TRY(button_container->try_add<GUI::DialogButton>(String::from_utf8_short_string("Apply"sv)));
|
||||
window->m_apply_button = TRY(button_container->try_add<GUI::DialogButton>("Apply"_short_string));
|
||||
window->m_apply_button->set_enabled(false);
|
||||
window->m_apply_button->on_click = [window = window->make_weak_ptr<SettingsWindow>()](auto) {
|
||||
window->apply_settings();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue