| 407 | |
| 408 | |
| 409 | void DebugController::debuggerStateChanged(KDevelop::IDebugSession::DebuggerState state) |
| 410 | { |
| 411 | Q_ASSERT(qobject_cast<IDebugSession*>(sender())); |
| 412 | auto* session = static_cast<IDebugSession*>(sender()); |
| 413 | qCDebug(SHELL) << "debugger state of" << (session == m_currentSession ? "current" : "noncurrent") << session |
| 414 | << "changed to" << state; |
| 415 | if (session == m_currentSession) { |
| 416 | updateDebuggerState(state, session); |
| 417 | } |
| 418 | |
| 419 | if (state == IDebugSession::EndedState) { |
| 420 | if (session == m_currentSession) { |
| 421 | m_currentSession = nullptr; |
| 422 | Q_EMIT currentSessionChanged(nullptr, session); |
| 423 | if (!Core::self()->shuttingDown()) { |
| 424 | auto* const uiController = Core::self()->uiControllerInternal(); |
| 425 | auto* const mainWindow = uiController->activeSublimeWindow(); |
| 426 | if (mainWindow && mainWindow->area()->objectName() != QLatin1String("code")) { |
| 427 | auto oldArea = mainWindow->area(); |
| 428 | QString workingSet = oldArea->workingSet(); |
| 429 | uiController->switchToArea(QStringLiteral("code"), IUiController::ThisWindow); |
| 430 | mainWindow->area()->setWorkingSet(workingSet, oldArea->workingSetPersistent(), oldArea); |
| 431 | } |
| 432 | |
| 433 | switch (session->toolViewToRaiseAtEnd()) { |
| 434 | case IDebugSession::ToolView::None: |
| 435 | break; |
| 436 | case IDebugSession::ToolView::Build: |
| 437 | uiController->raiseToolView(QStringLiteral("org.kdevelop.OutputView.Build")); |
| 438 | break; |
| 439 | case IDebugSession::ToolView::Debug: |
| 440 | uiController->raiseToolView(QStringLiteral("org.kdevelop.OutputView.Debug")); |
| 441 | break; |
| 442 | } |
| 443 | } |
| 444 | } |
| 445 | session->deleteLater(); |
| 446 | } |
| 447 | } |
| 448 | |
| 449 | void DebugController::updateDebuggerState(IDebugSession::DebuggerState state, IDebugSession *session) |
| 450 | { |
nothing calls this directly
no test coverage detected