From 6102a4a686a7d8c52b07d7ba4a6eaa90a2acb6b7 Mon Sep 17 00:00:00 2001 From: Matias De lellis Date: Fri, 18 Jul 2014 14:55:17 -0300 Subject: [PATCH] Fix display desktop file that include extension in icon name.. --- src/xfdesktop-regular-file-icon.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/xfdesktop-regular-file-icon.c b/src/xfdesktop-regular-file-icon.c index 58afcb8..503a7c2 100644 --- a/src/xfdesktop-regular-file-icon.c +++ b/src/xfdesktop-regular-file-icon.c @@ -367,6 +367,7 @@ xfdesktop_load_icon_from_desktop_file(XfdesktopRegularFileIcon *regular_icon) gchar *contents; gsize length; GIcon *gicon = NULL; + gchar *p; /* try to load the file into memory */ if(g_file_load_contents(regular_icon->priv->file, NULL, &contents, &length, @@ -388,6 +389,12 @@ xfdesktop_load_icon_from_desktop_file(XfdesktopRegularFileIcon *regular_icon) /* icon_name is an absolute path, create it as a file icon */ gicon = g_file_icon_new(g_file_new_for_path(icon_name)); } else if(icon_name) { + /* drop any suffix (e.g. '.png') from themed icons */ + if (!g_path_is_absolute (icon_name)) { + p = strrchr (icon_name, '.'); + if (p != NULL) + *p = '\0'; + } /* otherwise create a themed icon for it */ gicon = g_themed_icon_new(icon_name); } -- 1.9.3