mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 06:17:34 +00:00
Userland: Prefer _string
over _short_string
As `_string` can't fail anymore (since 3434412
), there are no real
benefits to use the short variant in most cases.
This commit is contained in:
parent
a5edc9cdfc
commit
3f35ffb648
198 changed files with 684 additions and 684 deletions
|
@ -84,12 +84,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
set_window_frame_enabled(!hide_window_frame);
|
||||
show_window_frame_action->set_checked(window_frame_enabled);
|
||||
|
||||
auto file_menu = TRY(window->try_add_menu("&File"_short_string));
|
||||
auto file_menu = TRY(window->try_add_menu("&File"_string));
|
||||
TRY(file_menu->try_add_action(move(show_window_frame_action)));
|
||||
TRY(file_menu->try_add_separator());
|
||||
TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })));
|
||||
|
||||
auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
|
||||
auto help_menu = TRY(window->try_add_menu("&Help"_string));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_help_action([](auto&) {
|
||||
Desktop::Launcher::open(URL::create_with_file_scheme("/usr/share/man/man1/Applications/Eyes.md"), "/bin/Help");
|
||||
|
|
|
@ -197,7 +197,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
window->set_resizable(false);
|
||||
window->resize(WIDTH, HEIGHT);
|
||||
|
||||
auto file_menu = TRY(window->try_add_menu("&File"_short_string));
|
||||
auto file_menu = TRY(window->try_add_menu("&File"_string));
|
||||
TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })));
|
||||
|
||||
auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-libgfx-demo"sv));
|
||||
|
|
|
@ -116,7 +116,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
window->set_resizable(false);
|
||||
window->resize(WIDTH * 2, HEIGHT * 3);
|
||||
|
||||
auto file_menu = TRY(window->try_add_menu("&File"_short_string));
|
||||
auto file_menu = TRY(window->try_add_menu("&File"_string));
|
||||
TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })));
|
||||
|
||||
auto app_icon = TRY(GUI::Icon::try_create_default_icon("app-libgfx-demo"sv));
|
||||
|
|
|
@ -413,9 +413,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
window->resize(window->minimum_size() * 2);
|
||||
auto mandelbrot = TRY(window->set_main_widget<Mandelbrot>());
|
||||
|
||||
auto file_menu = TRY(window->try_add_menu("&File"_short_string));
|
||||
auto file_menu = TRY(window->try_add_menu("&File"_string));
|
||||
|
||||
auto& export_submenu = file_menu->add_submenu("&Export"_short_string);
|
||||
auto& export_submenu = file_menu->add_submenu("&Export"_string);
|
||||
|
||||
TRY(export_submenu.try_add_action(GUI::Action::create("As &BMP...",
|
||||
[&](GUI::Action&) {
|
||||
|
@ -469,12 +469,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
auto app_icon = GUI::Icon::default_icon("app-mandelbrot"sv);
|
||||
window->set_icon(app_icon.bitmap_for_size(16));
|
||||
|
||||
auto view_menu = TRY(window->try_add_menu("&View"_short_string));
|
||||
auto view_menu = TRY(window->try_add_menu("&View"_string));
|
||||
TRY(view_menu->try_add_action(zoom_in_action));
|
||||
TRY(view_menu->try_add_action(reset_zoom_action));
|
||||
TRY(view_menu->try_add_action(zoom_out_action));
|
||||
|
||||
auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
|
||||
auto help_menu = TRY(window->try_add_menu("&Help"_string));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Mandelbrot Demo", app_icon, window)));
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ public:
|
|||
|
||||
virtual int row_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return m_items.size(); }
|
||||
virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return 1; }
|
||||
virtual ErrorOr<String> column_name(int) const override { return "Item"_short_string; }
|
||||
virtual ErrorOr<String> column_name(int) const override { return "Item"_string; }
|
||||
|
||||
virtual GUI::Variant data(GUI::ModelIndex const&, GUI::ModelRole = GUI::ModelRole::Display) const override;
|
||||
virtual GUI::Model::MatchResult data_matches(GUI::ModelIndex const&, GUI::Variant const&) const override;
|
||||
|
|
|
@ -76,12 +76,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
window->set_title("Screensaver");
|
||||
window->resize(360, 240);
|
||||
|
||||
auto file_menu = TRY(window->try_add_menu("&File"_short_string));
|
||||
auto file_menu = TRY(window->try_add_menu("&File"_string));
|
||||
file_menu->add_action(GUI::CommonActions::make_quit_action([&](auto&) {
|
||||
app->quit();
|
||||
}));
|
||||
|
||||
auto help_menu = TRY(window->try_add_menu("&Help"_short_string));
|
||||
auto help_menu = TRY(window->try_add_menu("&Help"_string));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_command_palette_action(window)));
|
||||
TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Screensaver", app_icon, window)));
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
case Column::Bitmap:
|
||||
return String {};
|
||||
case Column::Name:
|
||||
return "Name"_short_string;
|
||||
return "Name"_string;
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ public:
|
|||
case Column::LittleIcon:
|
||||
return String {};
|
||||
case Column::Name:
|
||||
return "Name"_short_string;
|
||||
return "Name"_string;
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ GalleryWidget::GalleryWidget()
|
|||
|
||||
auto& tab_widget = *find_descendant_of_type_named<GUI::TabWidget>("tab_widget");
|
||||
|
||||
auto basics_tab = tab_widget.try_add_tab<GUI::Widget>("Basics"_short_string).release_value_but_fixme_should_propagate_errors();
|
||||
auto basics_tab = tab_widget.try_add_tab<GUI::Widget>("Basics"_string).release_value_but_fixme_should_propagate_errors();
|
||||
basics_tab->load_from_gml(basics_tab_gml).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
m_enabled_label = basics_tab->find_descendant_of_type_named<GUI::Label>("enabled_label");
|
||||
|
@ -160,7 +160,7 @@ GalleryWidget::GalleryWidget()
|
|||
GUI::MessageBox::show(window(), m_text_editor->text(), "Message"sv, m_msgbox_type, m_msgbox_input_type);
|
||||
};
|
||||
|
||||
auto sliders_tab = tab_widget.try_add_tab<GUI::Widget>("Sliders"_short_string).release_value_but_fixme_should_propagate_errors();
|
||||
auto sliders_tab = tab_widget.try_add_tab<GUI::Widget>("Sliders"_string).release_value_but_fixme_should_propagate_errors();
|
||||
sliders_tab->load_from_gml(sliders_tab_gml).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
m_vertical_progressbar_left = sliders_tab->find_descendant_of_type_named<GUI::VerticalProgressbar>("vertical_progressbar_left");
|
||||
|
@ -221,7 +221,7 @@ GalleryWidget::GalleryWidget()
|
|||
m_opacity_slider->set_value(percent);
|
||||
};
|
||||
|
||||
auto wizards_tab = tab_widget.try_add_tab<GUI::Widget>("Wizards"_short_string).release_value_but_fixme_should_propagate_errors();
|
||||
auto wizards_tab = tab_widget.try_add_tab<GUI::Widget>("Wizards"_string).release_value_but_fixme_should_propagate_errors();
|
||||
wizards_tab->load_from_gml(wizards_tab_gml).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
m_wizard_button = wizards_tab->find_descendant_of_type_named<GUI::Button>("wizard_button");
|
||||
|
@ -277,7 +277,7 @@ GalleryWidget::GalleryWidget()
|
|||
m_wizard_output->set_text(sb.string_view());
|
||||
};
|
||||
|
||||
auto cursors_tab = tab_widget.try_add_tab<GUI::Widget>("Cursors"_short_string).release_value_but_fixme_should_propagate_errors();
|
||||
auto cursors_tab = tab_widget.try_add_tab<GUI::Widget>("Cursors"_string).release_value_but_fixme_should_propagate_errors();
|
||||
cursors_tab->load_from_gml(cursors_tab_gml).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
m_cursors_tableview = cursors_tab->find_descendant_of_type_named<GUI::TableView>("cursors_tableview");
|
||||
|
@ -300,7 +300,7 @@ GalleryWidget::GalleryWidget()
|
|||
m_cursors_tableview->set_override_cursor(NonnullRefPtr<Gfx::Bitmap const>(icon_index.data().as_bitmap()));
|
||||
};
|
||||
|
||||
auto icons_tab = tab_widget.try_add_tab<GUI::Widget>("Icons"_short_string).release_value_but_fixme_should_propagate_errors();
|
||||
auto icons_tab = tab_widget.try_add_tab<GUI::Widget>("Icons"_string).release_value_but_fixme_should_propagate_errors();
|
||||
icons_tab->load_from_gml(icons_tab_gml).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
m_icons_tableview = icons_tab->find_descendant_of_type_named<GUI::TableView>("icons_tableview");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue