summaryrefslogtreecommitdiff
path: root/Userland/Demos/WidgetGallery/GalleryModels.h
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2021-04-22 19:32:22 -0400
committerAndreas Kling <kling@serenityos.org>2021-04-23 09:28:14 +0200
commita697a2a37a081e9f16e26a0945af513cb37a246f (patch)
tree807c46ac8a269c8d7ab73e99df1caf9c230a3e7d /Userland/Demos/WidgetGallery/GalleryModels.h
parent1099521514a880155c8ee78c47bce7afca0d82b2 (diff)
downloadserenity-a697a2a37a081e9f16e26a0945af513cb37a246f.zip
WidgetGallery: Split cursor/icon names based on full paths
Fixes [null] icons since switching to next_full_path iteration
Diffstat (limited to 'Userland/Demos/WidgetGallery/GalleryModels.h')
-rw-r--r--Userland/Demos/WidgetGallery/GalleryModels.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Demos/WidgetGallery/GalleryModels.h b/Userland/Demos/WidgetGallery/GalleryModels.h
index 5d8303804b..9a29d320e9 100644
--- a/Userland/Demos/WidgetGallery/GalleryModels.h
+++ b/Userland/Demos/WidgetGallery/GalleryModels.h
@@ -64,8 +64,8 @@ public:
Cursor cursor;
cursor.path = move(path);
cursor.bitmap = Gfx::Bitmap::load_from_file(cursor.path);
- auto filename_split = cursor.path.split('.');
- cursor.name = filename_split[0];
+ auto filename_split = cursor.path.split('/');
+ cursor.name = filename_split[2];
m_cursors.append(move(cursor));
}
@@ -143,8 +143,8 @@ public:
continue;
IconSet icon_set;
icon_set.big_icon = Gfx::Bitmap::load_from_file(path);
- auto filename_split = path.split('.');
- icon_set.name = filename_split[0];
+ auto filename_split = path.split('/');
+ icon_set.name = filename_split[3];
m_icon_sets.append(move(icon_set));
}
@@ -158,8 +158,8 @@ public:
continue;
IconSet icon_set;
icon_set.little_icon = Gfx::Bitmap::load_from_file(path);
- auto filename_split = path.split('.');
- icon_set.name = filename_split[0];
+ auto filename_split = path.split('/');
+ icon_set.name = filename_split[3];
for (size_t i = 0; i < big_icons_found; i++) {
if (icon_set.name == m_icon_sets[i].name) {
m_icon_sets[i].little_icon = icon_set.little_icon;