| 431 | } |
| 432 | |
| 433 | void 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 | |
| 459 | void SessionController::deleteSessionFromDisk( const ISessionLock::Ptr& lock ) |
| 460 | { |