>From 34ae3e837a344bf29df91292889da36afbccd732 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Tue, 17 Jul 2012 23:28:45 +0200
Subject: [PATCH 2/2] Remove dup code in wAppIconCreateForDock

The code is wAppIconCreateForDock() is duplicated with the function
get_default_icon_filename(). It can be removed.
---
 src/appicon.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/appicon.c b/src/appicon.c
index e3672ff..335136a 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -128,15 +128,8 @@ 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)
-- 
1.7.10.4

-- 
||// //\\// Rodolfo "kix" Garcia
||\\// //\\ http://www.kix.es/
>From 34ae3e837a344bf29df91292889da36afbccd732 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?"Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20(kix)"?= <[email protected]>
Date: Tue, 17 Jul 2012 23:28:45 +0200
Subject: [PATCH 2/2] Remove dup code in wAppIconCreateForDock

The code is wAppIconCreateForDock() is duplicated with the function
get_default_icon_filename(). It can be removed.
---
 src/appicon.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/appicon.c b/src/appicon.c
index e3672ff..335136a 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -128,15 +128,8 @@ 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)
-- 
1.7.10.4

Reply via email to