>From 59f86f9aded68260569c62aa1c1866a95ed91ce3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Mon, 1 Oct 2012 22:49:30 +0200
Subject: [PATCH 4/9] Removed dup code in wIconCreateWithIconFile

Code in the function wIconCreateWithIconFile is dup with the code at
get_default_icon_rimage, therefore can be removed.

Is the code to get the image file (rimage) using the file name.
---
 src/icon.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/icon.c b/src/icon.c
index d929a8c..a940123 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -156,14 +156,8 @@ WIcon *wIconCreateWithIconFile(WScreen *scr, char 
*iconfile, int tile)
 
        icon = wIconCreateCore(scr, 0, 0);
 
-       if (iconfile) {
-               icon->file_image = RLoadImage(scr->rcontext, iconfile, 0);
-               if (!icon->file_image)
-                       wwarning(_("error loading image file \"%s\": %s"), 
iconfile, RMessageForError(RErrorCode));
-
-               icon->file_image = wIconValidateIconSize(icon->file_image, 
wPreferences.icon_size);
-               icon->file = wstrdup(iconfile);
-       }
+       icon->file_image = get_default_icon_rimage(scr, iconfile, 
wPreferences.icon_size);
+       icon->file = wstrdup(iconfile);
 
        icon->tile_type = tile;
 
-- 
1.7.10.4

-- 
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/
>From 59f86f9aded68260569c62aa1c1866a95ed91ce3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Mon, 1 Oct 2012 22:49:30 +0200
Subject: [PATCH 4/9] Removed dup code in wIconCreateWithIconFile

Code in the function wIconCreateWithIconFile is dup with the code at
get_default_icon_rimage, therefore can be removed.

Is the code to get the image file (rimage) using the file name.
---
 src/icon.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/icon.c b/src/icon.c
index d929a8c..a940123 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -156,14 +156,8 @@ WIcon *wIconCreateWithIconFile(WScreen *scr, char *iconfile, int tile)
 
 	icon = wIconCreateCore(scr, 0, 0);
 
-	if (iconfile) {
-		icon->file_image = RLoadImage(scr->rcontext, iconfile, 0);
-		if (!icon->file_image)
-			wwarning(_("error loading image file \"%s\": %s"), iconfile, RMessageForError(RErrorCode));
-
-		icon->file_image = wIconValidateIconSize(icon->file_image, wPreferences.icon_size);
-		icon->file = wstrdup(iconfile);
-	}
+	icon->file_image = get_default_icon_rimage(scr, iconfile, wPreferences.icon_size);
+	icon->file = wstrdup(iconfile);
 
 	icon->tile_type = tile;
 
-- 
1.7.10.4

Reply via email to