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

Method cloneSession

kdevplatform/shell/sessioncontroller.cpp:506–522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504}
505
506QString SessionController::cloneSession( const QString& nameOrid )
507{
508 Q_D(SessionController);
509
510 Session* origSession = session(nameOrid);
511 QUuid id = QUuid::createUuid();
512 auto copyJob = KIO::copy(QUrl::fromLocalFile(origSession->dataDirectory()),
513 QUrl::fromLocalFile(sessionDirectory( id.toString())));
514 KJobWidgets::setWindow(copyJob, Core::self()->uiController()->activeMainWindow());
515 copyJob->exec();
516
517 auto* newSession = new Session(id.toString(), this);
518 newSession->setName( i18n( "Copy of %1", origSession->name() ) );
519 d->addSession(newSession);
520 updateXmlGuiActionList();
521 return newSession->name();
522}
523
524void SessionController::updateXmlGuiActionList()
525{

Callers

nothing calls this directly

Calls 8

dataDirectoryMethod · 0.80
uiControllerMethod · 0.80
execMethod · 0.80
toStringMethod · 0.45
activeMainWindowMethod · 0.45
setNameMethod · 0.45
nameMethod · 0.45
addSessionMethod · 0.45

Tested by

no test coverage detected