| 1028 | } |
| 1029 | |
| 1030 | void ProjectController::takeProject(IProject* proj) |
| 1031 | { |
| 1032 | Q_D(ProjectController); |
| 1033 | |
| 1034 | if (!proj) { |
| 1035 | return; |
| 1036 | } |
| 1037 | |
| 1038 | // loading might have failed |
| 1039 | d->m_currentlyOpening.removeAll(proj->projectFile().toUrl()); |
| 1040 | d->m_projects.removeAll(proj); |
| 1041 | if (auto* job = d->m_parseJobs.value(proj)) { |
| 1042 | job->kill(); // Removes job from m_parseJobs. |
| 1043 | } |
| 1044 | emit projectClosing(proj); |
| 1045 | //Core::self()->saveSettings(); // The project file is being closed. |
| 1046 | // Now we can save settings for all of the Core |
| 1047 | // objects including this one!! |
| 1048 | unloadUnusedProjectPlugins(proj); |
| 1049 | closeAllOpenedFiles(proj); |
| 1050 | proj->close(); |
| 1051 | if (d->m_projects.isEmpty()) |
| 1052 | { |
| 1053 | initializePluginCleanup(proj); |
| 1054 | } |
| 1055 | |
| 1056 | if(!d->m_cleaningUp) |
| 1057 | d->saveListOfOpenedProjects(); |
| 1058 | |
| 1059 | emit projectClosed(proj); |
| 1060 | } |
| 1061 | |
| 1062 | void ProjectController::closeProject(IProject* proj) |
| 1063 | { |