From 64354fb125475c97e1af01ff7ca0f06b919977a9 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Thu, 29 Dec 2005 10:14:34 +0000 Subject: [PATCH] r4277: Some .desktop files put ".png" after the icon name, which prevents the icon from being found. Ignore it (Thomass Leonard; reported by Peter). --- ROX-Filer/Help/Changes | 5 +++++ ROX-Filer/src/pixmaps.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/ROX-Filer/Help/Changes b/ROX-Filer/Help/Changes index 4ec6ef08..7feed989 100644 --- a/ROX-Filer/Help/Changes +++ b/ROX-Filer/Help/Changes @@ -2,6 +2,11 @@ A RISC OS-like filer for X by Thomas Leonard +29-Dec-2005 +~~~~~~~~~~~ +Some .desktop files put ".png" after the icon name, which prevents the icon +from being found. Ignore it (Thomass Leonard; reported by Peter). + 28-Dec-2005 ~~~~~~~~~~~ Updated Hungarian translation (Andras Mohari). diff --git a/ROX-Filer/src/pixmaps.c b/ROX-Filer/src/pixmaps.c index 77aadd18..625b7cbf 100644 --- a/ROX-Filer/src/pixmaps.c +++ b/ROX-Filer/src/pixmaps.c @@ -684,6 +684,16 @@ static MaskedPixmap *image_from_desktop_file(const char *path) { GdkPixbuf *pixbuf; int tmp_fd; + char *extension; + + /* For some unknown reason, some icon names have extensions. + * Remove them. + */ + extension = strrchr(icon, '.'); + if (extension && strcmp(extension, ".png") == 0) + { + *extension = '\0'; + } /* SVG reader is very noisy, so redirect stderr to stdout */ tmp_fd = dup(2); -- 2.11.4.GIT