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  1fb452ea953e0a34142031b04f909dfb8cc1de8f (commit)
       via  bef6555b6a96fa81a393e26188fcee978218643d (commit)
      from  fae81bf5180620c8d89c282dbac1da4048e44f3b (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/1fb452ea953e0a34142031b04f909dfb8cc1de8f

commit 1fb452ea953e0a34142031b04f909dfb8cc1de8f
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Tue Jul 17 23:28:45 2012 +0200

    Remove dup code in wAppIconCreateForDock
    
    Some code in wAppIconCreateForDock() is duplicated with the function
    get_default_icon_filename(). It can be removed.

diff --git a/src/appicon.c b/src/appicon.c
index e3672ff..a899d7c 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -128,15 +128,7 @@ WAppIcon *wAppIconCreateForDock(WScreen * scr, char 
*command, char *wm_instance,
                dicon->wm_instance = wstrdup(wm_instance);
 
        /* Search the icon using instance and class, without default icon */
-       path = wDefaultGetIconFile(wm_instance, wm_class, False);
-       if (!path && command) {
-               wApplicationExtractDirPackIcon(scr, command, wm_instance, 
wm_class);
-               /* Search again, now with default icon */
-               path = wDefaultGetIconFile(wm_instance, wm_class, True);
-       }
-
-       if (path)
-               path = FindImage(wPreferences.icon_path, path);
+       path = get_default_icon_filename(scr, wm_instance, wm_class, command, 
False);
 
        dicon->icon = wIconCreateWithIconFile(scr, path, tile);
        if (path)

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

commit bef6555b6a96fa81a393e26188fcee978218643d
Author: Rodolfo García Peñas (kix) <[email protected]>
Date:   Tue Jul 17 22:55:37 2012 +0200

    noDefault changed to default_icon
    
    The functions wDefaultGetIconFile(), get_default_icon_filename() and
    get_generic_value() use the argument noDefault in order to avoid searching 
the
    default icon. This double negation is difficult to read though. This patch
    changes it to be True if the default icon should be included or false if 
not.
    
    This patch changes the noDefault argument to default_icon, then the
    True is now False and False is True.
    
    The main change is at get_generic_value():
    
    -       /* Search the default icon name - See noDefault argument! */
    -       if (!value && !noDefault) {
    +       /* Search the default icon name - See default_icon argument! */
    +       if (!value && default_icon) {
    
    Because the functions wDefaultGetIconFile() and get_default_icon_filename()
    mainly forwards the noDefault argument to get_generic_value().

diff --git a/src/appicon.c b/src/appicon.c
index 795b020..e3672ff 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -127,10 +127,12 @@ WAppIcon *wAppIconCreateForDock(WScreen * scr, char 
*command, char *wm_instance,
        if (wm_instance)
                dicon->wm_instance = wstrdup(wm_instance);
 
-       path = wDefaultGetIconFile(wm_instance, wm_class, True);
+       /* Search the icon using instance and class, without default icon */
+       path = wDefaultGetIconFile(wm_instance, wm_class, False);
        if (!path && command) {
                wApplicationExtractDirPackIcon(scr, command, wm_instance, 
wm_class);
-               path = wDefaultGetIconFile(wm_instance, wm_class, False);
+               /* Search again, now with default icon */
+               path = wDefaultGetIconFile(wm_instance, wm_class, True);
        }
 
        if (path)
diff --git a/src/defaults.c b/src/defaults.c
index c6fc2c3..4bf9aff 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -1125,7 +1125,8 @@ void wDefaultUpdateIcons(WScreen * scr)
        char *file;
 
        while (aicon) {
-               file = wDefaultGetIconFile(aicon->wm_instance, aicon->wm_class, 
False);
+               /* Get the application icon, default included */
+               file = wDefaultGetIconFile(aicon->wm_instance, aicon->wm_class, 
True);
                if ((file && aicon->icon->file && strcmp(file, 
aicon->icon->file) != 0)
                    || (file && !aicon->icon->file)) {
                        wIconChangeImageFile(aicon->icon, file);
@@ -1139,7 +1140,8 @@ void wDefaultUpdateIcons(WScreen * scr)
 
        while (wwin) {
                if (wwin->icon && wwin->flags.miniaturized) {
-                       file = wDefaultGetIconFile(wwin->wm_instance, 
wwin->wm_class, False);
+                       /* Get the application icon, default included */
+                       file = wDefaultGetIconFile(wwin->wm_instance, 
wwin->wm_class, True);
                        if ((file && wwin->icon->file && strcmp(file, 
wwin->icon->file) != 0)
                            || (file && !wwin->icon->file)) {
                                wIconChangeImageFile(wwin->icon, file);
diff --git a/src/defaults.h b/src/defaults.h
index e96128a..87ea8fb 100644
--- a/src/defaults.h
+++ b/src/defaults.h
@@ -41,7 +41,7 @@ void wDefaultFillAttributes(char *instance, char *class,
                             WWindowAttributes *attr, WWindowAttributes *mask,
                             Bool useGlobalDefault);
 
-char *wDefaultGetIconFile(char *instance, char *class, Bool noDefault);
+char *wDefaultGetIconFile(char *instance, char *class, Bool default_icon);
 
 RImage * wDefaultGetImage(WScreen *scr, char *winstance, char *wclass, int 
max_size);
 
@@ -49,6 +49,6 @@ RImage * wDefaultGetImage(WScreen *scr, char *winstance, char 
*wclass, int max_s
 int wDefaultGetStartWorkspace(WScreen *scr, char *instance, char *class);
 void wDefaultChangeIcon(WScreen *scr, char *instance, char* class, char *file);
 char *get_default_icon_filename(WScreen *scr, char *winstance, char *wclass, 
char *command,
-                               Bool noDefault);
+                               Bool default_icon);
 RImage *get_default_icon_rimage(WScreen *scr, char *file_name, int max_size);
 #endif /* WMDEFAULTS_H_ */
diff --git a/src/dialog.c b/src/dialog.c
index 3f9e536..5ec3ec6 100644
--- a/src/dialog.c
+++ b/src/dialog.c
@@ -1466,7 +1466,8 @@ static WMPixmap *getWindowMakerIconImage(WMScreen *scr)
        WMPixmap *pix = NULL;
        char *path = NULL;
 
-       path = get_default_icon_filename(NULL, "Logo", "WMPanel", NULL, True);
+       /* Get the Logo icon, without the default icon */
+       path = get_default_icon_filename(NULL, "Logo", "WMPanel", NULL, False);
 
        if (path) {
                RColor gray;
diff --git a/src/dockedapp.c b/src/dockedapp.c
index cd059c2..6bfc216 100644
--- a/src/dockedapp.c
+++ b/src/dockedapp.c
@@ -320,7 +320,7 @@ void ShowDockAppSettingsPanel(WAppIcon * aicon)
        panel->iconField = WMCreateTextField(panel->iconFrame);
        WMResizeWidget(panel->iconField, 176, 20);
        WMMoveWidget(panel->iconField, 10, 20);
-       WMSetTextFieldText(panel->iconField, 
wDefaultGetIconFile(aicon->wm_instance, aicon->wm_class, True));
+       WMSetTextFieldText(panel->iconField, 
wDefaultGetIconFile(aicon->wm_instance, aicon->wm_class, False));
 
        panel->browseBtn = WMCreateCommandButton(panel->iconFrame);
        WMResizeWidget(panel->browseBtn, 70, 24);
diff --git a/src/icon.c b/src/icon.c
index 812301e..c479890 100644
--- a/src/icon.c
+++ b/src/icon.c
@@ -128,7 +128,8 @@ WIcon *wIconCreate(WWindow * wwin)
 #endif
        icon->file_image = wDefaultGetImage(scr, wwin->wm_instance, 
wwin->wm_class, wPreferences.icon_size);
 
-       file = wDefaultGetIconFile(wwin->wm_instance, wwin->wm_class, False);
+       /* Get the application icon, default included */
+       file = wDefaultGetIconFile(wwin->wm_instance, wwin->wm_class, True);
        if (file)
                icon->file = wstrdup(file);
 
@@ -615,7 +616,8 @@ void get_pixmap_icon_from_user_icon(WScreen *scr, WIcon * 
icon)
        } else {
                /* make default icons */
                if (!scr->def_icon_pixmap) {
-                       file = wDefaultGetIconFile(NULL, NULL, False);
+                       /* Get the default icon */
+                       file = wDefaultGetIconFile(NULL, NULL, True);
                        if (file) {
                                path = FindImage(wPreferences.icon_path, file);
                                if (path) {
diff --git a/src/wdefaults.c b/src/wdefaults.c
index 497cb48..c4cd819 100644
--- a/src/wdefaults.c
+++ b/src/wdefaults.c
@@ -315,7 +315,7 @@ void wDefaultFillAttributes(char *instance, char *class,
 }
 
 static WMPropList *get_generic_value(char *instance, char *class,
-                                    WMPropList *option, Bool noDefault)
+                                    WMPropList *option, Bool default_icon)
 {
        WMPropList *value, *key, *dict;
 
@@ -361,8 +361,8 @@ static WMPropList *get_generic_value(char *instance, char 
*class,
                        value = WMGetFromPLDictionary(dict, option);
        }
 
-       /* Search the default icon name - See noDefault argument! */
-       if (!value && !noDefault) {
+       /* Search the default icon name - See default_icon argument! */
+       if (!value && default_icon) {
                /* AnyWindow is "*" - see wdefaults.c */
                dict = WMGetFromPLDictionary(WDWindowAttributes->dictionary, 
AnyWindow);
 
@@ -377,21 +377,21 @@ static WMPropList *get_generic_value(char *instance, char 
*class,
 
 /* Get the file name of the image, using instance and class */
 char *get_default_icon_filename(WScreen *scr, char *winstance, char *wclass, 
char *command,
-                               Bool noDefault)
+                               Bool default_icon)
 {
        char *file_name = NULL;
        char *file_path = NULL;
 
        /* Get the file name of the image, using instance and class */
-       file_name = wDefaultGetIconFile(winstance, wclass, noDefault);
+       file_name = wDefaultGetIconFile(winstance, wclass, default_icon);
 
-       /* If the specific (or generic if noDefault is False) icon filename
+       /* If the specific (or generic if default_icon is True) icon filename
         * is not found, and command is specified, then include the .app icons
         * and re-do the search, but now always including the default icon
         * so the icon is found always. The .app is selected before default */
        if (!file_name && scr && command) {
                wApplicationExtractDirPackIcon(scr, command, winstance, wclass);
-               file_name = wDefaultGetIconFile(winstance, wclass, False);
+               file_name = wDefaultGetIconFile(winstance, wclass, True);
        }
 
        /* Get the full path for the image file */
@@ -442,7 +442,7 @@ RImage *wDefaultGetImage(WScreen * scr, char *winstance, 
char *wclass, int max_s
        char *file_name = NULL;
 
        /* Get the file name of the image, using instance and class */
-       file_name = get_default_icon_filename(scr, winstance, wclass, NULL, 
False);
+       file_name = get_default_icon_filename(scr, winstance, wclass, NULL, 
True);
        if (!file_name)
                return NULL;
 
@@ -461,7 +461,7 @@ int wDefaultGetStartWorkspace(WScreen * scr, char 
*instance, char *class)
        if (!WDWindowAttributes->dictionary)
                return -1;
 
-       value = get_generic_value(instance, class, AStartWorkspace, False);
+       value = get_generic_value(instance, class, AStartWorkspace, True);
 
        if (!value)
                return -1;
@@ -477,8 +477,8 @@ int wDefaultGetStartWorkspace(WScreen * scr, char 
*instance, char *class)
        return w;
 }
 
-/* Get the name of the Icon File. If noDefault is False, then, default value 
included */
-char *wDefaultGetIconFile(char *instance, char *class, Bool noDefault)
+/* Get the name of the Icon File. If default_icon is True, then, default value 
included */
+char *wDefaultGetIconFile(char *instance, char *class, Bool default_icon)
 {
        WMPropList *value;
        char *tmp;
@@ -489,7 +489,7 @@ char *wDefaultGetIconFile(char *instance, char *class, Bool 
noDefault)
        if (!WDWindowAttributes || !WDWindowAttributes->dictionary)
                return NULL;
 
-       value = get_generic_value(instance, class, AIcon, noDefault);
+       value = get_generic_value(instance, class, AIcon, default_icon);
 
        if (!value)
                return NULL;
diff --git a/src/winspector.c b/src/winspector.c
index b671087..65b21fa 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -323,7 +323,8 @@ static int showIconFor(WMScreen *scrPtr, InspectorPanel 
*panel, char *wm_instanc
                        file = NULL;
                }
        } else {
-               db_icon = wDefaultGetIconFile(wm_instance, wm_class, False);
+               /* Get the application icon, default included */
+               db_icon = wDefaultGetIconFile(wm_instance, wm_class, True);
                if (db_icon != NULL)
                        file = wstrdup(db_icon);
        }

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

Summary of changes:
 src/appicon.c    |   10 ++--------
 src/defaults.c   |    6 ++++--
 src/defaults.h   |    4 ++--
 src/dialog.c     |    3 ++-
 src/dockedapp.c  |    2 +-
 src/icon.c       |    6 ++++--
 src/wdefaults.c  |   24 ++++++++++++------------
 src/winspector.c |    3 ++-
 8 files changed, 29 insertions(+), 29 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].

Reply via email to