Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/shell/projectcontroller.cpp
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Line(s) | 96 | // IProject* m_currentProject; | |||
---|---|---|---|---|---|
102 | IProjectDialogProvider* dialog; | 102 | IProjectDialogProvider* dialog; | ||
103 | QList<QUrl> m_currentlyOpening; // project-file urls that are being opened | 103 | QList<QUrl> m_currentlyOpening; // project-file urls that are being opened | ||
104 | ProjectController* q; | 104 | ProjectController* q; | ||
105 | ProjectBuildSetModel* buildset; | 105 | ProjectBuildSetModel* buildset; | ||
106 | bool m_foundProjectFile; //Temporary flag used while searching the hierarchy for a project file | 106 | bool m_foundProjectFile; //Temporary flag used while searching the hierarchy for a project file | ||
107 | bool m_cleaningUp; //Temporary flag enabled while destroying the project-controller | 107 | bool m_cleaningUp; //Temporary flag enabled while destroying the project-controller | ||
108 | QPointer<ProjectChangesModel> m_changesModel; | 108 | QPointer<ProjectChangesModel> m_changesModel; | ||
109 | QHash< IProject*, QPointer<KJob> > m_parseJobs; // parse jobs that add files from the project to the background parser. | 109 | QHash< IProject*, QPointer<KJob> > m_parseJobs; // parse jobs that add files from the project to the background parser. | ||
110 | QList<IProject*> m_pendingParseProjectJobs; // project parse jobs waiting to be started | ||||
110 | 111 | | |||
111 | explicit ProjectControllerPrivate( ProjectController* p ) | 112 | explicit ProjectControllerPrivate( ProjectController* p ) | ||
112 | : m_core(nullptr), model(nullptr), dialog(nullptr), q(p), buildset(nullptr), m_foundProjectFile(false), m_cleaningUp(false) | 113 | : m_core(nullptr), model(nullptr), dialog(nullptr), q(p), buildset(nullptr), m_foundProjectFile(false), m_cleaningUp(false) | ||
113 | { | 114 | { | ||
114 | } | 115 | } | ||
115 | 116 | | |||
116 | void unloadAllProjectPlugins() | 117 | void unloadAllProjectPlugins() | ||
117 | { | 118 | { | ||
▲ Show 20 Lines • Show All 774 Lines • ▼ Show 20 Line(s) | 888 | { | |||
892 | 893 | | |||
893 | config->sync(); | 894 | config->sync(); | ||
894 | } | 895 | } | ||
895 | 896 | | |||
896 | Q_ASSERT(d->m_currentlyOpening.contains(project->projectFile().toUrl())); | 897 | Q_ASSERT(d->m_currentlyOpening.contains(project->projectFile().toUrl())); | ||
897 | d->m_currentlyOpening.removeAll(project->projectFile().toUrl()); | 898 | d->m_currentlyOpening.removeAll(project->projectFile().toUrl()); | ||
898 | emit projectOpened( project ); | 899 | emit projectOpened( project ); | ||
899 | 900 | | |||
901 | // don't call reparseProject immediately, defer until all currently opening | ||||
902 | // projects have been imported. Parsing is done in the background but | ||||
903 | // importing can block the UI so should be as fast as possible. | ||||
904 | if (d->m_currentlyOpening.isEmpty()) { | ||||
900 | reparseProject(project); | 905 | reparseProject(project); | ||
906 | foreach (const auto p, d->m_pendingParseProjectJobs) { | ||||
907 | reparseProject(p); | ||||
908 | } | ||||
909 | d->m_pendingParseProjectJobs.clear(); | ||||
910 | } else { | ||||
911 | d->m_pendingParseProjectJobs.append(project); | ||||
912 | } | ||||
901 | } | 913 | } | ||
902 | 914 | | |||
903 | // helper method for closeProject() | 915 | // helper method for closeProject() | ||
904 | void ProjectController::unloadUnusedProjectPlugins(IProject* proj) | 916 | void ProjectController::unloadUnusedProjectPlugins(IProject* proj) | ||
905 | { | 917 | { | ||
906 | QList<IPlugin*> pluginsForProj = d->m_projectPlugins.value( proj ); | 918 | QList<IPlugin*> pluginsForProj = d->m_projectPlugins.value( proj ); | ||
907 | d->m_projectPlugins.remove( proj ); | 919 | d->m_projectPlugins.remove( proj ); | ||
908 | 920 | | |||
▲ Show 20 Lines • Show All 337 Lines • Show Last 20 Lines |