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

Method reset

plugins/quickopen/projectitemquickopen.cpp:294–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294void ProjectItemDataProvider::reset()
295{
296 m_files = m_quickopen->fileSet();
297 m_currentItems.clear();
298 m_addedItems.clear();
299 m_addedItemsCountCache.markDirty();
300
301 KDevelop::DUChainReadLocker lock(DUChain::lock());
302 for (const IndexedString& u : std::as_const(m_files)) {
303 uint count;
304 const KDevelop::CodeModelItem* items;
305 CodeModel::self().items(u, count, items);
306
307 for (uint a = 0; a < count; ++a) {
308 if (!items[a].id.isValid() || items[a].kind & CodeModelItem::ForwardDeclaration) {
309 continue;
310 }
311 if (((m_itemTypes & Classes) && (items[a].kind & CodeModelItem::Class)) ||
312 ((m_itemTypes & Functions) && (items[a].kind & CodeModelItem::Function))) {
313 QualifiedIdentifier id = items[a].id.identifier();
314
315 if (id.isEmpty() || id.at(0).identifier().isEmpty()) {
316 // id.isEmpty() not always hit when .toString() is actually empty...
317 // anyhow, this makes sure that we don't show duchain items without
318 // any name that could be searched for. This happens e.g. in the c++
319 // plugin for anonymous structs or sometimes for declarations in macro
320 // expressions
321 continue;
322 }
323 m_currentItems << CodeModelViewItem(u, id);
324 }
325 }
326 }
327
328 m_filteredItems = m_currentItems;
329 m_currentFilter.clear();
330}
331
332
333uint ProjectItemDataProvider::itemCount() const

Callers

nothing calls this directly

Calls 9

CodeModelViewItemClass · 0.85
markDirtyMethod · 0.80
fileSetMethod · 0.45
clearMethod · 0.45
itemsMethod · 0.45
isValidMethod · 0.45
identifierMethod · 0.45
isEmptyMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected