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

Method fileRemovedFromSet

plugins/quickopen/projectfilequickopen.cpp:312–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310}
311
312void ProjectFileDataProvider::fileRemovedFromSet(ProjectFileItem* file)
313{
314 ProjectFile item;
315 item.path = file->path();
316 item.indexedPath = file->indexedPathView();
317
318 // fast-path for non-generated files
319 // NOTE: figuring out whether something is generated is expensive... and since
320 // generated files are rare we apply this two-step algorithm here
321 auto it = std::lower_bound(m_projectFiles.begin(), m_projectFiles.end(), item);
322 if (it != m_projectFiles.end() && it->indexedPath == item.indexedPath) {
323 m_projectFiles.erase(it);
324 return;
325 }
326
327 // last try: maybe it was generated
328 item.outsideOfProject = true;
329 it = std::lower_bound(m_projectFiles.begin(), m_projectFiles.end(), item);
330 if (it != m_projectFiles.end() && it->indexedPath == item.indexedPath) {
331 m_projectFiles.erase(it);
332 return;
333 }
334}
335
336void ProjectFileDataProvider::reset()
337{

Callers

nothing calls this directly

Calls 4

indexedPathViewMethod · 0.80
pathMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected