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

Method projectClosing

plugins/quickopen/projectfilequickopen.cpp:235–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235void ProjectFileDataProvider::projectClosing(IProject* project)
236{
237 // Once we remove all project's files from set, there is no need to listen
238 // to &IProject::fileRemovedFromSet signal from this project and waste time
239 // searching in m_projectFiles. No need to listen to &IProject::fileAddedToSet
240 // signal from this project either - we are not interested in hypothetical
241 // file additions to the project that is about to be closed and destroyed.
242 disconnect(project, nullptr, this, nullptr);
243
244 if (ICore::self()->projectController()->projectCount() == 0) {
245 // No open projects left => just remove all files. This is a little faster
246 // than the algorithm below. Releasing the memory here would slow down the
247 // next call to projectOpened() => keep the capacity of m_projectFiles.
248 m_projectFiles.clear();
249 return;
250 }
251
252 const Path projectPath = project->path();
253 const auto logicalEnd = std::remove_if(m_projectFiles.begin(), m_projectFiles.end(),
254 [&projectPath](const ProjectFile& f) {
255 return f.projectPath == projectPath;
256 });
257 m_projectFiles.erase(logicalEnd, m_projectFiles.end());
258}
259
260void ProjectFileDataProvider::projectOpened(IProject* project)
261{

Callers

nothing calls this directly

Calls 6

projectCountMethod · 0.80
projectControllerMethod · 0.80
clearMethod · 0.45
pathMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected