Split get_pixmap_icon_from_user_icon() into two
authorRodolfo García Peñas (kix) <kix@kix.es>
Sat, 3 Nov 2012 18:53:57 +0000 (3 19:53 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Sun, 4 Nov 2012 00:27:46 +0000 (4 00:27 +0000)
The function get_pixmap_icon_from_user_icon() is splitted in two
functions now:

1. get_rimage_icon_from_user_icon, set the rimage at icon->image
   The code comes from the function get_pixmap_icon_from_default_icon()
2. The get_pixmap_icon_from_user_icon() function, but now only converts
   the icon->file_image in icon->pixmap

src/icon.c

index 2e0f9b0..a94b4b2 100644 (file)
@@ -63,6 +63,7 @@ static WIcon *icon_create_core(WScreen *scr, int coord_x, int coord_y);
 static void get_pixmap_icon_from_icon_win(WIcon *icon);
 static int get_pixmap_icon_from_wm_hints(WIcon *icon);
 static void get_pixmap_icon_from_user_icon(WIcon *icon);
+static void get_rimage_icon_from_user_icon(WIcon *icon);
 static void get_pixmap_icon_from_default_icon(WIcon *icon);
 static void get_rimage_icon_from_default_icon(WIcon *icon);
 
@@ -628,15 +629,21 @@ void wIconUpdate(WIcon *icon)
        wIconPaint(icon);
 }
 
-static void get_pixmap_icon_from_user_icon(WIcon *icon)
+static void get_rimage_icon_from_user_icon(WIcon *icon)
 {
-       /* If the icon has image, update it and continue */
-       if (icon->file_image) {
-               icon_update_pixmap(icon, icon->file_image);
+       if (icon->file_image)
                return;
-       }
 
-       get_pixmap_icon_from_default_icon(icon);
+       get_rimage_icon_from_default_icon(icon);
+}
+
+static void get_pixmap_icon_from_user_icon(WIcon *icon)
+{
+       /* Set the icon->file_image */
+       get_rimage_icon_from_user_icon(icon);
+
+       /* Update icon->pixmap */
+       icon_update_pixmap(icon, icon->file_image);
 }
 
 static void get_rimage_icon_from_default_icon(WIcon *icon)