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

Method loadDefaultSession

kdevplatform/shell/sessioncontroller.cpp:467–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

465}
466
467void SessionController::loadDefaultSession( const QString& session )
468{
469 Q_D(SessionController);
470
471 QString load = session;
472 if (load.isEmpty()) {
473 KConfigGroup grp = KSharedConfig::openConfig()->group( cfgSessionGroup() );
474 load = grp.readEntry( cfgActiveSessionEntry(), "default" );
475 }
476
477 // Iteratively try to load the session, asking user what to do in case of failure
478 // If showForceOpenDialog() returns empty string, stop trying
479 do
480 {
481 Session* s = this->session(load);
482 if( !s ) {
483 s = createSession( load );
484 }
485 TryLockSessionResult result = d->activateSession( s );
486 if( result.lock ) {
487 Q_ASSERT(d->activeSession == s);
488 Q_ASSERT(d->sessionLock = result.lock);
489 break;
490 }
491 load = handleLockedSession( s->name(), s->id().toString(), result.runInfo );
492 } while( !load.isEmpty() );
493}
494
495Session* SessionController::session( const QString& nameOrId ) const
496{

Callers

nothing calls this directly

Calls 7

sessionMethod · 0.95
readEntryMethod · 0.80
activateSessionMethod · 0.80
isEmptyMethod · 0.45
nameMethod · 0.45
toStringMethod · 0.45
idMethod · 0.45

Tested by

no test coverage detected