| 292 | } |
| 293 | |
| 294 | void 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 | |
| 333 | uint ProjectItemDataProvider::itemCount() const |
nothing calls this directly
no test coverage detected