| 538 | } |
| 539 | |
| 540 | void Project::close() |
| 541 | { |
| 542 | Q_D(Project); |
| 543 | |
| 544 | Q_ASSERT(d->topItem); |
| 545 | if (d->topItem->row() == -1) { |
| 546 | qCWarning(SHELL) << "Something went wrong. ProjectFolderItem detached. Project closed during reload?"; |
| 547 | return; |
| 548 | } |
| 549 | |
| 550 | Core::self()->projectController()->projectModel()->removeRow( d->topItem->row() ); |
| 551 | |
| 552 | if (!d->developerFile.isLocalFile()) |
| 553 | { |
| 554 | auto copyJob = KIO::file_copy(QUrl::fromLocalFile(d->developerTempFile), d->developerFile.toUrl(), -1, KIO::HideProgressInfo); |
| 555 | KJobWidgets::setWindow(copyJob, Core::self()->uiController()->activeMainWindow()); |
| 556 | if (!copyJob->exec()) { |
| 557 | qCDebug(SHELL) << "Job failed:" << copyJob->errorString(); |
| 558 | |
| 559 | KMessageBox::error(Core::self()->uiController()->activeMainWindow(), |
| 560 | i18n("Could not store developer specific project configuration.\n" |
| 561 | "Attention: The project settings you changed will be lost.")); |
| 562 | } |
| 563 | } |
| 564 | } |
| 565 | |
| 566 | bool Project::inProject( const IndexedString& path ) const |
| 567 | { |