Akonadi Search

core/resultiterator.cpp
1 /*
2  * This file is part of the KDE Akonadi Search Project
3  * SPDX-FileCopyrightText: 2013 Vishesh Handa <[email protected]>
4  *
5  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6  *
7  */
8 
9 #include "resultiterator.h"
10 
11 using namespace Akonadi::Search;
12 
13 ResultIterator::ResultIterator(int id, SearchStore *store)
14  : d(new ResultIteratorPrivate)
15 {
16  d->queryId = id;
17  d->store = store;
18 }
19 
20 ResultIterator::ResultIterator()
21  : d(new ResultIteratorPrivate)
22 {
23 }
24 
25 ResultIterator::ResultIterator(const ResultIterator &rhs) = default;
26 
27 ResultIterator::~ResultIterator() = default;
28 
29 ResultIterator &ResultIterator::operator=(const ResultIterator &other) = default;
30 
31 bool ResultIterator::next()
32 {
33  if (d->store) {
34  return d->store->next(d->queryId);
35  } else {
36  return false;
37  }
38 }
39 
40 QByteArray ResultIterator::id() const
41 {
42  if (d->store) {
43  return d->store->id(d->queryId);
44  } else {
45  return {};
46  }
47 }
48 
49 QUrl ResultIterator::url() const
50 {
51  if (d->store) {
52  return d->store->url(d->queryId);
53  } else {
54  return {};
55  }
56 }
57 
58 QString ResultIterator::text() const
59 {
60  if (d->store) {
61  return d->store->text(d->queryId);
62  } else {
63  return {};
64  }
65 }
66 
67 QString ResultIterator::icon() const
68 {
69  if (d->store) {
70  return d->store->icon(d->queryId);
71  } else {
72  return {};
73  }
74 }
Akonadi search infrastructure.
Definition: core/query.h:20
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Dec 1 2023 04:09:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.