From da5e2f8a0dc4a7e067c2a142284ed829bf7748d9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Mon, 1 Oct 2012 22:49:30 +0200 Subject: [PATCH] Icon: Replace code by call to helper function in wIconCreateWithIconFile Code in the function wIconCreateWithIconFile does the same task as get_default_icon_rimage(), therefore replace it with a call to that function. It 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 d929a8c7..a940123d 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; -- 2.11.4.GIT