kwo pushed a commit to branch master. http://git.enlightenment.org/e16/e16.git/commit/?id=864009da546ca5132920b0d830af3c7a44dcd139
commit 864009da546ca5132920b0d830af3c7a44dcd139 Author: Kim Woelders <[email protected]> Date: Sun May 3 00:02:07 2020 +0200 groups: Eliminate EwinGetGroups() Not particularly useful. --- src/groups.c | 7 ------- src/groups.h | 1 - src/snaps.c | 24 ++++++++++++------------ 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/groups.c b/src/groups.c index dd8478da..d8355e49 100644 --- a/src/groups.c +++ b/src/groups.c @@ -271,13 +271,6 @@ GroupsGetList(int *pnum) return LIST_GET_ITEMS(Group, &group_list, pnum); } -Group *const * -EwinGetGroups(const EWin * ewin, int *num) -{ - *num = ewin->num_groups; - return ewin->groups; -} - #if ENABLE_DIALOGS static Group ** ListWinGroups(const EWin * ewin, char group_select, int *num) diff --git a/src/groups.h b/src/groups.h index 6a3653b7..6d7c35b0 100644 --- a/src/groups.h +++ b/src/groups.h @@ -45,7 +45,6 @@ int GroupMatchAction(const Group * g, int action); int GroupRemember(Group * g); void GroupRememberByGid(int gid); EWin *const *GroupGetMembers(const Group * g, int *num); -Group *const *EwinGetGroups(const EWin * ewin, int *num); Group *EwinsInGroup(const EWin * ewin1, const EWin * ewin2); void GroupsEwinAdd(EWin * ewin, const int *pgid, int ngid); void GroupsEwinRemove(EWin * ewin); diff --git a/src/snaps.c b/src/snaps.c index 9c801bfe..b0fdf4d1 100644 --- a/src/snaps.c +++ b/src/snaps.c @@ -384,9 +384,8 @@ _SnapUpdateEwinCmd(Snapshot * sn, const EWin * ewin) static void _SnapUpdateEwinGroups(Snapshot * sn, const EWin * ewin, char onoff) { - EWin **gwins; - Group *const *groups; - int i, j, num, num_groups; + EWin **gwins, *ewin2; + int i, j, num; if (!ewin) return; @@ -402,29 +401,30 @@ _SnapUpdateEwinGroups(Snapshot * sn, const EWin * ewin, char onoff) ListWinGroupMembersForEwin(ewin, GROUP_ACTION_ANY, Mode.nogroup, &num); for (i = 0; i < num; i++) { + ewin2 = gwins[i]; + if (onoff) { - groups = EwinGetGroups(gwins[i], &num_groups); - if (!groups) + if (!ewin2->groups) continue; - sn = gwins[i]->snap; + sn = ewin2->snap; if (!sn) - sn = _SnapEwinGet(gwins[i], SNAP_MATCH_DEFAULT); + sn = _SnapEwinGet(ewin2, SNAP_MATCH_DEFAULT); if (!sn) continue; - sn->num_groups = num_groups; - EFREE_SET(sn->groups, EMALLOC(int, num_groups)); + sn->num_groups = ewin2->num_groups; + EFREE_SET(sn->groups, EMALLOC(int, ewin2->num_groups)); - for (j = 0; j < num_groups; j++) - sn->groups[j] = GroupRemember(groups[j]); + for (j = 0; j < ewin2->num_groups; j++) + sn->groups[j] = GroupRemember(ewin2->groups[j]); } else { if (ewin->snap) { - sn = gwins[i]->snap; + sn = ewin2->snap; if (sn) { EFREE_NULL(sn->groups); --
