File: 02_fix-menu-icons.patch

package info (click to toggle)
libxfcegui4 4.10.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,868 kB
  • ctags: 2,783
  • sloc: ansic: 22,658; sh: 11,187; makefile: 510
file content (40 lines) | stat: -rw-r--r-- 1,678 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Description: fix missing icon for launchers that have a period (dot, '.') in their icon's base name
Author: Gauvain Pocentek <gauvain@ulteo.com>
Bug: https://bugzilla.xfce.org/show_bug.cgi?id=3614

Index: libxfcegui4-4.8.1/libxfcegui4/icons.c
===================================================================
--- libxfcegui4-4.8.1.orig/libxfcegui4/icons.c	2011-02-10 10:33:27.000000000 +0100
+++ libxfcegui4-4.8.1/libxfcegui4/icons.c	2011-09-05 21:05:46.094685532 +0200
@@ -142,8 +142,12 @@
     ensure_gtk_icon_theme();
 
     /* GtkIconTheme doesn't like extensions */
-    if((p = g_strrstr(name, ".")) && strlen(p) < 6)
-        name_fixed = g_strndup(name, p-name);
+    if (g_str_has_suffix (name, ".png") || g_str_has_suffix (name, ".svg")
+        || g_str_has_suffix (name, ".xpm"))
+    {
+        if((p = g_strrstr(name, ".")) && strlen(p) < 6)
+            name_fixed = g_strndup(name, p-name);
+    }
     
     pix = gtk_icon_theme_load_icon(icon_theme, name_fixed ? name_fixed : name,
                                    size,
@@ -220,9 +224,13 @@
     ensure_gtk_icon_theme();
     
     /* GtkIconTheme doesn't like extensions */
-    if((p = g_strrstr(name, ".")) && strlen(p) < 6)
-        name_fixed = g_strndup(name, p-name);
-    
+    if (g_str_has_suffix (name, ".png") || g_str_has_suffix (name, ".svg")
+        || g_str_has_suffix (name, ".xpm"))
+    {   
+        if((p = g_strrstr(name, ".")) && strlen(p) < 6)
+            name_fixed = g_strndup(name, p-name);
+    }   
+ 
     info = gtk_icon_theme_lookup_icon(icon_theme,
                                       name_fixed ? name_fixed : name,
                                       size, 0);