1/*
2 SPDX-FileCopyrightText: 2015 Vishesh Handa <vhanda@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#include "filecontentindexerprovider.h"
8
9#include "transaction.h"
10#include "database.h"
11
12using namespace Baloo;
13
14FileContentIndexerProvider::FileContentIndexerProvider(Database* db)
15 : m_db(db)
16{
17}
18
19QVector<quint64> FileContentIndexerProvider::fetch(uint size)
20{
21 Transaction tr(m_db, Transaction::ReadOnly);
22 return tr.fetchPhaseOneIds(size);
23}
24
25uint FileContentIndexerProvider::size()
26{
27 Transaction tr(m_db, Transaction::ReadOnly);
28 return tr.phaseOneSize();
29}
30
31bool FileContentIndexerProvider::markFailed(quint64 id)
32{
33 Transaction tr(m_db, Transaction::ReadWrite);
34 if (!tr.hasFailed(id)) {
35 tr.addFailed(id);
36 }
37 tr.removePhaseOne(id);
38 return tr.commit();
39}
40

source code of baloo/src/file/filecontentindexerprovider.cpp