| 504 | } |
| 505 | |
| 506 | QString 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 | |
| 524 | void SessionController::updateXmlGuiActionList() |
| 525 | { |
nothing calls this directly
no test coverage detected