mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
WidgetGallery+MouseSettings: Use LexicalPath::basename()
This commit is contained in:
parent
9ddd2fdcc5
commit
d1846867cd
Notes:
sideshowbarker
2024-07-18 03:36:45 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/d1846867cd1 Pull-request: https://github.com/SerenityOS/serenity/pull/10148 Issue: https://github.com/SerenityOS/serenity/issues/10142
2 changed files with 5 additions and 8 deletions
|
@ -60,8 +60,7 @@ void MouseCursorModel::invalidate()
|
|||
|
||||
Cursor cursor;
|
||||
cursor.path = move(path);
|
||||
auto filename_split = cursor.path.split('/');
|
||||
cursor.name = filename_split[3];
|
||||
cursor.name = LexicalPath::basename(cursor.path);
|
||||
|
||||
// FIXME: Animated cursor bitmaps
|
||||
auto cursor_bitmap = Gfx::Bitmap::try_load_from_file(cursor.path);
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/LexicalPath.h>
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/DirIterator.h>
|
||||
|
@ -69,8 +70,7 @@ public:
|
|||
Cursor cursor;
|
||||
cursor.path = move(path);
|
||||
cursor.bitmap = Gfx::Bitmap::try_load_from_file(cursor.path);
|
||||
auto filename_split = cursor.path.split('/');
|
||||
cursor.name = filename_split[3];
|
||||
cursor.name = LexicalPath::basename(cursor.path);
|
||||
m_cursors.append(move(cursor));
|
||||
}
|
||||
|
||||
|
@ -150,8 +150,7 @@ public:
|
|||
continue;
|
||||
IconSet icon_set;
|
||||
icon_set.big_icon = Gfx::Bitmap::try_load_from_file(path);
|
||||
auto filename_split = path.split('/');
|
||||
icon_set.name = filename_split[3];
|
||||
icon_set.name = LexicalPath::basename(path);
|
||||
m_icon_sets.append(move(icon_set));
|
||||
}
|
||||
|
||||
|
@ -165,8 +164,7 @@ public:
|
|||
continue;
|
||||
IconSet icon_set;
|
||||
icon_set.little_icon = Gfx::Bitmap::try_load_from_file(path);
|
||||
auto filename_split = path.split('/');
|
||||
icon_set.name = filename_split[3];
|
||||
icon_set.name = LexicalPath::basename(path);
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue