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

Method initialize

kdevplatform/shell/sessioncontroller.cpp:335–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

333}
334
335void SessionController::initialize( const QString& session )
336{
337 Q_D(SessionController);
338
339 QDir sessiondir( SessionControllerPrivate::sessionBaseDirectory() );
340
341 const auto sessionDirs = sessiondir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot);
342 for (const QString& s : sessionDirs) {
343 QUuid id( s );
344 if( id.isNull() )
345 continue;
346 // Only create sessions for directories that represent proper uuid's
347 auto* ses = new Session(id.toString(), this);
348
349 //Delete sessions that have no name and are empty
350 if( ses->containedProjects().isEmpty() && ses->name().isEmpty()
351 && (session.isEmpty() || (ses->id().toString() != session && ses->name() != session)) )
352 {
353 TryLockSessionResult result = tryLockSession(s);
354 if (result.lock) {
355 deleteSessionFromDisk(result.lock);
356 }
357 delete ses;
358 } else {
359 d->addSession( ses );
360 }
361 }
362
363 loadDefaultSession( session );
364
365 updateXmlGuiActionList();
366}
367
368
369ISession* SessionController::activeSession() const

Callers

nothing calls this directly

Calls 7

isNullMethod · 0.80
containedProjectsMethod · 0.80
toStringMethod · 0.45
isEmptyMethod · 0.45
nameMethod · 0.45
idMethod · 0.45
addSessionMethod · 0.45

Tested by

no test coverage detected