mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-23 22:52:34 +01:00
wIconChangeImageFile find image if block swapped
This patch swaps the "if (path)" block to "if (!path)" therefore, the true block is now "error = 1" and the false block is the call to get_rimage_from_file function. The second change is that the "error = 1" statement is changed to "return 0", because if "error" is "1", then only the "return !error" statement is used, then we can change it for "return !1" that is "return 0". Then, we can move the get_rimage_from_file call out of the if block. Signed-off-by: Rodolfo García Peñas (kix) <kix@kix.es>
This commit is contained in:
committed by
Carlos R. Mafra
parent
d6fe27af15
commit
3250144b94
@@ -364,10 +364,10 @@ int wIconChangeImageFile(WIcon *icon, const char *file)
|
||||
|
||||
/* Find the new image */
|
||||
path = FindImage(wPreferences.icon_path, file);
|
||||
if (path)
|
||||
image = get_rimage_from_file(scr, path, wPreferences.icon_size);
|
||||
else
|
||||
error = 1;
|
||||
if (!path)
|
||||
return 0;
|
||||
|
||||
image = get_rimage_from_file(scr, path, wPreferences.icon_size);
|
||||
|
||||
/* New image! */
|
||||
if (!error && image) {
|
||||
|
||||
Reference in New Issue
Block a user