From 746ff010c23113ab82c0bd0599773c7e515e028f Mon Sep 17 00:00:00 2001 From: Theo Linkspfeifer Date: Sun, 19 May 2019 23:20:57 +0200 Subject: [PATCH 1/1] Allow to load non-theme icons (Bug #15294) --- src/xfdesktop-regular-file-icon.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/xfdesktop-regular-file-icon.c b/src/xfdesktop-regular-file-icon.c index c1b53bea..46450ea2 100644 --- a/src/xfdesktop-regular-file-icon.c +++ b/src/xfdesktop-regular-file-icon.c @@ -396,17 +396,14 @@ xfdesktop_load_icon_from_desktop_file(XfdesktopRegularFileIcon *regular_icon) } /* icon_name is an absolute path, create it as a file icon */ - if(g_file_test(icon_name, G_FILE_TEST_IS_REGULAR)) { + if(g_file_test(icon_name, G_FILE_TEST_IS_REGULAR)) gicon = g_file_icon_new(g_file_new_for_path(icon_name)); - } - /* check if the icon theme includes the icon name as-is */ - if(gicon == NULL) { - /* load it */ + /* try to load the icon */ + if(gicon == NULL) gicon = g_themed_icon_new(icon_name); - } - /* drop any suffix (e.g. '.png') from themed icons and try to laod that */ + /* drop any suffix (e.g. '.png') from the icon and try to load that */ if(gicon == NULL) { gchar *tmp_name = NULL; @@ -414,11 +411,10 @@ xfdesktop_load_icon_from_desktop_file(XfdesktopRegularFileIcon *regular_icon) if(p != NULL) tmp_name = g_strndup(icon_name, p - icon_name); - /* check if the icon theme includes the icon name */ - if(tmp_name) { - /* load it */ + /* try to load the icon */ + if(tmp_name) gicon = g_themed_icon_new(tmp_name); - } + g_free(tmp_name); } -- 2.20.1