diff --git a/src/lib/indexerconfig.h b/src/lib/indexerconfig.h --- a/src/lib/indexerconfig.h +++ b/src/lib/indexerconfig.h @@ -37,6 +37,18 @@ bool shouldBeIndexed(const QString& path) const; + /** + * Check if \p folder can be searched taking only + * the includeFolders() into account. + * + * A path can be searched if itself or one of + * its descendants should be indexed. + * + * \return \p true if the \p folder should + * be searched. + */ + bool canBeSearched(const QString& folder) const; + QStringList includeFolders() const; QStringList excludeFolders() const; QStringList excludeFilters() const; diff --git a/src/lib/indexerconfig.cpp b/src/lib/indexerconfig.cpp --- a/src/lib/indexerconfig.cpp +++ b/src/lib/indexerconfig.cpp @@ -72,6 +72,12 @@ return d->m_config.shouldBeIndexed(path); } + +bool IndexerConfig::canBeSearched(const QString& folder) const +{ + return d->m_config.canBeSearched(folder); +} + QStringList IndexerConfig::excludeFolders() const { return d->m_config.excludeFolders();