Baloo

filecontentindexerprovider.cpp
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}
Implements storage for docIds without any associated data Instantiated for:
Definition coding.cpp:11
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:54:09 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.