Changes to appicon.h:

- Spaces replaced by tabs in the struct
- Removed unused variables:
  - client_machine, never assigned
  - gnustep_app, never used
- Functions sort by return type

Then, in dock.c, the block with client_machine is never true,
then can be removed. The host variable then is never used.
---
 src/appicon.h |   96 ++++++++++++++++++++++----------------------------------
 src/dock.c    |    8 +----
 2 files changed, 39 insertions(+), 65 deletions(-)

diff --git a/src/appicon.h b/src/appicon.h
index f10f847..c8a96dc 100644
--- a/src/appicon.h
+++ b/src/appicon.h
@@ -29,73 +29,53 @@
 #include "icon.h"
 #include "application.h"
 
-
 typedef struct WAppIcon {
-    short xindex;
-    short yindex;
-    struct WAppIcon *next;
-    struct WAppIcon *prev;
-    WIcon *icon;
-
-    char *client_machine;
-
-    int x_pos, y_pos;                 /* absolute screen coordinate */
-
-    char *command;                    /* command used to launch app */
-
+       short xindex;
+       short yindex;
+       struct WAppIcon *next;
+       struct WAppIcon *prev;
+       WIcon *icon;
+       int x_pos, y_pos;               /* absolute screen coordinate */
+       char *command;                  /* command used to launch app */
 #ifdef XDND
-    char *dnd_command;                /* command to use when something is */
-                                       /* dropped on us */
+       char *dnd_command;              /* command to use when something is */
+                                       /* dropped on us */
 #endif
-
-    char *paste_command;              /* command to run when something is 
pasted */
-
-    char *wm_class;
-    char *wm_instance;
-    pid_t pid;                        /* for apps launched from the dock */
-    Window main_window;
-
-    struct WDock *dock;                       /* In which dock is docked. */
-
-    struct _AppSettingsPanel *panel;   /* Settings Panel */
-
-    unsigned int gnustep_app:1;               /* if this is a GNUstep 
application */
-    unsigned int docked:1;
-    unsigned int omnipresent:1;        /* If omnipresent when docked in clip */
-    unsigned int attracted:1;         /* If it was attracted by the clip */
-    unsigned int launching:1;
-    unsigned int running:1;           /* application is already running */
-    unsigned int relaunching:1;               /* launching 2nd instance */
-
-    unsigned int forced_dock:1;
-    unsigned int auto_launch:1;               /* launch app on startup */
-    unsigned int remote_start:1;
-    unsigned int updated:1;
-    unsigned int editing:1;           /* editing docked icon */
-    unsigned int drop_launch:1;               /* launching from drop action */
-    unsigned int paste_launch:1;       /* launching from paste action */
-    unsigned int destroyed:1;         /* appicon was destroyed */
-    unsigned int buggy_app:1;         /* do not make dock rely on hints
-                                        * set by app */
-
-    unsigned int lock:1;              /* do not allow to be destroyed */
-
+       char *paste_command;            /* command to run when
+                                        * something is pasted */
+       char *wm_class;
+       char *wm_instance;
+       pid_t pid;                       /* for apps launched from the dock */
+       Window main_window;
+       struct WDock *dock;              /* In which dock is docked. */
+       struct _AppSettingsPanel *panel; /* Settings Panel */
+       unsigned int docked:1;
+       unsigned int omnipresent:1;      /* If omnipresent when
+                                         * docked in clip */
+       unsigned int attracted:1;        /* If it was attracted by the clip */
+       unsigned int launching:1;
+       unsigned int running:1;          /* application is already running */
+       unsigned int relaunching:1;      /* launching 2nd instance */
+       unsigned int forced_dock:1;
+       unsigned int auto_launch:1;      /* launch app on startup */
+       unsigned int remote_start:1;
+       unsigned int updated:1;
+       unsigned int editing:1;          /* editing docked icon */
+       unsigned int drop_launch:1;      /* launching from drop action */
+       unsigned int paste_launch:1;     /* launching from paste action */
+       unsigned int destroyed:1;        /* appicon was destroyed */
+       unsigned int buggy_app:1;        /* do not make dock rely on hints
+                                         * set by app */
+       unsigned int lock:1;             /* do not allow to be destroyed */
 } WAppIcon;
 
-
 WAppIcon *wAppIconCreate(WWindow *leader_win);
-WAppIcon *wAppIconCreateForDock(WScreen *scr, char *command, char *wm_instance,
-                                char *wm_class, int tile);
+WAppIcon * wAppIconCreateForDock(WScreen *scr, char *command, char 
*wm_instance,
+                                char *wm_class, int tile);
 
 void wAppIconDestroy(WAppIcon *aicon);
-
 void wAppIconPaint(WAppIcon *aicon);
-
-Bool wAppIconChangeImage(WAppIcon *icon, char *file);
-
 void wAppIconMove(WAppIcon *aicon, int x, int y);
-
+Bool wAppIconChangeImage(WAppIcon *icon, char *file);
 Bool wAppIconSave(WAppIcon *aicon);
-
 #endif
-
diff --git a/src/dock.c b/src/dock.c
index 71bef02..88ea6eb 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -1183,7 +1183,7 @@ static void dockIconPaint(WAppIcon *btn)
 static WMPropList *make_icon_state(WAppIcon *btn)
 {
        WMPropList *node = NULL;
-       WMPropList *command, *autolaunch, *lock, *name, *forced, *host;
+       WMPropList *command, *autolaunch, *lock, *name, *forced;
        WMPropList *position, *buggy, *omnipresent;
        char *tmp;
        char buffer[64];
@@ -1240,12 +1240,6 @@ static WMPropList *make_icon_state(WAppIcon *btn)
                        WMPutInPLDictionary(node, dPasteCommand, command);
                        WMReleasePropList(command);
                }
-
-               if (btn->client_machine && btn->remote_start) {
-                       host = WMCreatePLString(btn->client_machine);
-                       WMPutInPLDictionary(node, dHost, host);
-                       WMReleasePropList(host);
-               }
        }
 
        return node;
-- 
1.7.9.1

>From ee6a06cfc4da14f0a4ab71238f6c8af9504e55be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Sat, 14 Apr 2012 01:52:40 +0200
Subject: [PATCH 01/16] WindowMaker: appicon.h clean code

Changes to appicon.h:

- Spaces replaced by tabs in the struct
- Removed unused variables:
  - client_machine, never assigned
  - gnustep_app, never used
- Functions sort by return type

Then, in dock.c, the block with client_machine is never true,
then can be removed. The host variable then is never used.
---
 src/appicon.h |   96 ++++++++++++++++++++++----------------------------------
 src/dock.c    |    8 +----
 2 files changed, 39 insertions(+), 65 deletions(-)

diff --git a/src/appicon.h b/src/appicon.h
index f10f847..c8a96dc 100644
--- a/src/appicon.h
+++ b/src/appicon.h
@@ -29,73 +29,53 @@
 #include "icon.h"
 #include "application.h"
 
-
 typedef struct WAppIcon {
-    short xindex;
-    short yindex;
-    struct WAppIcon *next;
-    struct WAppIcon *prev;
-    WIcon *icon;
-
-    char *client_machine;
-
-    int x_pos, y_pos;		       /* absolute screen coordinate */
-
-    char *command;		       /* command used to launch app */
-
+	short xindex;
+	short yindex;
+	struct WAppIcon *next;
+	struct WAppIcon *prev;
+	WIcon *icon;
+	int x_pos, y_pos;		/* absolute screen coordinate */
+	char *command;			/* command used to launch app */
 #ifdef XDND
-    char *dnd_command;		       /* command to use when something is */
-                                       /* dropped on us */
+	char *dnd_command;		/* command to use when something is */
+					/* dropped on us */
 #endif
-
-    char *paste_command;	       /* command to run when something is pasted */
-
-    char *wm_class;
-    char *wm_instance;
-    pid_t pid;			       /* for apps launched from the dock */
-    Window main_window;
-
-    struct WDock *dock;		       /* In which dock is docked. */
-
-    struct _AppSettingsPanel *panel;   /* Settings Panel */
-
-    unsigned int gnustep_app:1;	       /* if this is a GNUstep application */
-    unsigned int docked:1;
-    unsigned int omnipresent:1;        /* If omnipresent when docked in clip */
-    unsigned int attracted:1;	       /* If it was attracted by the clip */
-    unsigned int launching:1;
-    unsigned int running:1;	       /* application is already running */
-    unsigned int relaunching:1;	       /* launching 2nd instance */
-
-    unsigned int forced_dock:1;
-    unsigned int auto_launch:1;	       /* launch app on startup */
-    unsigned int remote_start:1;
-    unsigned int updated:1;
-    unsigned int editing:1;	       /* editing docked icon */
-    unsigned int drop_launch:1;	       /* launching from drop action */
-    unsigned int paste_launch:1;       /* launching from paste action */
-    unsigned int destroyed:1;	       /* appicon was destroyed */
-    unsigned int buggy_app:1;	       /* do not make dock rely on hints
-                                        * set by app */
-
-    unsigned int lock:1;	       /* do not allow to be destroyed */
-
+	char *paste_command;		/* command to run when
+					 * something is pasted */
+	char *wm_class;
+	char *wm_instance;
+	pid_t pid;			 /* for apps launched from the dock */
+	Window main_window;
+	struct WDock *dock;		 /* In which dock is docked. */
+	struct _AppSettingsPanel *panel; /* Settings Panel */
+	unsigned int docked:1;
+	unsigned int omnipresent:1;	 /* If omnipresent when
+					  * docked in clip */
+	unsigned int attracted:1;	 /* If it was attracted by the clip */
+	unsigned int launching:1;
+	unsigned int running:1;		 /* application is already running */
+	unsigned int relaunching:1;	 /* launching 2nd instance */
+	unsigned int forced_dock:1;
+	unsigned int auto_launch:1;	 /* launch app on startup */
+	unsigned int remote_start:1;
+	unsigned int updated:1;
+	unsigned int editing:1;		 /* editing docked icon */
+	unsigned int drop_launch:1;	 /* launching from drop action */
+	unsigned int paste_launch:1;	 /* launching from paste action */
+	unsigned int destroyed:1;	 /* appicon was destroyed */
+	unsigned int buggy_app:1;	 /* do not make dock rely on hints
+					  * set by app */
+	unsigned int lock:1;		 /* do not allow to be destroyed */
 } WAppIcon;
 
-
 WAppIcon *wAppIconCreate(WWindow *leader_win);
-WAppIcon *wAppIconCreateForDock(WScreen *scr, char *command, char *wm_instance,
-                                char *wm_class, int tile);
+WAppIcon * wAppIconCreateForDock(WScreen *scr, char *command, char *wm_instance,
+				 char *wm_class, int tile);
 
 void wAppIconDestroy(WAppIcon *aicon);
-
 void wAppIconPaint(WAppIcon *aicon);
-
-Bool wAppIconChangeImage(WAppIcon *icon, char *file);
-
 void wAppIconMove(WAppIcon *aicon, int x, int y);
-
+Bool wAppIconChangeImage(WAppIcon *icon, char *file);
 Bool wAppIconSave(WAppIcon *aicon);
-
 #endif
-
diff --git a/src/dock.c b/src/dock.c
index 71bef02..88ea6eb 100644
--- a/src/dock.c
+++ b/src/dock.c
@@ -1183,7 +1183,7 @@ static void dockIconPaint(WAppIcon *btn)
 static WMPropList *make_icon_state(WAppIcon *btn)
 {
 	WMPropList *node = NULL;
-	WMPropList *command, *autolaunch, *lock, *name, *forced, *host;
+	WMPropList *command, *autolaunch, *lock, *name, *forced;
 	WMPropList *position, *buggy, *omnipresent;
 	char *tmp;
 	char buffer[64];
@@ -1240,12 +1240,6 @@ static WMPropList *make_icon_state(WAppIcon *btn)
 			WMPutInPLDictionary(node, dPasteCommand, command);
 			WMReleasePropList(command);
 		}
-
-		if (btn->client_machine && btn->remote_start) {
-			host = WMCreatePLString(btn->client_machine);
-			WMPutInPLDictionary(node, dHost, host);
-			WMReleasePropList(host);
-		}
 	}
 
 	return node;
-- 
1.7.9.1

Reply via email to