diff options
author | Andreas Kling <kling@serenityos.org> | 2021-07-21 18:02:15 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-21 18:02:15 +0200 |
commit | c7d891765cc87ec04f8d332b93fc7c3f82521d7f (patch) | |
tree | 9d414d3ad62e0193b1b6fb0d12079e11e96e69b1 /Userland/DevTools/Profiler/main.cpp | |
parent | f0409081f562b635de3a23d7babbc7348cbb970c (diff) | |
download | serenity-c7d891765cc87ec04f8d332b93fc7c3f82521d7f.zip |
LibGfx: Use "try_" prefix for static factory functions
Also mark them as [[nodiscard]].
Diffstat (limited to 'Userland/DevTools/Profiler/main.cpp')
-rw-r--r-- | Userland/DevTools/Profiler/main.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/DevTools/Profiler/main.cpp b/Userland/DevTools/Profiler/main.cpp index 65e1cf877b..219e2532d8 100644 --- a/Userland/DevTools/Profiler/main.cpp +++ b/Userland/DevTools/Profiler/main.cpp @@ -149,7 +149,7 @@ int main(int argc, char** argv) disassembly_view.set_model(profile->disassembly_model()); }; - auto disassembly_action = GUI::Action::create_checkable("Show &Disassembly", { Mod_Ctrl, Key_D }, Gfx::Bitmap::load_from_file("/res/icons/16x16/x86.png"), [&](auto& action) { + auto disassembly_action = GUI::Action::create_checkable("Show &Disassembly", { Mod_Ctrl, Key_D }, Gfx::Bitmap::try_load_from_file("/res/icons/16x16/x86.png"), [&](auto& action) { disassembly_view.set_visible(action.is_checked()); }); @@ -235,7 +235,7 @@ static bool prompt_to_stop_profiling(pid_t pid, const String& process_name) auto window = GUI::Window::construct(); window->set_title(String::formatted("Profiling {}({})", process_name, pid)); window->resize(240, 100); - window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-profiler.png")); + window->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-profiler.png")); window->center_on_screen(); auto& widget = window->set_main_widget<GUI::Widget>(); @@ -263,7 +263,7 @@ static bool prompt_to_stop_profiling(pid_t pid, const String& process_name) bool generate_profile(pid_t& pid) { if (!pid) { - auto process_chooser = GUI::ProcessChooser::construct("Profiler", "Profile", Gfx::Bitmap::load_from_file("/res/icons/16x16/app-profiler.png")); + auto process_chooser = GUI::ProcessChooser::construct("Profiler", "Profile", Gfx::Bitmap::try_load_from_file("/res/icons/16x16/app-profiler.png")); if (process_chooser->exec() == GUI::Dialog::ExecCancel) return false; pid = process_chooser->pid(); |