Baloo

unindexedfileiterator.h
1 /*
2  This file is part of the KDE Baloo project.
3  SPDX-FileCopyrightText: 2015 Vishesh Handa <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.1-or-later
6 */
7 
8 #ifndef BALOO_UNINDEXEDFILEITERATOR_H
9 #define BALOO_UNINDEXEDFILEITERATOR_H
10 
11 #include "filtereddiriterator.h"
12 
13 #include <QMimeDatabase>
14 
15 namespace Baloo {
16 
17 class Transaction;
18 
19 /**
20  * Iterate over all the files (and directories) under a specific directory which require
21  * indexing. This checks the following -
22  * - Config include / exclude path
23  * - Config filters
24  * - Config mimetype filters
25  * - Database for mtime differences
26  */
28 {
29 public:
30  UnIndexedFileIterator(const FileIndexerConfig* config, Transaction* transaction, const QString& folder);
32 
33  QString next();
34  QString filePath() const;
35  QString mimetype() const;
36  bool mTimeChanged() const;
37  bool cTimeChanged() const;
38 
39 private:
40  bool shouldIndex(const QString& filePath);
41 
42  const FileIndexerConfig* m_config;
43  Transaction* m_transaction;
44  FilteredDirIterator m_iter;
45 
46  QMimeDatabase m_mimeDb;
47  QString m_mimetype;
48 
49  bool m_mTimeChanged;
50  bool m_cTimeChanged;
51 };
52 
53 }
54 
55 #endif // BALOO_UNINDEXEDFILEITERATOR_H
Implements storage for docIds without any associated data Instantiated for:
Definition: coding.cpp:11
Active config class which emits signals if the config was changed, for example if the KCM saved the c...
KSharedConfigPtr config()
Iterate over all the files (and directories) under a specific directory which require indexing.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Nov 29 2023 03:56:26 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.