diff --git a/src/file/fileindexerconfig.h b/src/file/fileindexerconfig.h --- a/src/file/fileindexerconfig.h +++ b/src/file/fileindexerconfig.h @@ -42,20 +42,21 @@ Q_OBJECT public: - /** - * Create a new file indexr config. - */ + explicit FileIndexerConfig(QObject* parent = nullptr); ~FileIndexerConfig(); /** - * The folders to search for files to analyze. Cached and cleaned up. + * Folders to search for files to analyze and index. + * \return list of paths. */ QStringList includeFolders() const; /** - * The folders that should be excluded. Cached and cleaned up. - * It is perfectly possible to include subfolders again. + * Folders that are excluded from indexing. + * (It is possible to include descendants of an excluded folder again + * and they will be indexed.) + * \return list of paths. */ QStringList excludeFolders() const; @@ -68,8 +69,8 @@ bool onlyBasicIndexing() const; /** - * true the first time the service is run (or after manually - * tampering with the config. + * \return \c true if the service is run for the first time + * (or after manually setting "first run=true" in the config). */ bool isInitialRun() const; @@ -83,13 +84,16 @@ bool initialUpdateDisabled() 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. + * Check if \p folder can be searched taking includeFolders() into account. + * \p folder can be searched if itself or one of + * its descendants is indexed. + * + * Example: + * if ~/foo is not indexed + * and ~/foo/bar is indexed + * ~/foo can be searched. * - * \return \p true if the \p folder should + * \return \c true if the \p folder can * be searched. */ bool canBeSearched(const QString& folder) const; @@ -103,7 +107,7 @@ * match any of the exclude filters. Only the name of the * dir itself it checked. * - * \return \p true if the file or folder at \p path should + * \return \c true if the file or folder at \p path should * be indexed according to the configuration. */ bool shouldBeIndexed(const QString& path) const; @@ -115,24 +119,24 @@ * match any of the exclude filters. Only the name of the * dir itself it checked. * - * \return \p true if the folder at \p path should + * \return \c true if the folder at \p path should * be indexed according to the configuration. */ bool shouldFolderBeIndexed(const QString& path) const; /** * Check \p fileName for all exclude filters. This does * not take file paths into account. * - * \return \p true if a file with name \p filename should + * \return \c true if a file with name \p filename should * be indexed according to the configuration. */ bool shouldFileBeIndexed(const QString& fileName) const; /** * Checks if \p mimeType should be indexed * - * \return \p true if the mimetype should be indexed according + * \return \c true if the mimetype should be indexed according * to the configuration */ bool shouldMimeTypeBeIndexed(const QString& mimeType) const; diff --git a/src/lib/indexerconfig.h b/src/lib/indexerconfig.h --- a/src/lib/indexerconfig.h +++ b/src/lib/indexerconfig.h @@ -35,9 +35,32 @@ bool fileIndexingEnabled() const; void setFileIndexingEnabled(bool enabled) const; + /** + * Check if \p path should be indexed taking into account + * the includeFolders(), the excludeFolders(), and the + * excludeFilters(). + * + * Be aware that this method does not check if parent dirs + * match any of the exclude filters. Only the name of the + * dir itself it checked. + * + * \return \c true if the file or folder at \p path should + * be indexed according to the configuration. + */ bool shouldBeIndexed(const QString& path) const; + /** + * Folders to search for files to analyze and index. + * \return list of paths. + */ QStringList includeFolders() const; + + /** + * Folders that are excluded from indexing. + * (It is possible to include descendants of an excluded folder again + * and they will be indexed.) + * \return list of paths. + */ QStringList excludeFolders() const; QStringList excludeFilters() const; QStringList excludeMimetypes() const; @@ -48,8 +71,8 @@ void setExcludeMimetypes(const QStringList& excludeMimetypes); /** - * The first run indicates if the File Indexer has ever been run before - * and made a successful pass over all the files. + * \return \c true if the service is run for the first time + * (or after manually setting "first run=true" in the config). */ bool firstRun() const; void setFirstRun(bool firstRun) const;