Correctly list the open programs when trying to quit

Summary:
Uniquely iterate over the sessions instead of checking
for all sessions inside of a terminal window.  The tabs in
split view will have duplicate sessions.

Test Plan:
Open Konsole, run any application that will not quit, like top
split screen, duplicating the Views, close konsole.

top will appear in the list of applications that are opened twice.

Reviewers: hindenburg, #konsole

Reviewed By: hindenburg, #konsole

Subscribers: konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D13364
wilder-portage
Tomaz Canabrava 8 years ago committed by Kurt Hindenburg
parent 85ee52b10f
commit 6ca007fcb3
  1. 4
      src/MainWindow.cpp

@ -575,7 +575,9 @@ bool MainWindow::queryClose()
// Check what processes are running, excluding the shell
QStringList processesRunning;
foreach (Session *session, _viewManager->sessions()) {
const auto uniqueSessions = QSet<Session*>::fromList(_viewManager->sessions());
foreach (Session *session, uniqueSessions) {
if ((session == nullptr) || !session->isForegroundProcessActive()) {
continue;
}

Loading…
Cancel
Save