Baloo
8 #include "unindexedfileindexer.h"
10 #include "unindexedfileiterator.h"
11 #include "transaction.h"
12 #include "fileindexerconfig.h"
13 #include "baloodebug.h"
14 #include "basicindexingjob.h"
16 using namespace Baloo;
18 UnindexedFileIndexer::UnindexedFileIndexer(Database* db,
const FileIndexerConfig* config)
24 void UnindexedFileIndexer::run()
26 const QStringList includeFolders = m_config->includeFolders();
27 const BasicIndexingJob::IndexingLevel
level = m_config->onlyBasicIndexing() ?
28 BasicIndexingJob::NoLevel : BasicIndexingJob::MarkForContentIndexing;
30 for (
const QString& includeFolder : includeFolders) {
31 Transaction tr(m_db, Transaction::ReadWrite);
32 int transactionDocumentCount = 0;
35 while (!it.next().isEmpty()) {
36 BasicIndexingJob job(it.filePath(), it.mimetype(), level);
41 if (it.mTimeChanged() && level == BasicIndexingJob::MarkForContentIndexing) {
42 job.document().setContentIndexing(
true);
46 const quint64
id = job.document().id();
47 if (tr.hasDocument(
id)) {
48 DocumentOperations ops = DocumentTime;
49 if (it.cTimeChanged()) {
52 ops |= (FileNameTerms | DocumentUrl);
55 tr.replaceDocument(job.document(), ops);
58 tr.addDocument(job.document());
61 transactionDocumentCount++;
62 if (transactionDocumentCount > 20000) {
63 qCDebug(BALOO) <<
"Commit";
65 tr.reset(Transaction::ReadWrite);
66 transactionDocumentCount = 0;
75 #include "moc_unindexedfileindexer.cpp"
QStringView level(QStringView ifopt)
Implements storage for docIds without any associated data Instantiated for:
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.
QString decodeName(const QByteArray &localFileName)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Dec 11 2023 03:53:57 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.