1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00

LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()

This was used in a lot of places, so this patch makes liberal use of
ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
This commit is contained in:
Andreas Kling 2021-11-06 16:25:29 +01:00
parent 16f064d9be
commit 235f39e449
104 changed files with 412 additions and 397 deletions

View file

@ -44,13 +44,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");
return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-information.png").release_value_but_fixme_should_propagate_errors();
case Type::Warning:
return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-warning.png");
return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-warning.png").release_value_but_fixme_should_propagate_errors();
case Type::Error:
return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-error.png");
return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-error.png").release_value_but_fixme_should_propagate_errors();
case Type::Question:
return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-question.png");
return Gfx::Bitmap::try_load_from_file("/res/icons/32x32/msgbox-question.png").release_value_but_fixme_should_propagate_errors();
default:
return nullptr;
}