On 21/06/12 18:30, Carlos R. Mafra wrote:

> 
> Having two similarly named functions for doing the same thing is confusing.
> In order to account for the extra check done by the late wAppIconSave(),
> add an argument "dock".
> 
> Now there's only save_appicon().
> 
> Signed-off-by: Carlos R. Mafra <[email protected]>
> ---
>  src/appicon.c     |   37 +++++++++++++++----------------------
>  src/appicon.h     |    3 +--
>  src/application.c |    2 +-
>  src/dock.c        |    8 ++++----
>  4 files changed, 21 insertions(+), 29 deletions(-)
> 
> diff --git a/src/appicon.c b/src/appicon.c
> index 6827c2f..d236313 100644
> --- a/src/appicon.c
> +++ b/src/appicon.c
> @@ -68,6 +68,7 @@ static void iconDblClick(WObjDescriptor * desc, XEvent * 
> event);
>  static void iconExpose(WObjDescriptor * desc, XEvent * event);
>  static void wApplicationSaveIconPathFor(char *iconPath, char *wm_instance, 
> char *wm_class);
>  static WAppIcon *wAppIconCreate(WWindow * leader_win);
> +static void save_appicon_core(WAppIcon *aicon);
>  
>  /* This function is used if the application is a .app. It checks if it has 
> an icon in it
>   * like for example /usr/local/GNUstep/Applications/WPrefs.app/WPrefs.tiff
> @@ -397,8 +398,20 @@ void wAppIconPaint(WAppIcon * aicon)
>                              0, 0, wPreferences.icon_size, 
> wPreferences.icon_size);
>  }
>  
> +/* Save the application icon, if it's a dockapp then use it with dock = True 
> */
> +void save_appicon(WAppIcon *aicon, Bool dock)
> +{
> +     if (!aicon)
> +             return;
> +
> +     if (dock && (!aicon->docked || aicon->attracted))
> +             return;
> +
> +     save_appicon_core(aicon);
> +}
> +
>  /* Internal application to save the application icon */
> -static void save_app_icon_core(WAppIcon *aicon)
> +static void save_appicon_core(WAppIcon *aicon)
>  {


Probably (I am not looking the code, is using my memory, I have a
terrible headache), we can remove the save_appicon_core() function now,
because was used only in the functions that you joined.

The rest of the patch is perfect. Apply it and you can write other patch
if you want to include the contents of save_appicon_core() in
save_appicon().

Saludos,
kix


-- 
To unsubscribe, send mail to [email protected].

Reply via email to