MCPcopy Create free account
hub / github.com/KDE/kdevelop / debuggerStateChanged

Method debuggerStateChanged

kdevplatform/shell/debugcontroller.cpp:409–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407
408
409void 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
449void DebugController::updateDebuggerState(IDebugSession::DebuggerState state, IDebugSession *session)
450{

Callers

nothing calls this directly

Calls 10

shuttingDownMethod · 0.80
uiControllerInternalMethod · 0.80
activeSublimeWindowMethod · 0.80
switchToAreaMethod · 0.80
workingSetPersistentMethod · 0.80
areaMethod · 0.45
workingSetMethod · 0.45
setWorkingSetMethod · 0.45
toolViewToRaiseAtEndMethod · 0.45
raiseToolViewMethod · 0.45

Tested by

no test coverage detected