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  7f022f1c8f2e8f905f28bdceea54277ad551f242 (commit)
       via  cedf6205435708b06e6b84c2cde41e2477cc99c2 (commit)
      from  9d3d34599f682867b08ae4308f5a58bf9f8f10ec (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/7f022f1c8f2e8f905f28bdceea54277ad551f242

commit 7f022f1c8f2e8f905f28bdceea54277ad551f242
Author: Rodolfo García Peñas (kix) <k...@kix.es>
Date:   Wed Jun 6 12:25:58 2012 +0200

    Remove code duplication by calling get_name_for_instance_class()
    
    The code in application.c to create the icon name is
    included in icon.c (function get_name_for_instance_class).

diff --git a/src/application.c b/src/application.c
index c50f3e4..ca47203 100644
--- a/src/application.c
+++ b/src/application.c
@@ -114,25 +114,8 @@ void wApplicationSaveIconPathFor(char *iconPath, char 
*wm_instance, char *wm_cla
        WMPropList *adict, *key, *iconk;
        WMPropList *val;
        char *tmp;
-       int i;
-
-       i = 0;
-       if (wm_instance)
-               i += strlen(wm_instance);
-       if (wm_class)
-               i += strlen(wm_class);
-
-       tmp = wmalloc(i + 8);
-       *tmp = 0;
-       if (wm_class && wm_instance) {
-               sprintf(tmp, "%s.%s", wm_instance, wm_class);
-       } else {
-               if (wm_instance)
-                       strcat(tmp, wm_instance);
-               if (wm_class)
-                       strcat(tmp, wm_class);
-       }
 
+       tmp = get_name_for_instance_class(wm_instance, wm_class);
        key = WMCreatePLString(tmp);
        wfree(tmp);
 

http://repo.or.cz/w/wmaker-crm.git/commit/cedf6205435708b06e6b84c2cde41e2477cc99c2

commit cedf6205435708b06e6b84c2cde41e2477cc99c2
Author: Rodolfo García Peñas (kix) <k...@kix.es>
Date:   Wed Jun 6 11:07:19 2012 +0200

    New function get_name_for_instance_class
    
    The function get_name_for_icon is renamed to get_name_for_wwin.
    
    The previous contents of get_name_for_icon are now at the new
    function get_name_for_instance_class.

diff --git a/src/icon.c b/src/icon.c
index 27f4eba..59161d3 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -398,23 +398,28 @@ Bool wIconChangeImageFile(WIcon * icon, char *file)
        return !error;
 }
 
-char *get_name_for_icon(WWindow *wwin)
+static char *get_name_for_wwin(WWindow *wwin)
+{
+       return get_name_for_instance_class(wwin->wm_instance, wwin->wm_class);
+}
+
+char *get_name_for_instance_class(char *wm_instance, char *wm_class)
 {
        char *suffix;
        int len;
 
-       if (wwin->wm_class && wwin->wm_instance) {
-               len = strlen(wwin->wm_class) + strlen(wwin->wm_instance) + 2;
+       if (wm_class && wm_instance) {
+               len = strlen(wm_class) + strlen(wm_instance) + 2;
                suffix = wmalloc(len);
-               snprintf(suffix, len, "%s.%s", wwin->wm_instance, 
wwin->wm_class);
-       } else if (wwin->wm_class) {
-               len = strlen(wwin->wm_class) + 1;
+               snprintf(suffix, len, "%s.%s", wm_instance, wm_class);
+       } else if (wm_class) {
+               len = strlen(wm_class) + 1;
                suffix = wmalloc(len);
-               snprintf(suffix, len, "%s", wwin->wm_class);
-       } else if (wwin->wm_instance) {
-               len = strlen(wwin->wm_instance) + 1;
+               snprintf(suffix, len, "%s", wm_class);
+       } else if (wm_instance) {
+               len = strlen(wm_instance) + 1;
                suffix = wmalloc(len);
-               snprintf(suffix, len, "%s", wwin->wm_instance);
+               snprintf(suffix, len, "%s", wm_instance);
        } else {
                return NULL;
        }
@@ -485,7 +490,7 @@ char *wIconStore(WIcon * icon)
        if (!dir_path)
                return NULL;
 
-       file = get_name_for_icon(wwin);
+       file = get_name_for_wwin(wwin);
        if (!file) {
                wfree(dir_path);
                return NULL;
diff --git a/src/icon.h b/src/icon.h
index 09b4190..62a1844 100644
--- a/src/icon.h
+++ b/src/icon.h
@@ -67,7 +67,8 @@ Bool wIconChangeImageFile(WIcon *icon, char *file);
 
 RImage * wIconValidateIconSize(WScreen *scr, RImage *icon, int max_size);
 
-char * wIconStore(WIcon *icon);
+char *wIconStore(WIcon *icon);
+char *get_name_for_instance_class(char *wm_instance, char *wm_class);
 
 #ifdef NEWAPPICON
 void wIconSetHighlited(WIcon *icon, Bool flag);

-----------------------------------------------------------------------

Summary of changes:
 src/application.c |   19 +------------------
 src/icon.c        |   27 ++++++++++++++++-----------
 src/icon.h        |    3 ++-
 3 files changed, 19 insertions(+), 30 deletions(-)


repo.or.cz automatic notification. Contact project admin crma...@gmail.com
if you want to unsubscribe, or site admin ad...@repo.or.cz if you receive
no reply.
-- 
wmaker-crm.git ("The Window Maker window manager")


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to