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

Method deleteSession

kdevplatform/shell/sessioncontroller.cpp:433–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431}
432
433void SessionController::deleteSession( const ISessionLock::Ptr& lock )
434{
435 Q_D(SessionController);
436
437 Session* s = session(lock->id());
438
439 QHash<Session*,QAction*>::iterator it = d->sessionActions.find(s);
440 Q_ASSERT( it != d->sessionActions.end() );
441
442 unplugActionList( QStringLiteral("available_sessions") );
443 actionCollection()->removeAction(*it);
444 if (d->grp) { // happens in unit tests
445 d->grp->removeAction(*it);
446 plugActionList( QStringLiteral("available_sessions"), d->grp->actions() );
447 }
448
449 if (s == d->activeSession) {
450 d->activeSession = nullptr;
451 }
452 deleteSessionFromDisk(lock);
453
454 emit sessionDeleted( s->id().toString() );
455 d->sessionActions.remove(s);
456 delete s;
457}
458
459void SessionController::deleteSessionFromDisk( const ISessionLock::Ptr& lock )
460{

Callers 1

testDeferredDeletionMethod · 0.45

Calls 7

removeActionMethod · 0.80
idMethod · 0.45
findMethod · 0.45
endMethod · 0.45
actionsMethod · 0.45
toStringMethod · 0.45
removeMethod · 0.45

Tested by 1

testDeferredDeletionMethod · 0.36