From b1b2f47e7dd185fef88a44a318a9b374083ecb40 Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Sat, 4 Sep 2010 14:41:39 +0200 Subject: minor code simplification --- src/WorkspaceCmd.cc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc index d72ef13..6267671 100644 --- a/src/WorkspaceCmd.cc +++ b/src/WorkspaceCmd.cc @@ -523,19 +523,19 @@ void CloseAllWindowsCmd::execute() { BScreen *screen = Fluxbox::instance()->mouseScreen(); if (screen == 0) return; - + + Workspace::Windows windows; + BScreen::Workspaces::iterator workspace_it = screen->getWorkspacesList().begin(); BScreen::Workspaces::iterator workspace_it_end = screen->getWorkspacesList().end(); - for (; workspace_it != workspace_it_end; ++workspace_it) { - Workspace::Windows windows((*workspace_it)->windowList()); - std::for_each(windows.begin(), - windows.end(), - std::mem_fun(&FluxboxWindow::close)); - } - BScreen::Icons::iterator icon_it = screen->iconList().begin(); - BScreen::Icons::iterator icon_it_end = screen->iconList().end(); - for (; icon_it != icon_it_end; ++icon_it ) { - (*icon_it)->close(); - } - + for (; workspace_it != workspace_it_end; ++workspace_it) { + windows = (*workspace_it)->windowList(); + std::for_each(windows.begin(), windows.end(), + std::mem_fun(&FluxboxWindow::close)); + } + + windows = screen->iconList(); + std::for_each(windows.begin(), + windows.end(), std::mem_fun(&FluxboxWindow::close)); + } -- cgit v0.11.2