[Xfce4-commits] [xfce/xfdesktop] 01/01: Fix display desktop file that include extension in icon name..

noreply at xfce.org noreply at xfce.org
Sat Jul 19 17:32:51 CEST 2014


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository xfce/xfdesktop.

commit ae4013a095820417b090db14a6d037e8956fb67c
Author: Matias De lellis <mati86dl at gmail.com>
Date:   Fri Jul 18 14:55:17 2014 -0300

    Fix display desktop file that include extension in icon name..
    
    Signed-off-by: Eric Koegel <eric.koegel at gmail.com>
---
 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);
             }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list