Akonadi Search

core/resultiterator.cpp
1/*
2 * This file is part of the KDE Akonadi Search Project
3 * SPDX-FileCopyrightText: 2013 Vishesh Handa <me@vhanda.in>
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
11using namespace Akonadi::Search;
12
13ResultIterator::ResultIterator(int id, SearchStore *store)
14 : d(new ResultIteratorPrivate)
15{
16 d->queryId = id;
17 d->store = store;
18}
19
20ResultIterator::ResultIterator()
21 : d(new ResultIteratorPrivate)
22{
23}
24
25ResultIterator::ResultIterator(const ResultIterator &rhs) = default;
26
27ResultIterator::~ResultIterator() = default;
28
29ResultIterator &ResultIterator::operator=(const ResultIterator &other) = default;
30
31bool ResultIterator::next()
32{
33 if (d->store) {
34 return d->store->next(d->queryId);
35 } else {
36 return false;
37 }
38}
39
40QByteArray ResultIterator::id() const
41{
42 if (d->store) {
43 return d->store->id(d->queryId);
44 } else {
45 return {};
46 }
47}
48
49QUrl ResultIterator::url() const
50{
51 if (d->store) {
52 return d->store->url(d->queryId);
53 } else {
54 return {};
55 }
56}
57
58QString ResultIterator::text() const
59{
60 if (d->store) {
61 return d->store->text(d->queryId);
62 } else {
63 return {};
64 }
65}
66
67QString 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:21
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:56:53 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.