File indexing completed on 2024-04-28 03:51:54

0001 /*
0002     This file is part of the KDE Baloo project.
0003     SPDX-FileCopyrightText: 2015 Vishesh Handa <vhanda@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 
0008 #include "unindexedfileiterator.h"
0009 #include "fileindexerconfig.h"
0010 
0011 #include "database.h"
0012 #include "transaction.h"
0013 
0014 #include <QCoreApplication>
0015 #include <QTemporaryDir>
0016 #include <QElapsedTimer>
0017 
0018 using namespace Baloo;
0019 
0020 int main(int argc, char** argv)
0021 {
0022     QCoreApplication app(argc, argv);
0023 
0024     QTemporaryDir tempDir;
0025     qDebug() << tempDir.path();
0026 
0027     Database db(tempDir.path());
0028     db.open(Baloo::Database::CreateDatabase);
0029 
0030     Transaction tr(db, Transaction::ReadWrite);
0031 
0032     FileIndexerConfig config;
0033 
0034     QElapsedTimer timer;
0035     timer.start();
0036 
0037     UnIndexedFileIterator it(&config, &tr, QDir::homePath());
0038     while (!it.next().isEmpty()) {
0039         ;
0040     }
0041 
0042     qDebug() << "Done" << timer.elapsed() << "msecs";
0043     return 0;
0044 }