summaryrefslogtreecommitdiff
path: root/Userland/Demos/WidgetGallery/GalleryModels.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-07-21 18:02:15 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-21 18:02:15 +0200
commitc7d891765cc87ec04f8d332b93fc7c3f82521d7f (patch)
tree9d414d3ad62e0193b1b6fb0d12079e11e96e69b1 /Userland/Demos/WidgetGallery/GalleryModels.h
parentf0409081f562b635de3a23d7babbc7348cbb970c (diff)
downloadserenity-c7d891765cc87ec04f8d332b93fc7c3f82521d7f.zip
LibGfx: Use "try_" prefix for static factory functions
Also mark them as [[nodiscard]].
Diffstat (limited to 'Userland/Demos/WidgetGallery/GalleryModels.h')
-rw-r--r--Userland/Demos/WidgetGallery/GalleryModels.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Demos/WidgetGallery/GalleryModels.h b/Userland/Demos/WidgetGallery/GalleryModels.h
index f00992f07f..038a26b9cb 100644
--- a/Userland/Demos/WidgetGallery/GalleryModels.h
+++ b/Userland/Demos/WidgetGallery/GalleryModels.h
@@ -63,7 +63,7 @@ public:
continue;
Cursor cursor;
cursor.path = move(path);
- cursor.bitmap = Gfx::Bitmap::load_from_file(cursor.path);
+ cursor.bitmap = Gfx::Bitmap::try_load_from_file(cursor.path);
auto filename_split = cursor.path.split('/');
cursor.name = filename_split[2];
m_cursors.append(move(cursor));
@@ -142,7 +142,7 @@ public:
if (!path.contains("filetype-") && !path.contains("app-"))
continue;
IconSet icon_set;
- icon_set.big_icon = Gfx::Bitmap::load_from_file(path);
+ icon_set.big_icon = Gfx::Bitmap::try_load_from_file(path);
auto filename_split = path.split('/');
icon_set.name = filename_split[3];
m_icon_sets.append(move(icon_set));
@@ -157,7 +157,7 @@ public:
if (!path.contains("filetype-") && !path.contains("app-"))
continue;
IconSet icon_set;
- icon_set.little_icon = Gfx::Bitmap::load_from_file(path);
+ icon_set.little_icon = Gfx::Bitmap::try_load_from_file(path);
auto filename_split = path.split('/');
icon_set.name = filename_split[3];
for (size_t i = 0; i < big_icons_found; i++) {