From: Rodolfo García Peñas (kix) Date: Tue, 2 Oct 2012 21:19:26 +0000 (+0200) Subject: Removed block in restore_icon_state X-Git-Tag: wmaker-0.95.4~115 X-Git-Url: https://repo.or.cz/w/wmaker-crm.git/commitdiff_plain/e988386013556be8250a710a9632f191f8e7487e Removed block in restore_icon_state The block inside restore_icon_state is not needed, so can be removed. There are no changes with or without the block (variables scope,...). --- diff --git a/src/dock.c b/src/dock.c index 26d348ab..c90ae939 100644 --- a/src/dock.c +++ b/src/dock.c @@ -1343,6 +1343,7 @@ static WAppIcon *restore_icon_state(WScreen *scr, WMPropList *info, int type, in { WAppIcon *aicon; WMPropList *cmd, *value; + char *wclass, *winstance, *command; cmd = WMGetFromPLDictionary(info, dCommand); if (!cmd || !WMIsPLString(cmd)) @@ -1353,42 +1354,36 @@ static WAppIcon *restore_icon_state(WScreen *scr, WMPropList *info, int type, in if (!value) return NULL; - { - char *wclass, *winstance; - char *command; - - ParseWindowName(value, &winstance, &wclass, "dock"); - - if (!winstance && !wclass) - return NULL; - - /* get commands */ + ParseWindowName(value, &winstance, &wclass, "dock"); - if (cmd) - command = wstrdup(WMGetFromPLString(cmd)); - else - command = NULL; - - if (!command || strcmp(command, "-") == 0) { - if (command) - wfree(command); - if (wclass) - wfree(wclass); - if (winstance) - wfree(winstance); + if (!winstance && !wclass) + return NULL; - return NULL; - } + /* get commands */ + if (cmd) + command = wstrdup(WMGetFromPLString(cmd)); + else + command = NULL; - aicon = wAppIconCreateForDock(scr, command, winstance, wclass, TILE_NORMAL); + if (!command || strcmp(command, "-") == 0) { + if (command) + wfree(command); if (wclass) wfree(wclass); if (winstance) wfree(winstance); - if (command) - wfree(command); + + return NULL; } + aicon = wAppIconCreateForDock(scr, command, winstance, wclass, TILE_NORMAL); + if (wclass) + wfree(wclass); + if (winstance) + wfree(winstance); + if (command) + wfree(command); + aicon->icon->core->descriptor.handle_mousedown = iconMouseDown; if (type == WM_CLIP) { aicon->icon->core->descriptor.handle_enternotify = clipEnterNotify;