From 280e1e099d1e5998e76251b0d4bfb6fa657968de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Wed, 31 Oct 2012 22:44:16 +0100 Subject: [PATCH] Removed dup code at get_default_image This patch removes the code dup at get_default_image. Now, this function calls get_rimage_from_file() --- src/icon.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/icon.c b/src/icon.c index b4ccfc5b..da93679c 100644 --- a/src/icon.c +++ b/src/icon.c @@ -649,19 +649,13 @@ static RImage *get_default_image(WScreen *scr) file = wDefaultGetIconFile(NULL, NULL, True); if (file) { path = FindImage(wPreferences.icon_path, file); - if (path) { - image = RLoadImage(scr->rcontext, path, 0); - if (!image) - wwarning(_("could not load default icon \"%s\":%s"), - file, RMessageForError(RErrorCode)); - wfree(path); - } else { - wwarning(_("could not find default icon \"%s\""), file); - } - } + image = get_rimage_from_file(scr, path, wPreferences.icon_size); - /* Validate the icon size */ - image = wIconValidateIconSize(image, wPreferences.icon_size); + if (!image) + wwarning(_("could not find default icon \"%s\""), file); + + wfree(file); + } return image; }