This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project wmaker-crm.git.
The branch, next has been updated
via 6366aeef3a9669cfc52614498042cf6e1eb36bb5 (commit)
via cc01ca5c6bb388d759138e6ba207570134566885 (commit)
via 3250144b945bb391270679b4b2e99e66c19c6dbf (commit)
via d6fe27af1512cda685b002474c53b627569683ce (commit)
from 45bfc1d1c575bfc96f977c3ea84d6b1549420464 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/wmaker-crm.git/commit/6366aeef3a9669cfc52614498042cf6e1eb36bb5
commit 6366aeef3a9669cfc52614498042cf6e1eb36bb5
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sat Sep 28 15:33:53 2013 +0200
wIconChangeImageFile removed error variable
This patch removes the error variable, because is not changed
after their initialization.
This patch also removes the if check to wfree the path variable,
because this variable never is NULL.
Signed-off-by: Rodolfo GarcÃa Peñas (kix) <[email protected]>
diff --git a/src/icon.c b/src/icon.c
index c454049..064b689 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -356,7 +356,6 @@ int wIconChangeImageFile(WIcon *icon, const char *file)
WScreen *scr = icon->core->screen_ptr;
char *path;
RImage *image = NULL;
- int error = 0;
/* If no new image, don't do nothing */
if (!file)
@@ -378,10 +377,8 @@ int wIconChangeImageFile(WIcon *icon, const char *file)
icon->file = wstrdup(path);
update_icon_pixmap(icon);
- if (path)
- wfree(path);
-
- return !error;
+ wfree(path);
+ return 1;
}
static char *get_name_for_wwin(WWindow *wwin)
http://repo.or.cz/w/wmaker-crm.git/commit/cc01ca5c6bb388d759138e6ba207570134566885
commit cc01ca5c6bb388d759138e6ba207570134566885
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sat Sep 28 15:33:52 2013 +0200
wIconChangeImageFile get image block swapped
This patch swaps the if and the else blocks for the
image value. Now, if the image doesn't exist, and because
error is always "0" (is not changed after the definition),
we can exist from the wIconChangeImageFile function.
Before this patch, if the image was NULL, the error variable
was set to "1", so we must return !error, then return "0".
Because the "path" variable is not NULL, we must wfree it.
Now, the "Set the new image" block is moved out the if block.
Signed-off-by: Rodolfo GarcÃa Peñas (kix) <[email protected]>
diff --git a/src/icon.c b/src/icon.c
index c30aeb4..c454049 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -368,17 +368,16 @@ int wIconChangeImageFile(WIcon *icon, const char *file)
return 0;
image = get_rimage_from_file(scr, path, wPreferences.icon_size);
-
- /* New image! */
- if (!error && image) {
- /* Set the new image */
- set_icon_image_from_image(icon, image);
- icon->file = wstrdup(path);
- update_icon_pixmap(icon);
- } else {
- error = 1;
+ if (!image) {
+ wfree(path);
+ return 0;
}
+ /* Set the new image */
+ set_icon_image_from_image(icon, image);
+ icon->file = wstrdup(path);
+ update_icon_pixmap(icon);
+
if (path)
wfree(path);
http://repo.or.cz/w/wmaker-crm.git/commit/3250144b945bb391270679b4b2e99e66c19c6dbf
commit 3250144b945bb391270679b4b2e99e66c19c6dbf
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sat Sep 28 15:33:51 2013 +0200
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) <[email protected]>
diff --git a/src/icon.c b/src/icon.c
index c3ab64a..c30aeb4 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -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) {
http://repo.or.cz/w/wmaker-crm.git/commit/d6fe27af1512cda685b002474c53b627569683ce
commit d6fe27af1512cda685b002474c53b627569683ce
Author: Rodolfo GarcÃa Peñas (kix) <[email protected]>
Date: Sat Sep 28 15:33:50 2013 +0200
wIconChangeImageFile returns int
The function wIconChangeImageFile now returns an integer value
instead of boolean.
Signed-off-by: Rodolfo GarcÃa Peñas (kix) <[email protected]>
diff --git a/src/icon.c b/src/icon.c
index 6efc454..c3ab64a 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -351,7 +351,7 @@ RImage *wIconValidateIconSize(RImage *icon, int max_size)
return icon;
}
-Bool wIconChangeImageFile(WIcon *icon, const char *file)
+int wIconChangeImageFile(WIcon *icon, const char *file)
{
WScreen *scr = icon->core->screen_ptr;
char *path;
@@ -360,7 +360,7 @@ Bool wIconChangeImageFile(WIcon *icon, const char *file)
/* If no new image, don't do nothing */
if (!file)
- return True;
+ return 1;
/* Find the new image */
path = FindImage(wPreferences.icon_path, file);
diff --git a/src/icon.h b/src/icon.h
index 58b6cf6..347814b 100644
--- a/src/icon.h
+++ b/src/icon.h
@@ -64,7 +64,7 @@ void wIconSelect(WIcon *icon);
void wIconChangeTitle(WIcon *icon, WWindow *wwin);
void update_icon_pixmap(WIcon *icon);
-Bool wIconChangeImageFile(WIcon *icon, const char *file);
+int wIconChangeImageFile(WIcon *icon, const char *file);
RImage *wIconValidateIconSize(RImage *icon, int max_size);
RImage *get_rimage_icon_from_wm_hints(WIcon *icon);
-----------------------------------------------------------------------
Summary of changes:
src/icon.c | 34 +++++++++++++++-------------------
src/icon.h | 2 +-
2 files changed, 16 insertions(+), 20 deletions(-)
repo.or.cz automatic notification. Contact project admin [email protected]
if you want to unsubscribe, or site admin [email protected] if you receive
no reply.
--
wmaker-crm.git ("The Window Maker window manager")
--
To unsubscribe, send mail to [email protected].