Baloo

filecontentindexerprovider.cpp
1 /*
2  SPDX-FileCopyrightText: 2015 Vishesh Handa <[email protected]>
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 
12 using namespace Baloo;
13 
14 FileContentIndexerProvider::FileContentIndexerProvider(Database* db)
15  : m_db(db)
16 {
17 }
18 
19 QVector<quint64> FileContentIndexerProvider::fetch(uint size)
20 {
21  Transaction tr(m_db, Transaction::ReadOnly);
22  return tr.fetchPhaseOneIds(size);
23 }
24 
25 uint FileContentIndexerProvider::size()
26 {
27  Transaction tr(m_db, Transaction::ReadOnly);
28  return tr.phaseOneSize();
29 }
30 
31 bool 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-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.