Baloo::IndexerConfig Class

class Baloo::IndexerConfig

This class allows it to access the current config, to read and modify it. More...

Header: #include <Baloo/IndexerConfig>
CMake: find_package(KF6 REQUIRED COMPONENTS Baloo)
target_link_libraries(mytarget PRIVATE KF6::Baloo)

Public Functions

IndexerConfig()
bool canBeSearched(const QString &folder) const
QStringList excludeFilters() const
QStringList excludeFolders() const
QStringList excludeMimetypes() const
bool fileIndexingEnabled() const
QStringList includeFolders() const
bool indexHidden() const
bool onlyBasicIndexing() const
void refresh() const
void setExcludeFilters(const QStringList &excludeFilters)
void setExcludeFolders(const QStringList &excludeFolders)
void setExcludeMimetypes(const QStringList &excludeMimetypes)
void setFileIndexingEnabled(bool enabled) const
void setIncludeFolders(const QStringList &includeFolders)
void setIndexHidden(bool value) const
void setOnlyBasicIndexing(bool value)
bool shouldBeIndexed(const QString &path) const

Detailed Description

It is not meant as a means to infer the current state of the Indexer or the DB. The DB is updated asynchronously, and changes of the config will not be reflected immediately.

Member Function Documentation

IndexerConfig::IndexerConfig()

bool IndexerConfig::canBeSearched(const QString &folder) const

Check if folder can be searched.

folder can be searched if itself or one of its descendants is indexed.

Example: if ~/foo is not indexed and ~/foo/bar is indexed then ~/foo can be searched.

Returns true if the folder can be searched.

QStringList IndexerConfig::excludeFilters() const

See also setExcludeFilters().

QStringList IndexerConfig::excludeFolders() const

Folders that are excluded from indexing.

(Descendant folders of an excluded folder can be added and they will be indexed.)

See also setExcludeFolders().

QStringList IndexerConfig::excludeMimetypes() const

See also setExcludeMimetypes().

bool IndexerConfig::fileIndexingEnabled() const

See also setFileIndexingEnabled().

QStringList IndexerConfig::includeFolders() const

Folders to search for files to index and analyze.

See also setIncludeFolders().

bool IndexerConfig::indexHidden() const

See also setIndexHidden().

bool IndexerConfig::onlyBasicIndexing() const

See also setOnlyBasicIndexing().

void IndexerConfig::refresh() const

void IndexerConfig::setExcludeFilters(const QStringList &excludeFilters)

See also excludeFilters().

void IndexerConfig::setExcludeFolders(const QStringList &excludeFolders)

See also excludeFolders().

void IndexerConfig::setExcludeMimetypes(const QStringList &excludeMimetypes)

See also excludeMimetypes().

void IndexerConfig::setFileIndexingEnabled(bool enabled) const

See also fileIndexingEnabled().

void IndexerConfig::setIncludeFolders(const QStringList &includeFolders)

See also includeFolders().

void IndexerConfig::setIndexHidden(bool value) const

See also indexHidden().

void IndexerConfig::setOnlyBasicIndexing(bool value)

See also onlyBasicIndexing().

bool IndexerConfig::shouldBeIndexed(const QString &path) const

Check if the file or folder path should be indexed.

If itself or its nearest explicitly included or excluded ancestor is excluded it is not indexed. Otherwise it is indexed according to the includeFolders and excludeFilters config.

Returns true if the file or folder at path should be indexed according to the configuration.

TODO KF6: deprecate, not of any concern for ouside users. Use Baloo::File to know if a file has been indexed.

See also Baloo::File.