summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/FileIconProvider.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibGUI/FileIconProvider.cpp')
-rw-r--r--Userland/Libraries/LibGUI/FileIconProvider.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/Userland/Libraries/LibGUI/FileIconProvider.cpp b/Userland/Libraries/LibGUI/FileIconProvider.cpp
index d06c8d0a50..4345ece13b 100644
--- a/Userland/Libraries/LibGUI/FileIconProvider.cpp
+++ b/Userland/Libraries/LibGUI/FileIconProvider.cpp
@@ -48,6 +48,15 @@ static void initialize_executable_icon_if_needed()
s_executable_icon = Icon::default_icon("filetype-executable");
}
+static void initialize_filetype_image_icon_if_needed()
+{
+ static bool initialized = false;
+ if (initialized)
+ return;
+ initialized = true;
+ s_filetype_image_icon = Icon::default_icon("filetype-image");
+}
+
static void initialize_if_needed()
{
static bool s_initialized = false;
@@ -70,8 +79,7 @@ static void initialize_if_needed()
s_symlink_icon = Icon::default_icon("filetype-symlink");
s_socket_icon = Icon::default_icon("filetype-socket");
- s_filetype_image_icon = Icon::default_icon("filetype-image");
-
+ initialize_filetype_image_icon_if_needed();
initialize_executable_icon_if_needed();
for (auto& filetype : config->keys("Icons")) {
@@ -114,7 +122,7 @@ Icon FileIconProvider::home_directory_open_icon()
Icon FileIconProvider::filetype_image_icon()
{
- initialize_if_needed();
+ initialize_filetype_image_icon_if_needed();
return s_filetype_image_icon;
}