From 1fbce07805f3598d64fb0aa0e1a1654af797d248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Mon, 18 Jun 2012 11:47:44 +0200 Subject: [PATCH] extractIcon removed. The function extractIcon is removed, and its behaviour is moved to save_app_icon, because this function is always called. To do that, save_app_icon doesn't need to check if the icon is saved (it's done at wIconStore). The icon now is saved always (if it doesn't exist), like extractIcon() used to do. --- src/appicon.c | 26 +++----------------------- src/application.c | 15 --------------- 2 files changed, 3 insertions(+), 38 deletions(-) diff --git a/src/appicon.c b/src/appicon.c index b46bf72c..9201f8d1 100644 --- a/src/appicon.c +++ b/src/appicon.c @@ -929,34 +929,14 @@ void wApplicationSaveIconPathFor(char *iconPath, char *wm_instance, char *wm_cla UpdateDomainFile(WDWindowAttributes); } +/* Save the application icon */ +/* This function is used by normal windows */ void save_app_icon(WWindow *wwin, WApplication *wapp) { - char *tmp, *path; - struct stat dummy; - WScreen *scr = NULL; - if (!wapp->app_icon) return; - scr = wwin->screen_ptr; - tmp = wDefaultGetIconFile(scr, wapp->app_icon->wm_instance, wapp->app_icon->wm_class, True); - - /* If the icon was saved by us from the client supplied icon, but is - * missing, recreate it. */ - if (tmp && strstr(tmp, "Library/WindowMaker/CachedPixmaps") != NULL && - stat(tmp, &dummy) != 0 && errno == ENOENT) { - wmessage(_("recreating missing icon '%s'"), tmp); - path = wIconStore(wapp->app_icon->icon); - if (path) - wfree(path); - - wIconUpdate(wapp->app_icon->icon); - wAppIconPaint(wapp->app_icon); - } - - /* if the displayed icon was supplied by the client, save the icon */ - if (!tmp || strstr(tmp, "Library/WindowMaker/CachedPixmaps") != NULL) - wAppIconSave(wapp->app_icon); + save_app_icon_core(wapp->app_icon); } static WAppIcon *findDockIconFor(WDock *dock, Window main_window) diff --git a/src/application.c b/src/application.c index f29e90fc..dee6fccf 100644 --- a/src/application.c +++ b/src/application.c @@ -77,19 +77,6 @@ WApplication *wApplicationOf(Window window) return wapp; } -static void extractIcon(WWindow * wwin) -{ - char *progname; - - /* Get the application name */ - progname = GetProgramNameForWindow(wwin->client_win); - if (progname) { - /* Save the icon path if the application is ".app" */ - wApplicationExtractDirPackIcon(wwin->screen_ptr, progname, wwin->wm_instance, wwin->wm_class); - wfree(progname); - } -} - WApplication *wApplicationCreate(WWindow * wwin) { WScreen *scr = wwin->screen_ptr; @@ -137,8 +124,6 @@ WApplication *wApplicationCreate(WWindow * wwin) wapp->main_window_desc->fake_group = wwin->fake_group; wapp->main_window_desc->net_icon_image = RRetainImage(wwin->net_icon_image); - extractIcon(wapp->main_window_desc); - leader = wWindowFor(main_window); if (leader) leader->main_window = main_window;