minor code simplification

This commit is contained in:
Mathias Gumz 2010-09-04 14:41:39 +02:00
parent 1e9dafdc67
commit b1b2f47e7d

View file

@ -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));
}