Removed dup code at get_default_image
authorRodolfo García Peñas (kix) <kix@kix.es>
Wed, 31 Oct 2012 21:44:16 +0000 (31 22:44 +0100)
committerCarlos R. Mafra <crmafra@gmail.com>
Wed, 31 Oct 2012 22:24:27 +0000 (31 22:24 +0000)
This patch removes the code dup at get_default_image. Now,
this function calls get_rimage_from_file()

src/icon.c

index b4ccfc5..da93679 100644 (file)
@@ -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 {
+               image = get_rimage_from_file(scr, path, wPreferences.icon_size);
+
+               if (!image)
                        wwarning(_("could not find default icon \"%s\""), file);
-               }
-       }
 
-       /* Validate the icon size */
-       image = wIconValidateIconSize(image, wPreferences.icon_size);
+               wfree(file);
+       }
 
        return image;
 }