diff options
author | sin-ack <sin-ack@users.noreply.github.com> | 2022-07-11 17:32:29 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-12 23:11:35 +0200 |
commit | 3f3f45580ab7266258e97cb3cecf1e24716d61c5 (patch) | |
tree | 152c7a187c98184d58bf91a326357e0af435edcf /Userland/Libraries/LibGUI | |
parent | e5f09ea1703bacfbb79a4ad3c587a7d5d3d7bb13 (diff) | |
download | serenity-3f3f45580ab7266258e97cb3cecf1e24716d61c5.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibGUI')
43 files changed, 152 insertions, 152 deletions
diff --git a/Userland/Libraries/LibGUI/AboutDialog.cpp b/Userland/Libraries/LibGUI/AboutDialog.cpp index 1d86433364..9bbbdfa83c 100644 --- a/Userland/Libraries/LibGUI/AboutDialog.cpp +++ b/Userland/Libraries/LibGUI/AboutDialog.cpp @@ -36,7 +36,7 @@ AboutDialog::AboutDialog(StringView name, Gfx::Bitmap const* icon, Window* paren widget.layout()->set_spacing(0); auto& banner_image = widget.add<GUI::ImageWidget>(); - banner_image.load_from_file("/res/graphics/brand-banner.png"); + banner_image.load_from_file("/res/graphics/brand-banner.png"sv); auto& content_container = widget.add<Widget>(); content_container.set_layout<HorizontalBoxLayout>(); @@ -69,9 +69,9 @@ AboutDialog::AboutDialog(StringView name, Gfx::Bitmap const* icon, Window* paren make_label(m_name, true); // If we are displaying a dialog for an application, insert 'SerenityOS' below the application name if (m_name != "SerenityOS") - make_label("SerenityOS"); + make_label("SerenityOS"sv); make_label(m_version_string); - make_label("Copyright \xC2\xA9 the SerenityOS developers, 2018-2022"); + make_label("Copyright \xC2\xA9 the SerenityOS developers, 2018-2022"sv); right_container.layout()->add_spacer(); diff --git a/Userland/Libraries/LibGUI/AbstractTableView.cpp b/Userland/Libraries/LibGUI/AbstractTableView.cpp index ba9ff35060..eba13fdbeb 100644 --- a/Userland/Libraries/LibGUI/AbstractTableView.cpp +++ b/Userland/Libraries/LibGUI/AbstractTableView.cpp @@ -60,7 +60,7 @@ void AbstractTableView::auto_resize_column(int column) int header_width = m_column_header->font().width(model.column_name(column)); if (column == m_key_column && model.is_column_sortable(column)) - header_width += font().width(" \xE2\xAC\x86"); + header_width += font().width(" \xE2\xAC\x86"sv); int column_width = header_width; bool is_empty = true; @@ -99,7 +99,7 @@ void AbstractTableView::update_column_sizes() continue; int header_width = m_column_header->font().width(model.column_name(column)); if (column == m_key_column && model.is_column_sortable(column)) - header_width += font().width(" \xE2\xAC\x86"); // UPWARDS BLACK ARROW + header_width += font().width(" \xE2\xAC\x86"sv); // UPWARDS BLACK ARROW int column_width = header_width; for (int row = 0; row < row_count; ++row) { auto cell_data = model.index(row, column).data(); diff --git a/Userland/Libraries/LibGUI/AbstractThemePreview.cpp b/Userland/Libraries/LibGUI/AbstractThemePreview.cpp index 743ce60a0e..e1cea74089 100644 --- a/Userland/Libraries/LibGUI/AbstractThemePreview.cpp +++ b/Userland/Libraries/LibGUI/AbstractThemePreview.cpp @@ -21,12 +21,12 @@ namespace GUI { AbstractThemePreview::AbstractThemePreview(Gfx::Palette const& preview_palette) : m_preview_palette(preview_palette) { - m_active_window_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/window.png").release_value_but_fixme_should_propagate_errors(); - m_inactive_window_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/window.png").release_value_but_fixme_should_propagate_errors(); + m_active_window_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/window.png"sv).release_value_but_fixme_should_propagate_errors(); + m_inactive_window_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/window.png"sv).release_value_but_fixme_should_propagate_errors(); - m_default_close_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/window-close.png").release_value_but_fixme_should_propagate_errors(); - m_default_maximize_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/upward-triangle.png").release_value_but_fixme_should_propagate_errors(); - m_default_minimize_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/downward-triangle.png").release_value_but_fixme_should_propagate_errors(); + m_default_close_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/window-close.png"sv).release_value_but_fixme_should_propagate_errors(); + m_default_maximize_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/upward-triangle.png"sv).release_value_but_fixme_should_propagate_errors(); + m_default_minimize_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/downward-triangle.png"sv).release_value_but_fixme_should_propagate_errors(); VERIFY(m_active_window_icon); VERIFY(m_inactive_window_icon); diff --git a/Userland/Libraries/LibGUI/Application.cpp b/Userland/Libraries/LibGUI/Application.cpp index b9574e7f09..073cceab35 100644 --- a/Userland/Libraries/LibGUI/Application.cpp +++ b/Userland/Libraries/LibGUI/Application.cpp @@ -28,7 +28,7 @@ public: { m_label->set_text(Gfx::parse_ampersand_string(tooltip)); int tooltip_width = m_label->effective_min_size().width().as_int() + 10; - int line_count = m_label->text().count("\n"); + int line_count = m_label->text().count("\n"sv); int glyph_height = m_label->font().glyph_height(); int tooltip_height = glyph_height * (1 + line_count) + ((glyph_height + 1) / 2) * line_count + 8; diff --git a/Userland/Libraries/LibGUI/AutocompleteProvider.cpp b/Userland/Libraries/LibGUI/AutocompleteProvider.cpp index f2b82ac6f6..0d208f1598 100644 --- a/Userland/Libraries/LibGUI/AutocompleteProvider.cpp +++ b/Userland/Libraries/LibGUI/AutocompleteProvider.cpp @@ -52,13 +52,13 @@ public: if (index.column() == Column::Icon) { if (suggestion.language == CodeComprehension::Language::Cpp) { if (!s_cpp_identifier_icon) { - s_cpp_identifier_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/completion/cpp-identifier.png").release_value_but_fixme_should_propagate_errors(); + s_cpp_identifier_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/completion/cpp-identifier.png"sv).release_value_but_fixme_should_propagate_errors(); } return *s_cpp_identifier_icon; } if (suggestion.language == CodeComprehension::Language::Unspecified) { if (!s_unspecified_identifier_icon) { - s_unspecified_identifier_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/completion/unspecified-identifier.png").release_value_but_fixme_should_propagate_errors(); + s_unspecified_identifier_icon = Gfx::Bitmap::try_load_from_file("/res/icons/16x16/completion/unspecified-identifier.png"sv).release_value_but_fixme_should_propagate_errors(); } return *s_unspecified_identifier_icon; } diff --git a/Userland/Libraries/LibGUI/ColorPicker.cpp b/Userland/Libraries/LibGUI/ColorPicker.cpp index 2af591fde5..79aaa6ffbb 100644 --- a/Userland/Libraries/LibGUI/ColorPicker.cpp +++ b/Userland/Libraries/LibGUI/ColorPicker.cpp @@ -186,7 +186,7 @@ ColorPicker::ColorPicker(Color color, Window* parent_window, String title) : Dialog(parent_window) , m_color(color) { - set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/color-chooser.png").release_value_but_fixme_should_propagate_errors()); + set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/color-chooser.png"sv).release_value_but_fixme_should_propagate_errors()); set_title(title); set_resizable(false); resize(458, 326); diff --git a/Userland/Libraries/LibGUI/ColumnsView.cpp b/Userland/Libraries/LibGUI/ColumnsView.cpp index ce1cbef995..afd04ca201 100644 --- a/Userland/Libraries/LibGUI/ColumnsView.cpp +++ b/Userland/Libraries/LibGUI/ColumnsView.cpp @@ -23,7 +23,7 @@ static constexpr Gfx::CharacterBitmap s_arrow_bitmap { " ### " " ## " " # " - " ", + " "sv, 9, 9 }; diff --git a/Userland/Libraries/LibGUI/ComboBox.cpp b/Userland/Libraries/LibGUI/ComboBox.cpp index 4ec805d20b..90b4f7f37b 100644 --- a/Userland/Libraries/LibGUI/ComboBox.cpp +++ b/Userland/Libraries/LibGUI/ComboBox.cpp @@ -98,7 +98,7 @@ ComboBox::ComboBox() m_open_button = add<Button>(); m_open_button->set_button_style(Gfx::ButtonStyle::ThickCap); - m_open_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/downward-triangle.png").release_value_but_fixme_should_propagate_errors()); + m_open_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/downward-triangle.png"sv).release_value_but_fixme_should_propagate_errors()); m_open_button->set_focus_policy(GUI::FocusPolicy::NoFocus); m_open_button->on_click = [this](auto) { if (m_list_window->is_visible()) diff --git a/Userland/Libraries/LibGUI/CommandPalette.cpp b/Userland/Libraries/LibGUI/CommandPalette.cpp index d28ba7e74c..91616ff784 100644 --- a/Userland/Libraries/LibGUI/CommandPalette.cpp +++ b/Userland/Libraries/LibGUI/CommandPalette.cpp @@ -193,7 +193,7 @@ CommandPalette::CommandPalette(GUI::Window& parent_window, ScreenPosition screen m_table_view->set_column_headers_visible(false); m_filter_model = MUST(GUI::FilteringProxyModel::create(*m_model)); - m_filter_model->set_filter_term(""); + m_filter_model->set_filter_term(""sv); m_table_view->set_column_painting_delegate(0, make<ActionIconDelegate>()); m_table_view->set_model(*m_filter_model); diff --git a/Userland/Libraries/LibGUI/CommonActions.cpp b/Userland/Libraries/LibGUI/CommonActions.cpp index 3e23795ee4..883a74d5d7 100644 --- a/Userland/Libraries/LibGUI/CommonActions.cpp +++ b/Userland/Libraries/LibGUI/CommonActions.cpp @@ -27,71 +27,71 @@ NonnullRefPtr<Action> make_about_action(String const& app_name, Icon const& app_ NonnullRefPtr<Action> make_open_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("&Open...", { Mod_Ctrl, Key_O }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("&Open...", { Mod_Ctrl, Key_O }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Open an existing file"); return action; } NonnullRefPtr<Action> make_save_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("&Save", { Mod_Ctrl, Key_S }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/save.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("&Save", { Mod_Ctrl, Key_S }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/save.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Save the current file"); return action; } NonnullRefPtr<Action> make_save_as_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("Save &As...", { Mod_Ctrl | Mod_Shift, Key_S }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/save-as.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("Save &As...", { Mod_Ctrl | Mod_Shift, Key_S }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/save-as.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Save the current file with a new name"); return action; } NonnullRefPtr<Action> make_move_to_front_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("Move to &Front", { Mod_Ctrl | Mod_Shift, Key_Up }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/move-to-front.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("Move to &Front", { Mod_Ctrl | Mod_Shift, Key_Up }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/move-to-front.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Move to the top of the stack"); return action; } NonnullRefPtr<Action> make_move_to_back_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("Move to &Back", { Mod_Ctrl | Mod_Shift, Key_Down }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/move-to-back.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("Move to &Back", { Mod_Ctrl | Mod_Shift, Key_Down }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/move-to-back.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Move to the bottom of the stack"); return action; } NonnullRefPtr<Action> make_undo_action(Function<void(Action&)> callback, Core::Object* parent) { - return Action::create("&Undo", { Mod_Ctrl, Key_Z }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/undo.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return Action::create("&Undo", { Mod_Ctrl, Key_Z }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/undo.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_redo_action(Function<void(Action&)> callback, Core::Object* parent) { - return Action::create("&Redo", { Mod_Ctrl | Mod_Shift, Key_Z }, { Mod_Ctrl, Key_Y }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/redo.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return Action::create("&Redo", { Mod_Ctrl | Mod_Shift, Key_Z }, { Mod_Ctrl, Key_Y }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/redo.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_delete_action(Function<void(Action&)> callback, Core::Object* parent) { - return Action::create("&Delete", { Mod_None, Key_Delete }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/delete.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return Action::create("&Delete", { Mod_None, Key_Delete }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/delete.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_cut_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("Cu&t", { Mod_Ctrl, Key_X }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-cut.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("Cu&t", { Mod_Ctrl, Key_X }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-cut.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Cut to clipboard"); return action; } NonnullRefPtr<Action> make_copy_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("&Copy", { Mod_Ctrl, Key_C }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-copy.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("&Copy", { Mod_Ctrl, Key_C }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-copy.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Copy to clipboard"); return action; } NonnullRefPtr<Action> make_paste_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("&Paste", { Mod_Ctrl, Key_V }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/paste.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("&Paste", { Mod_Ctrl, Key_V }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/paste.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Paste from clipboard"); return action; } @@ -100,7 +100,7 @@ NonnullRefPtr<Action> make_fullscreen_action(Function<void(Action&)> callback, C { auto action = Action::create("&Fullscreen", { Mod_None, Key_F11 }, move(callback), parent); action->set_status_tip("Enter fullscreen mode"); - action->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/fullscreen.png").release_value_but_fixme_should_propagate_errors()); + action->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/fullscreen.png"sv).release_value_but_fixme_should_propagate_errors()); return action; } @@ -113,80 +113,80 @@ NonnullRefPtr<Action> make_quit_action(Function<void(Action&)> callback) NonnullRefPtr<Action> make_help_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("&Manual", { Mod_None, Key_F1 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-help.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("&Manual", { Mod_None, Key_F1 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-help.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Show help contents"); return action; } NonnullRefPtr<Action> make_go_back_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("Go &Back", { Mod_Alt, Key_Left }, { MouseButton::Backward }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-back.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("Go &Back", { Mod_Alt, Key_Left }, { MouseButton::Backward }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-back.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Move one step backward in history"); return action; } NonnullRefPtr<Action> make_go_forward_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("Go &Forward", { Mod_Alt, Key_Right }, { MouseButton::Forward }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("Go &Forward", { Mod_Alt, Key_Right }, { MouseButton::Forward }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-forward.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Move one step forward in history"); return action; } NonnullRefPtr<Action> make_go_home_action(Function<void(Action&)> callback, Core::Object* parent) { - return Action::create("Go &Home", { Mod_Alt, Key_Home }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-home.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return Action::create("Go &Home", { Mod_Alt, Key_Home }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-home.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_close_tab_action(Function<void(Action&)> callback, Core::Object* parent) { - auto action = Action::create("&Close Tab", { Mod_Ctrl, Key_W }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/close-tab.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + auto action = Action::create("&Close Tab", { Mod_Ctrl, Key_W }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/close-tab.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); action->set_status_tip("Close current tab"); return action; } NonnullRefPtr<Action> make_reload_action(Function<void(Action&)> callback, Core::Object* parent) { - return Action::create("&Reload", { Mod_Ctrl, Key_R }, Key_F5, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/reload.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return Action::create("&Reload", { Mod_Ctrl, Key_R }, Key_F5, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/reload.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_select_all_action(Function<void(Action&)> callback, Core::Object* parent) { - return Action::create("Select &All", { Mod_Ctrl, Key_A }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/select-all.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return Action::create("Select &All", { Mod_Ctrl, Key_A }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/select-all.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_rename_action(Function<void(Action&)> callback, Core::Object* parent) { - return Action::create("Re&name", Key_F2, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/rename.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return Action::create("Re&name", Key_F2, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/rename.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_properties_action(Function<void(Action&)> callback, Core::Object* parent) { - return Action::create("P&roperties", { Mod_Alt, Key_Return }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/properties.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return Action::create("P&roperties", { Mod_Alt, Key_Return }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/properties.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_zoom_in_action(Function<void(Action&)> callback, Core::Object* parent) { - return GUI::Action::create("Zoom &In", { Mod_Ctrl, Key_Equal }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/zoom-in.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return GUI::Action::create("Zoom &In", { Mod_Ctrl, Key_Equal }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/zoom-in.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_reset_zoom_action(Function<void(Action&)> callback, Core::Object* parent) { - return GUI::Action::create("&Reset Zoom", { Mod_Ctrl, Key_0 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/zoom-reset.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return GUI::Action::create("&Reset Zoom", { Mod_Ctrl, Key_0 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/zoom-reset.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_zoom_out_action(Function<void(Action&)> callback, Core::Object* parent) { - return GUI::Action::create("Zoom &Out", { Mod_Ctrl, Key_Minus }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/zoom-out.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return GUI::Action::create("Zoom &Out", { Mod_Ctrl, Key_Minus }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/zoom-out.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_rotate_clockwise_action(Function<void(Action&)> callback, Core::Object* parent) { - return GUI::Action::create("Rotate Clock&wise", { Mod_Ctrl | Mod_Shift, Key_GreaterThan }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-rotate-cw.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return GUI::Action::create("Rotate Clock&wise", { Mod_Ctrl | Mod_Shift, Key_GreaterThan }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-rotate-cw.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } NonnullRefPtr<Action> make_rotate_counterclockwise_action(Function<void(Action&)> callback, Core::Object* parent) { - return GUI::Action::create("Rotate &Counterclockwise", { Mod_Ctrl | Mod_Shift, Key_LessThan }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-rotate-ccw.png").release_value_but_fixme_should_propagate_errors(), move(callback), parent); + return GUI::Action::create("Rotate &Counterclockwise", { Mod_Ctrl | Mod_Shift, Key_LessThan }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/edit-rotate-ccw.png"sv).release_value_but_fixme_should_propagate_errors(), move(callback), parent); } } diff --git a/Userland/Libraries/LibGUI/CommonLocationsProvider.cpp b/Userland/Libraries/LibGUI/CommonLocationsProvider.cpp index a06a32f7b4..3e54777ad9 100644 --- a/Userland/Libraries/LibGUI/CommonLocationsProvider.cpp +++ b/Userland/Libraries/LibGUI/CommonLocationsProvider.cpp @@ -61,8 +61,8 @@ void CommonLocationsProvider::load_from_json(String const& json_path) if (!entry_value.is_object()) continue; auto entry = entry_value.as_object(); - auto name = entry.get("name").to_string(); - auto path = entry.get("path").to_string(); + auto name = entry.get("name"sv).to_string(); + auto path = entry.get("path"sv).to_string(); s_common_locations.append({ name, path }); } diff --git a/Userland/Libraries/LibGUI/Desktop.cpp b/Userland/Libraries/LibGUI/Desktop.cpp index 74e443557c..cb99deaf5b 100644 --- a/Userland/Libraries/LibGUI/Desktop.cpp +++ b/Userland/Libraries/LibGUI/Desktop.cpp @@ -53,7 +53,7 @@ void Desktop::set_wallpaper_mode(StringView mode) String Desktop::wallpaper_path() const { - return Config::read_string("WindowManager", "Background", "Wallpaper"); + return Config::read_string("WindowManager"sv, "Background"sv, "Wallpaper"sv); } RefPtr<Gfx::Bitmap> Desktop::wallpaper_bitmap() const @@ -72,7 +72,7 @@ bool Desktop::set_wallpaper(RefPtr<Gfx::Bitmap> wallpaper_bitmap, Optional<Strin if (ret_val && path.has_value()) { dbgln("Saving wallpaper path '{}' to ConfigServer", *path); - Config::write_string("WindowManager", "Background", "Wallpaper", *path); + Config::write_string("WindowManager"sv, "Background"sv, "Wallpaper"sv, *path); } return ret_val; diff --git a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp index bb441808e5..caa60b9b98 100644 --- a/Userland/Libraries/LibGUI/EmojiInputDialog.cpp +++ b/Userland/Libraries/LibGUI/EmojiInputDialog.cpp @@ -28,7 +28,7 @@ static Vector<u32> supported_emoji_code_points() if (lexical_path.extension() != "png") continue; auto basename = lexical_path.basename(); - if (!basename.starts_with("U+")) + if (!basename.starts_with("U+"sv)) continue; // FIXME: Handle multi code point emojis. if (basename.contains('_')) diff --git a/Userland/Libraries/LibGUI/Event.h b/Userland/Libraries/LibGUI/Event.h index 8a1afddfd6..a4d801edfb 100644 --- a/Userland/Libraries/LibGUI/Event.h +++ b/Userland/Libraries/LibGUI/Event.h @@ -559,17 +559,17 @@ inline StringView mouse_button_to_string(MouseButton key) { switch (key) { case MouseButton::None: - return "None"; + return "None"sv; case MouseButton::Primary: - return "Primary"; + return "Primary"sv; case MouseButton::Secondary: - return "Secondary"; + return "Secondary"sv; case MouseButton::Middle: - return "Middle"; + return "Middle"sv; case MouseButton::Backward: - return "Backward"; + return "Backward"sv; case MouseButton::Forward: - return "Forward"; + return "Forward"sv; default: VERIFY_NOT_REACHED(); } diff --git a/Userland/Libraries/LibGUI/FileIconProvider.cpp b/Userland/Libraries/LibGUI/FileIconProvider.cpp index 495cae5b3f..7684d52fe2 100644 --- a/Userland/Libraries/LibGUI/FileIconProvider.cpp +++ b/Userland/Libraries/LibGUI/FileIconProvider.cpp @@ -48,7 +48,7 @@ static void initialize_executable_icon_if_needed() if (initialized) return; initialized = true; - s_executable_icon = Icon::default_icon("filetype-executable"); + s_executable_icon = Icon::default_icon("filetype-executable"sv); } static void initialize_filetype_image_icon_if_needed() @@ -57,7 +57,7 @@ static void initialize_filetype_image_icon_if_needed() if (initialized) return; initialized = true; - s_filetype_image_icon = Icon::default_icon("filetype-image"); + s_filetype_image_icon = Icon::default_icon("filetype-image"sv); } static void initialize_if_needed() @@ -68,19 +68,19 @@ static void initialize_if_needed() auto config = Core::ConfigFile::open("/etc/FileIconProvider.ini").release_value_but_fixme_should_propagate_errors(); - s_symlink_emblem = Gfx::Bitmap::try_load_from_file("/res/icons/symlink-emblem.png").release_value_but_fixme_should_propagate_errors(); - s_symlink_emblem_small = Gfx::Bitmap::try_load_from_file("/res/icons/symlink-emblem-small.png").release_value_but_fixme_should_propagate_errors(); + s_symlink_emblem = Gfx::Bitmap::try_load_from_file("/res/icons/symlink-emblem.png"sv).release_value_but_fixme_should_propagate_errors(); + s_symlink_emblem_small = Gfx::Bitmap::try_load_from_file("/res/icons/symlink-emblem-small.png"sv).release_value_but_fixme_should_propagate_errors(); - s_hard_disk_icon = Icon::default_icon("hard-disk"); - s_directory_icon = Icon::default_icon("filetype-folder"); - s_directory_open_icon = Icon::default_icon("filetype-folder-open"); - s_inaccessible_directory_icon = Icon::default_icon("filetype-folder-inaccessible"); - s_home_directory_icon = Icon::default_icon("home-directory"); - s_home_directory_open_icon = Icon::default_icon("home-directory-open"); - s_desktop_directory_icon = Icon::default_icon("desktop"); - s_file_icon = Icon::default_icon("filetype-unknown"); - s_symlink_icon = Icon::default_icon("filetype-symlink"); - s_socket_icon = Icon::default_icon("filetype-socket"); + s_hard_disk_icon = Icon::default_icon("hard-disk"sv); + s_directory_icon = Icon::default_icon("filetype-folder"sv); + s_directory_open_icon = Icon::default_icon("filetype-folder-open"sv); + s_inaccessible_directory_icon = Icon::default_icon("filetype-folder-inaccessible"sv); + s_home_directory_icon = Icon::default_icon("home-directory"sv); + s_home_directory_open_icon = Icon::default_icon("home-directory-open"sv); + s_desktop_directory_icon = Icon::default_icon("desktop"sv); + s_file_icon = Icon::default_icon("filetype-unknown"sv); + s_symlink_icon = Icon::default_icon("filetype-symlink"sv); + s_socket_icon = Icon::default_icon("filetype-socket"sv); initialize_filetype_image_icon_if_needed(); initialize_executable_icon_if_needed(); @@ -176,13 +176,13 @@ Icon FileIconProvider::icon_for_executable(String const& path) // If any of the required sections are missing then use the defaults Icon icon; struct IconSection { - char const* section_name; + StringView section_name; int image_size; }; static constexpr Array<IconSection, 2> icon_sections = { - IconSection { .section_name = "serenity_icon_s", .image_size = 16 }, - IconSection { .section_name = "serenity_icon_m", .image_size = 32 } + IconSection { .section_name = "serenity_icon_s"sv, .image_size = 16 }, + IconSection { .section_name = "serenity_icon_m"sv, .image_size = 32 } }; bool had_error = false; diff --git a/Userland/Libraries/LibGUI/FilePicker.cpp b/Userland/Libraries/LibGUI/FilePicker.cpp index f91c1c04cd..4be64268e7 100644 --- a/Userland/Libraries/LibGUI/FilePicker.cpp +++ b/Userland/Libraries/LibGUI/FilePicker.cpp @@ -34,7 +34,7 @@ namespace GUI { Optional<String> FilePicker::get_open_filepath(Window* parent_window, String const& window_title, StringView path, bool folder, ScreenPosition screen_position) { - auto picker = FilePicker::construct(parent_window, folder ? Mode::OpenFolder : Mode::Open, "", path, screen_position); + auto picker = FilePicker::construct(parent_window, folder ? Mode::OpenFolder : Mode::Open, ""sv, path, screen_position); if (!window_title.is_null()) picker->set_title(window_title); @@ -75,11 +75,11 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St case Mode::OpenMultiple: case Mode::OpenFolder: set_title("Open"); - set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open.png").release_value_but_fixme_should_propagate_errors()); + set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open.png"sv).release_value_but_fixme_should_propagate_errors()); break; case Mode::Save: set_title("Save as"); - set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/save-as.png").release_value_but_fixme_should_propagate_errors()); + set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/save-as.png"sv).release_value_but_fixme_should_propagate_errors()); break; } resize(560, 320); @@ -115,7 +115,7 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St }; auto open_parent_directory_action = Action::create( - "Open parent directory", { Mod_Alt, Key_Up }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open-parent-directory.png").release_value_but_fixme_should_propagate_errors(), [this](Action const&) { + "Open parent directory", { Mod_Alt, Key_Up }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/open-parent-directory.png"sv).release_value_but_fixme_should_propagate_errors(), [this](Action const&) { set_path(String::formatted("{}/..", m_model->root_path())); }, this); @@ -129,13 +129,13 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, StringView filename, St toolbar.add_separator(); auto mkdir_action = Action::create( - "New directory...", { Mod_Ctrl | Mod_Shift, Key_N }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/mkdir.png").release_value_but_fixme_should_propagate_errors(), [this](Action const&) { + "New directory...", { Mod_Ctrl | Mod_Shift, Key_N }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/mkdir.png"sv).release_value_but_fixme_should_propagate_errors(), [this](Action const&) { String value; - if (InputBox::show(this, value, "Enter name:", "New directory") == InputBox::ExecResult::OK && !value.is_empty()) { + if (InputBox::show(this, value, "Enter name:"sv, "New directory"sv) == InputBox::ExecResult::OK && !value.is_empty()) { auto new_dir_path = LexicalPath::canonicalized_path(String::formatted("{}/{}", m_model->root_path(), value)); int rc = mkdir(new_dir_path.characters(), 0777); if (rc < 0) { - MessageBox::show(this, String::formatted("mkdir(\"{}\") failed: {}", new_dir_path, strerror(errno)), "Error", MessageBox::Type::Error); + MessageBox::show(this, String::formatted("mkdir(\"{}\") failed: {}", new_dir_path, strerror(errno)), "Error"sv, MessageBox::Type::Error); } else { m_model->invalidate(); } @@ -272,12 +272,12 @@ void FilePicker::on_file_return() bool file_exists = Core::File::exists(path); if (!file_exists && (m_mode == Mode::Open || m_mode == Mode::OpenFolder)) { - MessageBox::show(this, String::formatted("No such file or directory: {}", m_filename_textbox->text()), "File not found", MessageBox::Type::Error, MessageBox::InputType::OK); + MessageBox::show(this, String::formatted("No such file or directory: {}", m_filename_textbox->text()), "File not found"sv, MessageBox::Type::Error, MessageBox::InputType::OK); return; } if (file_exists && m_mode == Mode::Save) { - auto result = MessageBox::show(this, "File already exists. Overwrite?", "Existing File", MessageBox::Type::Warning, MessageBox::InputType::OKCancel); + auto result = MessageBox::show(this, "File already exists. Overwrite?"sv, "Existing File"sv, MessageBox::Type::Warning, MessageBox::InputType::OKCancel); if (result == MessageBox::ExecResult::Cancel) return; } @@ -289,7 +289,7 @@ void FilePicker::on_file_return() void FilePicker::set_path(String const& path) { if (access(path.characters(), R_OK | X_OK) == -1) { - GUI::MessageBox::show(this, String::formatted("Could not open '{}':\n{}", path, strerror(errno)), "Error", GUI::MessageBox::Type::Error); + GUI::MessageBox::show(this, String::formatted("Could not open '{}':\n{}", path, strerror(errno)), "Error"sv, GUI::MessageBox::Type::Error); auto& common_locations_tray = *find_descendant_of_type_named<GUI::Tray>("common_locations_tray"); for (auto& location_button : m_common_location_buttons) common_locations_tray.set_item_checked(location_button.tray_item_index, m_model->root_path() == location_button.path); diff --git a/Userland/Libraries/LibGUI/FilePicker.h b/Userland/Libraries/LibGUI/FilePicker.h index 441cfeaefa..163082f537 100644 --- a/Userland/Libraries/LibGUI/FilePicker.h +++ b/Userland/Libraries/LibGUI/FilePicker.h @@ -43,7 +43,7 @@ private: // ^GUI::ModelClient virtual void model_did_update(unsigned) override; - FilePicker(Window* parent_window, Mode type = Mode::Open, StringView filename = "Untitled", StringView path = Core::StandardPaths::home_directory(), ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent); + FilePicker(Window* parent_window, Mode type = Mode::Open, StringView filename = "Untitled"sv, StringView path = Core::StandardPaths::home_directory(), ScreenPosition screen_position = Dialog::ScreenPosition::CenterWithinParent); static String ok_button_name(Mode mode) { diff --git a/Userland/Libraries/LibGUI/FileSystemModel.h b/Userland/Libraries/LibGUI/FileSystemModel.h index 7f7a4289a2..5d87f5c4f6 100644 --- a/Userland/Libraries/LibGUI/FileSystemModel.h +++ b/Userland/Libraries/LibGUI/FileSystemModel.h @@ -128,7 +128,7 @@ public: virtual Variant data(ModelIndex const&, ModelRole = ModelRole::Display) const override; virtual ModelIndex parent_index(ModelIndex const&) const override; virtual ModelIndex index(int row, int column = 0, ModelIndex const& parent = ModelIndex()) const override; - virtual StringView drag_data_type() const override { return "text/uri-list"; } + virtual StringView drag_data_type() const override { return "text/uri-list"sv; } virtual bool accepts_drag(ModelIndex const&, Vector<String> const& mime_types) const override; virtual bool is_column_sortable(int column_index) const override { return column_index != Column::Icon; } virtual bool is_editable(ModelIndex const&) const override; diff --git a/Userland/Libraries/LibGUI/FontPicker.cpp b/Userland/Libraries/LibGUI/FontPicker.cpp index bcb80fcdb5..665f4d6964 100644 --- a/Userland/Libraries/LibGUI/FontPicker.cpp +++ b/Userland/Libraries/LibGUI/FontPicker.cpp @@ -24,7 +24,7 @@ FontPicker::FontPicker(Window* parent_window, Gfx::Font const* current_font, boo { set_title("Font picker"); resize(430, 280); - set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-font-editor.png").release_value_but_fixme_should_propagate_errors()); + set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-font-editor.png"sv).release_value_but_fixme_should_propagate_errors()); auto& widget = set_main_widget<GUI::Widget>(); if (!widget.load_from_gml(font_picker_dialog_gml)) diff --git a/Userland/Libraries/LibGUI/GML/AST.h b/Userland/Libraries/LibGUI/GML/AST.h index f670ade835..ebcfc5a875 100644 --- a/Userland/Libraries/LibGUI/GML/AST.h +++ b/Userland/Libraries/LibGUI/GML/AST.h @@ -52,7 +52,7 @@ public: static void indent(StringBuilder& builder, size_t indentation) { for (size_t i = 0; i < indentation; ++i) - builder.append(" "); + builder.append(" "sv); } }; @@ -136,7 +136,7 @@ public: auto first = true; as_array().for_each([&](auto& value) { if (!first) - builder.append(", "); + builder.append(", "sv); first = false; value.serialize(builder); }); @@ -248,7 +248,7 @@ public: indent(builder, indentation); builder.append('@'); builder.append(m_name); - builder.append(" {"); + builder.append(" {"sv); if (!m_properties.is_empty() || !m_sub_objects.is_empty()) { builder.append('\n'); diff --git a/Userland/Libraries/LibGUI/GML/AutocompleteProvider.cpp b/Userland/Libraries/LibGUI/GML/AutocompleteProvider.cpp index c22ea26a53..38b0b14d7c 100644 --- a/Userland/Libraries/LibGUI/GML/AutocompleteProvider.cpp +++ b/Userland/Libraries/LibGUI/GML/AutocompleteProvider.cpp @@ -107,8 +107,8 @@ void AutocompleteProvider::provide_completions(Function<void(Vector<CodeComprehe state = previous_states.take_last(); } - auto& widget_class = *Core::ObjectClassRegistration::find("GUI::Widget"); - auto& layout_class = *Core::ObjectClassRegistration::find("GUI::Layout"); + auto& widget_class = *Core::ObjectClassRegistration::find("GUI::Widget"sv); + auto& layout_class = *Core::ObjectClassRegistration::find("GUI::Layout"sv); // FIXME: Can this be done without a StringBuilder? auto make_fuzzy = [](StringView str) { diff --git a/Userland/Libraries/LibGUI/HeaderView.cpp b/Userland/Libraries/LibGUI/HeaderView.cpp index 814206d12a..e596387906 100644 --- a/Userland/Libraries/LibGUI/HeaderView.cpp +++ b/Userland/Libraries/LibGUI/HeaderView.cpp @@ -269,9 +269,9 @@ void HeaderView::paint_horizontal(Painter& painter) StringBuilder builder; builder.append(model()->column_name(section)); if (m_table_view.sort_order() == SortOrder::Ascending) - builder.append(" \xE2\xAC\x86"); // UPWARDS BLACK ARROW + builder.append(" \xE2\xAC\x86"sv); // UPWARDS BLACK ARROW else if (m_table_view.sort_order() == SortOrder::Descending) - builder.append(" \xE2\xAC\x87"); // DOWNWARDS BLACK ARROW + builder.append(" \xE2\xAC\x87"sv); // DOWNWARDS BLACK ARROW text = builder.to_string(); } else { text = model()->column_name(section); diff --git a/Userland/Libraries/LibGUI/Layout.h b/Userland/Libraries/LibGUI/Layout.h index 0c61fe6271..b194e9dfa9 100644 --- a/Userland/Libraries/LibGUI/Layout.h +++ b/Userland/Libraries/LibGUI/Layout.h @@ -21,12 +21,12 @@ extern Core::ObjectClassRegistration registration_Layout; } } -#define REGISTER_LAYOUT(namespace_, class_name) \ - namespace Core { \ - namespace Registration { \ - Core::ObjectClassRegistration registration_##class_name( \ - #namespace_ "::" #class_name, []() { return static_ptr_cast<Core::Object>(namespace_::class_name::construct()); }, ®istration_Layout); \ - } \ +#define REGISTER_LAYOUT(namespace_, class_name) \ + namespace Core { \ + namespace Registration { \ + Core::ObjectClassRegistration registration_##class_name( \ + #namespace_ "::" #class_name##sv, []() { return static_ptr_cast<Core::Object>(namespace_::class_name::construct()); }, ®istration_Layout); \ + } \ } namespace GUI { diff --git a/Userland/Libraries/LibGUI/LinkLabel.cpp b/Userland/Libraries/LibGUI/LinkLabel.cpp index 14d6a54dd0..f7f8b1af43 100644 --- a/Userland/Libraries/LibGUI/LinkLabel.cpp +++ b/Userland/Libraries/LibGUI/LinkLabel.cpp @@ -29,7 +29,7 @@ LinkLabel::LinkLabel(String text) void LinkLabel::setup_actions() { - m_open_action = GUI::Action::create("Show in File Manager", {}, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-file-manager.png").release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) { + m_open_action = GUI::Action::create("Show in File Manager", {}, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-file-manager.png"sv).release_value_but_fixme_should_propagate_errors(), [&](const GUI::Action&) { if (on_click) on_click(); }); diff --git a/Userland/Libraries/LibGUI/MessageBox.cpp b/Userland/Libraries/LibGUI/MessageBox.cpp index 362b07ef39..178012e806 100644 --- a/Userland/Libraries/LibGUI/MessageBox.cpp +++ b/Userland/Libraries/LibGUI/MessageBox.cpp @@ -26,18 +26,18 @@ Dialog::ExecResult MessageBox::show(Window* parent_window, StringView text, Stri Dialog::ExecResult MessageBox::show_error(Window* parent_window, StringView text) { - return show(parent_window, text, "Error", GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK); + return show(parent_window, text, "Error"sv, GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK); } Dialog::ExecResult MessageBox::ask_about_unsaved_changes(Window* parent_window, StringView path, Optional<Time> last_unmodified_timestamp) { StringBuilder builder; - builder.append("Save changes to "); + builder.append("Save changes to "sv); if (path.is_empty()) - builder.append("untitled document"); + builder.append("untitled document"sv); else builder.appendff("\"{}\"", LexicalPath::basename(path)); - builder.append(" before closing?"); + builder.append(" before closing?"sv); if (!path.is_empty() && last_unmodified_timestamp.has_value()) { auto age = (Time::now_monotonic() - *last_unmodified_timestamp).to_seconds(); @@ -45,7 +45,7 @@ Dialog::ExecResult MessageBox::ask_about_unsaved_changes(Window* parent_window, builder.appendff("\nLast saved {} ago.", readable_time); } - auto box = MessageBox::construct(parent_window, builder.string_view(), "Unsaved changes", Type::Warning, InputType::YesNoCancel); + auto box = MessageBox::construct(parent_window, builder.string_view(), "Unsaved changes"sv, Type::Warning, InputType::YesNoCancel); if (parent_window) box->set_icon(parent_window->icon()); @@ -76,13 +76,13 @@ RefPtr<Gfx::Bitmap> MessageBox::icon() const { switch (m_type) { case Type::Information: - return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-information.png").release_value_but_fixme_should_propagate_errors(); + return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-information.png"sv).release_value_but_fixme_should_propagate_errors(); case Type::Warning: - return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-warning.png").release_value_but_fixme_should_propagate_errors(); + return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-warning.png"sv).release_value_but_fixme_should_propagate_errors(); case Type::Error: - return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-error.png").release_value_but_fixme_should_propagate_errors(); + return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-error.png"sv).release_value_but_fixme_should_propagate_errors(); case Type::Question: - return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-question.png").release_value_but_fixme_should_propagate_errors(); + return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-question.png"sv).release_value_but_fixme_should_propagate_errors(); default: return nullptr; } diff --git a/Userland/Libraries/LibGUI/Model.cpp b/Userland/Libraries/LibGUI/Model.cpp index 7ffa5c1fc4..b15f452cee 100644 --- a/Userland/Libraries/LibGUI/Model.cpp +++ b/Userland/Libraries/LibGUI/Model.cpp @@ -108,7 +108,7 @@ RefPtr<Core::MimeData> Model::mime_data(ModelSelection const& selection) const selection.for_each_index([&](auto& index) { auto text_data = index.data(); if (!first) - text_builder.append(", "); + text_builder.append(", "sv); text_builder.append(text_data.to_string()); if (!first) diff --git a/Userland/Libraries/LibGUI/ModelIndex.h b/Userland/Libraries/LibGUI/ModelIndex.h index c143f49ac1..d24122d0fc 100644 --- a/Userland/Libraries/LibGUI/ModelIndex.h +++ b/Userland/Libraries/LibGUI/ModelIndex.h @@ -69,8 +69,8 @@ struct Formatter<GUI::ModelIndex> : Formatter<FormatString> { ErrorOr<void> format(FormatBuilder& builder, GUI::ModelIndex const& value) { if (value.internal_data()) - return Formatter<FormatString>::format(builder, "ModelIndex({},{},{})", value.row(), value.column(), value.internal_data()); - return Formatter<FormatString>::format(builder, "ModelIndex({},{})", value.row(), value.column()); + return Formatter<FormatString>::format(builder, "ModelIndex({},{},{})"sv, value.row(), value.column(), value.internal_data()); + return Formatter<FormatString>::format(builder, "ModelIndex({},{})"sv, value.row(), value.column()); } }; diff --git a/Userland/Libraries/LibGUI/MultiView.cpp b/Userland/Libraries/LibGUI/MultiView.cpp index fff6f0e135..095510a3d0 100644 --- a/Userland/Libraries/LibGUI/MultiView.cpp +++ b/Userland/Libraries/LibGUI/MultiView.cpp @@ -101,19 +101,19 @@ void MultiView::set_column_visible(int column_index, bool visible) void MultiView::build_actions() { m_view_as_icons_action = Action::create_checkable( - "Icon view", { Mod_Ctrl, KeyCode::Key_1 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/icon-view.png").release_value_but_fixme_should_propagate_errors(), [this](auto&) { + "Icon view", { Mod_Ctrl, KeyCode::Key_1 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/icon-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { set_view_mode(ViewMode::Icon); }, this); m_view_as_table_action = Action::create_checkable( - "Table view", { Mod_Ctrl, KeyCode::Key_2 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/table-view.png").release_value_but_fixme_should_propagate_errors(), [this](auto&) { + "Table view", { Mod_Ctrl, KeyCode::Key_2 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/table-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { set_view_mode(ViewMode::Table); }, this); m_view_as_columns_action = Action::create_checkable( - "Columns view", { Mod_Ctrl, KeyCode::Key_3 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/columns-view.png").release_value_but_fixme_should_propagate_errors(), [this](auto&) { + "Columns view", { Mod_Ctrl, KeyCode::Key_3 }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/columns-view.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { set_view_mode(ViewMode::Columns); }, this); diff --git a/Userland/Libraries/LibGUI/PasswordInputDialog.cpp b/Userland/Libraries/LibGUI/PasswordInputDialog.cpp index a961fe4108..3a8773fede 100644 --- a/Userland/Libraries/LibGUI/PasswordInputDialog.cpp +++ b/Userland/Libraries/LibGUI/PasswordInputDialog.cpp @@ -28,7 +28,7 @@ PasswordInputDialog::PasswordInputDialog(Window* parent_window, String title, St auto& key_icon_label = *widget.find_descendant_of_type_named<GUI::Label>("key_icon_label"); - key_icon_label.set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/32x32/key.png").release_value_but_fixme_should_propagate_errors()); + key_icon_label.set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/32x32/key.png"sv).release_value_but_fixme_should_propagate_errors()); auto& server_label = *widget.find_descendant_of_type_named<GUI::Label>("server_label"); server_label.set_text(move(server)); diff --git a/Userland/Libraries/LibGUI/PersistentModelIndex.h b/Userland/Libraries/LibGUI/PersistentModelIndex.h index 5840010e49..0690ebd0de 100644 --- a/Userland/Libraries/LibGUI/PersistentModelIndex.h +++ b/Userland/Libraries/LibGUI/PersistentModelIndex.h @@ -76,7 +76,7 @@ template<> struct Formatter<GUI::PersistentModelIndex> : Formatter<FormatString> { ErrorOr<void> format(FormatBuilder& builder, GUI::PersistentModelIndex const& value) { - return Formatter<FormatString>::format(builder, "PersistentModelIndex({},{},{})", value.row(), value.column(), value.internal_data()); + return Formatter<FormatString>::format(builder, "PersistentModelIndex({},{},{})"sv, value.row(), value.column(), value.internal_data()); } }; diff --git a/Userland/Libraries/LibGUI/ProcessChooser.cpp b/Userland/Libraries/LibGUI/ProcessChooser.cpp index 6c5be287f0..246f507eca 100644 --- a/Userland/Libraries/LibGUI/ProcessChooser.cpp +++ b/Userland/Libraries/LibGUI/ProcessChooser.cpp @@ -56,7 +56,7 @@ ProcessChooser::ProcessChooser(StringView window_title, StringView button_label, select_button.set_fixed_width(80); select_button.on_click = [this](auto) { if (m_table_view->selection().is_empty()) { - GUI::MessageBox::show(this, "No process selected!", m_window_title, GUI::MessageBox::Type::Error); + GUI::MessageBox::show(this, "No process selected!"sv, m_window_title, GUI::MessageBox::Type::Error); return; } auto index = m_table_view->selection().first(); diff --git a/Userland/Libraries/LibGUI/ProcessChooser.h b/Userland/Libraries/LibGUI/ProcessChooser.h index e9467e5e1f..ac4b30dc80 100644 --- a/Userland/Libraries/LibGUI/ProcessChooser.h +++ b/Userland/Libraries/LibGUI/ProcessChooser.h @@ -22,7 +22,7 @@ public: pid_t pid() const { return m_pid; } private: - ProcessChooser(StringView window_title = "Process Chooser", StringView button_label = "Select", Gfx::Bitmap const* window_icon = nullptr, GUI::Window* parent_window = nullptr); + ProcessChooser(StringView window_title = "Process Chooser"sv, StringView button_label = "Select"sv, Gfx::Bitmap const* window_icon = nullptr, GUI::Window* parent_window = nullptr); void set_pid_from_index_and_close(ModelIndex const&); diff --git a/Userland/Libraries/LibGUI/ResizeCorner.cpp b/Userland/Libraries/LibGUI/ResizeCorner.cpp index 072b486cae..2b37546363 100644 --- a/Userland/Libraries/LibGUI/ResizeCorner.cpp +++ b/Userland/Libraries/LibGUI/ResizeCorner.cpp @@ -30,7 +30,7 @@ static constexpr Gfx::CharacterBitmap s_resize_corner_shadows_bitmap { " " " ## ## ## ## ## " " # # # # # " - " ", + " "sv, 16, 16 }; @@ -50,7 +50,7 @@ static constexpr Gfx::CharacterBitmap s_resize_corner_highlights_bitmap { " " " " " # # # # # " - " ", + " "sv, 16, 16 }; diff --git a/Userland/Libraries/LibGUI/SettingsWindow.cpp b/Userland/Libraries/LibGUI/SettingsWindow.cpp index efb4599bd6..17b5541756 100644 --- a/Userland/Libraries/LibGUI/SettingsWindow.cpp +++ b/Userland/Libraries/LibGUI/SettingsWindow.cpp @@ -75,7 +75,7 @@ ErrorOr<NonnullRefPtr<SettingsWindow>> SettingsWindow::create(String title, Show if (!window->is_modified()) return Window::CloseRequestDecision::Close; - auto result = MessageBox::show(window, "Apply these settings before closing?", "Unsaved changes", MessageBox::Type::Warning, MessageBox::InputType::YesNoCancel); + auto result = MessageBox::show(window, "Apply these settings before closing?"sv, "Unsaved changes"sv, MessageBox::Type::Warning, MessageBox::InputType::YesNoCancel); switch (result) { case MessageBox::ExecResult::Yes: window->apply_settings(); diff --git a/Userland/Libraries/LibGUI/SpinBox.cpp b/Userland/Libraries/LibGUI/SpinBox.cpp index ab98c62030..470a165f0e 100644 --- a/Userland/Libraries/LibGUI/SpinBox.cpp +++ b/Userland/Libraries/LibGUI/SpinBox.cpp @@ -18,7 +18,7 @@ SpinBox::SpinBox() set_min_size({ 40, 22 }); set_preferred_size({ SpecialDimension::OpportunisticGrow, 22 }); m_editor = add<TextBox>(); - m_editor->set_text("0"); + m_editor->set_text("0"sv); m_editor->on_change = [this, weak_this = make_weak_ptr()] { if (!weak_this) return; @@ -42,13 +42,13 @@ SpinBox::SpinBox() m_increment_button = add<Button>(); m_increment_button->set_button_style(Gfx::ButtonStyle::ThickCap); - m_increment_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/upward-triangle.png").release_value_but_fixme_should_propagate_errors()); + m_increment_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/upward-triangle.png"sv).release_value_but_fixme_should_propagate_errors()); m_increment_button->set_focus_policy(GUI::FocusPolicy::NoFocus); m_increment_button->on_click = [this](auto) { set_value(m_value + 1); }; m_increment_button->set_auto_repeat_interval(150); m_decrement_button = add<Button>(); m_decrement_button->set_button_style(Gfx::ButtonStyle::ThickCap); - m_decrement_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/downward-triangle.png").release_value_but_fixme_should_propagate_errors()); + m_decrement_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/downward-triangle.png"sv).release_value_but_fixme_should_propagate_errors()); m_decrement_button->set_focus_policy(GUI::FocusPolicy::NoFocus); m_decrement_button->on_click = [this](auto) { set_value(m_value - 1); }; m_decrement_button->set_auto_repeat_interval(150); diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp index 0bc89b95c7..2a0d5d76e1 100644 --- a/Userland/Libraries/LibGUI/TextEditor.cpp +++ b/Userland/Libraries/LibGUI/TextEditor.cpp @@ -89,12 +89,12 @@ void TextEditor::create_actions() m_cut_action->set_enabled(false); m_copy_action->set_enabled(false); m_paste_action = CommonActions::make_paste_action([&](auto&) { paste(); }, this); - m_paste_action->set_enabled(is_editable() && Clipboard::the().fetch_mime_type().starts_with("text/")); + m_paste_action->set_enabled(is_editable() && Clipboard::the().fetch_mime_type().starts_with("text/"sv)); if (is_multi_line()) { m_go_to_line_action = Action::create( - "Go to line...", { Mod_Ctrl, Key_L }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-to.png").release_value_but_fixme_should_propagate_errors(), [this](auto&) { + "Go to line...", { Mod_Ctrl, Key_L }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/go-to.png"sv).release_value_but_fixme_should_propagate_errors(), [this](auto&) { String value; - if (InputBox::show(window(), value, "Line:", "Go to line") == InputBox::ExecResult::OK) { + if (InputBox::show(window(), value, "Line:"sv, "Go to line"sv) == InputBox::ExecResult::OK) { auto line_target = value.to_uint(); if (line_target.has_value()) { set_cursor_and_focus_line(line_target.value() - 1, 0); @@ -1560,7 +1560,7 @@ void TextEditor::paste() return; auto [data, mime_type, _] = GUI::Clipboard::the().fetch_data_and_type(); - if (!mime_type.starts_with("text/")) + if (!mime_type.starts_with("text/"sv)) return; if (data.is_empty()) @@ -1953,8 +1953,8 @@ void TextEditor::document_did_update_undo_stack() m_undo_action->set_enabled(can_undo() && !text_is_secret()); m_redo_action->set_enabled(can_redo() && !text_is_secret()); - m_undo_action->set_text(make_action_text("&Undo", document().undo_stack().undo_action_text())); - m_redo_action->set_text(make_action_text("&Redo", document().undo_stack().redo_action_text())); + m_undo_action->set_text(make_action_text("&Undo"sv, document().undo_stack().undo_action_text())); + m_redo_action->set_text(make_action_text("&Redo"sv, document().undo_stack().redo_action_text())); // FIXME: This is currently firing more often than it should. // Ideally we'd only send this out when the undo stack modified state actually changes. @@ -1982,7 +1982,7 @@ void TextEditor::cursor_did_change() void TextEditor::clipboard_content_did_change(String const& mime_type) { - m_paste_action->set_enabled(is_editable() && mime_type.starts_with("text/")); + m_paste_action->set_enabled(is_editable() && mime_type.starts_with("text/"sv)); } void TextEditor::set_document(TextDocument& document) diff --git a/Userland/Libraries/LibGUI/TextPosition.h b/Userland/Libraries/LibGUI/TextPosition.h index c6b0bf0225..991adaf68f 100644 --- a/Userland/Libraries/LibGUI/TextPosition.h +++ b/Userland/Libraries/LibGUI/TextPosition.h @@ -45,8 +45,8 @@ struct AK::Formatter<GUI::TextPosition> : AK::Formatter<FormatString> { ErrorOr<void> format(FormatBuilder& builder, GUI::TextPosition const& value) { if (value.is_valid()) - return Formatter<FormatString>::format(builder, "({},{})", value.line(), value.column()); + return Formatter<FormatString>::format(builder, "({},{})"sv, value.line(), value.column()); - return Formatter<FormatString>::format(builder, "GUI::TextPosition(Invalid)"); + return builder.put_string("GUI::TextPosition(Invalid)"sv); } }; diff --git a/Userland/Libraries/LibGUI/TextRange.h b/Userland/Libraries/LibGUI/TextRange.h index 2e0b7332ab..ab25148880 100644 --- a/Userland/Libraries/LibGUI/TextRange.h +++ b/Userland/Libraries/LibGUI/TextRange.h @@ -72,7 +72,7 @@ struct AK::Formatter<GUI::TextRange> : AK::Formatter<FormatString> { ErrorOr<void> format(FormatBuilder& builder, GUI::TextRange const& value) { if (value.is_valid()) - return Formatter<FormatString>::format(builder, "{}-{}", value.start(), value.end()); - return Formatter<FormatString>::format(builder, "GUI::TextRange(Invalid)"); + return Formatter<FormatString>::format(builder, "{}-{}"sv, value.start(), value.end()); + return builder.put_string("GUI::TextRange(Invalid)"sv); } }; diff --git a/Userland/Libraries/LibGUI/TreeView.cpp b/Userland/Libraries/LibGUI/TreeView.cpp index 9ee2e6da09..2ad9215da0 100644 --- a/Userland/Libraries/LibGUI/TreeView.cpp +++ b/Userland/Libraries/LibGUI/TreeView.cpp @@ -42,8 +42,8 @@ TreeView::TreeView() set_background_role(ColorRole::Base); set_foreground_role(ColorRole::BaseText); set_column_headers_visible(false); - m_expand_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/serenity/treeview-expand.png").release_value_but_fixme_should_propagate_errors(); - m_collapse_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/serenity/treeview-collapse.png").release_value_but_fixme_should_propagate_errors(); + m_expand_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/serenity/treeview-expand.png"sv).release_value_but_fixme_should_propagate_errors(); + m_collapse_bitmap = Gfx::Bitmap::try_load_from_file("/res/icons/serenity/treeview-collapse.png"sv).release_value_but_fixme_should_propagate_errors(); } ModelIndex TreeView::index_at_event_position(Gfx::IntPoint const& a_position, bool& is_toggle) const @@ -644,7 +644,7 @@ void TreeView::auto_resize_column(int column) int header_width = column_header().font().width(model.column_name(column)); if (column == m_key_column && model.is_column_sortable(column)) - header_width += font().width(" \xE2\xAC\x86"); + header_width += font().width(" \xE2\xAC\x86"sv); int column_width = header_width; bool is_empty = true; @@ -689,7 +689,7 @@ void TreeView::update_column_sizes() continue; int header_width = column_header().font().width(model.column_name(column)); if (column == m_key_column && model.is_column_sortable(column)) - header_width += font().width(" \xE2\xAC\x86"); + header_width += font().width(" \xE2\xAC\x86"sv); int column_width = header_width; traverse_in_paint_order([&](ModelIndex const& index, Gfx::IntRect const&, Gfx::IntRect const&, int) { auto cell_data = model.index(index.row(), column, index.parent()).data(); @@ -710,7 +710,7 @@ void TreeView::update_column_sizes() int tree_column_header_width = column_header().font().width(model.column_name(tree_column)); if (tree_column == m_key_column && model.is_column_sortable(tree_column)) - tree_column_header_width += font().width(" \xE2\xAC\x86"); + tree_column_header_width += font().width(" \xE2\xAC\x86"sv); int tree_column_width = tree_column_header_width; traverse_in_paint_order([&](ModelIndex const& index, Gfx::IntRect const&, Gfx::IntRect const&, int indent_level) { auto cell_data = model.index(index.row(), tree_column, index.parent()).data(); diff --git a/Userland/Libraries/LibGUI/UIDimensions.h b/Userland/Libraries/LibGUI/UIDimensions.h index f1beab0991..082dcf8032 100644 --- a/Userland/Libraries/LibGUI/UIDimensions.h +++ b/Userland/Libraries/LibGUI/UIDimensions.h @@ -298,17 +298,17 @@ inline auto clamp<GUI::UIDimension>(GUI::UIDimension const& input, GUI::UIDimens [this] { \ auto size = this->getter(); \ JsonObject size_object; \ - size_object.set("width", size.width().as_json_value()); \ - size_object.set("height", size.height().as_json_value()); \ + size_object.set("width"sv, size.width().as_json_value()); \ + size_object.set("height"sv, size.height().as_json_value()); \ return size_object; \ }, \ [this](auto& value) { \ if (!value.is_object()) \ return false; \ auto result_width = GUI::UIDimension::construct_from_json_value( \ - value.as_object().get("width")); \ + value.as_object().get("width"sv)); \ auto result_height = GUI::UIDimension::construct_from_json_value( \ - value.as_object().get("height")); \ + value.as_object().get("height"sv)); \ if (result_width.has_value() && result_height.has_value()) { \ GUI::UISize size(result_width.value(), result_height.value()); \ setter(size); \ diff --git a/Userland/Libraries/LibGUI/Widget.cpp b/Userland/Libraries/LibGUI/Widget.cpp index c3fd5e39d7..8486f0fa6d 100644 --- a/Userland/Libraries/LibGUI/Widget.cpp +++ b/Userland/Libraries/LibGUI/Widget.cpp @@ -1150,7 +1150,7 @@ bool Widget::load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::O return false; } - auto& layout_class = *Core::ObjectClassRegistration::find("GUI::Layout"); + auto& layout_class = *Core::ObjectClassRegistration::find("GUI::Layout"sv); if (auto* registration = Core::ObjectClassRegistration::find(class_name)) { auto layout = registration->construct(); if (!layout || !registration->is_derived_from(layout_class)) { @@ -1168,7 +1168,7 @@ bool Widget::load_from_gml_ast(NonnullRefPtr<GUI::GML::Node> ast, RefPtr<Core::O }); } - auto& widget_class = *Core::ObjectClassRegistration::find("GUI::Widget"); + auto& widget_class = *Core::ObjectClassRegistration::find("GUI::Widget"sv); bool is_tab_widget = is<TabWidget>(*this); object->for_each_child_object_interruptible([&](auto child_data) { auto class_name = child_data->name(); diff --git a/Userland/Libraries/LibGUI/Widget.h b/Userland/Libraries/LibGUI/Widget.h index 0f8c8b8e80..82bfcc0c63 100644 --- a/Userland/Libraries/LibGUI/Widget.h +++ b/Userland/Libraries/LibGUI/Widget.h @@ -32,12 +32,12 @@ extern Core::ObjectClassRegistration registration_Widget; } } -#define REGISTER_WIDGET(namespace_, class_name) \ - namespace Core { \ - namespace Registration { \ - Core::ObjectClassRegistration registration_##class_name( \ - #namespace_ "::" #class_name, []() { return static_ptr_cast<Core::Object>(namespace_::class_name::construct()); }, ®istration_Widget); \ - } \ +#define REGISTER_WIDGET(namespace_, class_name) \ + namespace Core { \ + namespace Registration { \ + Core::ObjectClassRegistration registration_##class_name( \ + #namespace_ "::" #class_name##sv, []() { return static_ptr_cast<Core::Object>(namespace_::class_name::construct()); }, ®istration_Widget); \ + } \ } namespace GUI { diff --git a/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp b/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp index c7d639c177..fff99f1f97 100644 --- a/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp +++ b/Userland/Libraries/LibGUI/Wizards/CoverWizardPage.cpp @@ -21,7 +21,7 @@ CoverWizardPage::CoverWizardPage() set_layout<HorizontalBoxLayout>(); m_banner_image_widget = add<ImageWidget>(); m_banner_image_widget->set_fixed_size(160, 315); - m_banner_image_widget->load_from_file("/res/graphics/wizard-banner-simple.png"); + m_banner_image_widget->load_from_file("/res/graphics/wizard-banner-simple.png"sv); m_content_widget = add<Widget>(); m_content_widget->set_layout<VerticalBoxLayout>(); |