From 7fa78b2456d510728567523a653110ea31899c3a Mon Sep 17 00:00:00 2001 From: ericLemanissier Date: Thu, 22 Dec 2022 07:23:13 +0100 Subject: Taskbar: Propagate errors while loading bmp --- Userland/Services/Taskbar/main.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'Userland') diff --git a/Userland/Services/Taskbar/main.cpp b/Userland/Services/Taskbar/main.cpp index ed57f2ccc2..e488189b93 100644 --- a/Userland/Services/Taskbar/main.cpp +++ b/Userland/Services/Taskbar/main.cpp @@ -10,6 +10,7 @@ #include "TaskbarWindow.h" #include #include +#include #include #include #include @@ -116,7 +117,7 @@ ErrorOr> build_system_menu(GUI::Window& window) Vector const sorted_app_categories = TRY(discover_apps_and_categories()); auto system_menu = TRY(GUI::Menu::try_create("\xE2\x9A\xA1")); // HIGH VOLTAGE SIGN - system_menu->add_action(GUI::Action::create("&About SerenityOS", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/ladyball.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) { + system_menu->add_action(GUI::Action::create("&About SerenityOS", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/ladyball.png"sv)), [&](auto&) { GUI::Process::spawn_or_show_error(&window, "/bin/About"sv); })); @@ -225,7 +226,7 @@ ErrorOr> build_system_menu(GUI::Window& window) g_themes_group.set_unchecking_allowed(false); g_themes_menu = &system_menu->add_submenu("&Themes"); - g_themes_menu->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/themes.png"sv).release_value_but_fixme_should_propagate_errors()); + g_themes_menu->set_icon(TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/themes.png"sv))); g_themes = TRY(Gfx::list_installed_system_themes()); auto current_theme_name = GUI::ConnectionToWindowServer::the().get_system_theme(); @@ -258,15 +259,15 @@ ErrorOr> build_system_menu(GUI::Window& window) } }; - system_menu->add_action(GUI::Action::create("&Settings", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-settings.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) { + system_menu->add_action(GUI::Action::create("&Settings", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-settings.png"sv)), [&](auto&) { GUI::Process::spawn_or_show_error(&window, "/bin/Settings"sv); })); system_menu->add_separator(); - system_menu->add_action(GUI::Action::create("&Help", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-help.png"sv).release_value_but_fixme_should_propagate_errors(), [&](auto&) { + system_menu->add_action(GUI::Action::create("&Help", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-help.png"sv)), [&](auto&) { GUI::Process::spawn_or_show_error(&window, "/bin/Help"sv); })); - system_menu->add_action(GUI::Action::create("&Run...", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-run.png"sv).release_value_but_fixme_should_propagate_errors(), [](auto&) { + system_menu->add_action(GUI::Action::create("&Run...", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-run.png"sv)), [](auto&) { posix_spawn_file_actions_t spawn_actions; posix_spawn_file_actions_init(&spawn_actions); auto home_directory = Core::StandardPaths::home_directory(); @@ -284,7 +285,7 @@ ErrorOr> build_system_menu(GUI::Window& window) posix_spawn_file_actions_destroy(&spawn_actions); })); system_menu->add_separator(); - system_menu->add_action(GUI::Action::create("E&xit...", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/power.png"sv).release_value_but_fixme_should_propagate_errors(), [](auto&) { + system_menu->add_action(GUI::Action::create("E&xit...", TRY(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/power.png"sv)), [](auto&) { auto command = ShutdownDialog::show(); if (command.size() == 0) -- cgit v1.2.3