1/*
2 Copyright (c) 2014 Christian Mollekopf <mollekopf@kolabsys.com>
3
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
8
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
18*/
19
20#include "tagfetchscope.h"
21#include <QSet>
22
23using namespace Akonadi;
24
25struct Akonadi::TagFetchScope::Private
26{
27 QSet<QByteArray> mAttributes;
28};
29
30TagFetchScope::TagFetchScope()
31 : d(new Private)
32{
33
34}
35
36TagFetchScope::~TagFetchScope()
37{
38}
39
40TagFetchScope::TagFetchScope(const TagFetchScope &other)
41 : d(new Private)
42{
43 operator=(other);
44}
45
46TagFetchScope &TagFetchScope::operator=(const TagFetchScope &other)
47{
48 d->mAttributes = other.d->mAttributes;
49 return *this;
50}
51
52QSet<QByteArray> TagFetchScope::attributes() const
53{
54 return d->mAttributes;
55}
56
57void TagFetchScope::fetchAttribute(const QByteArray &type, bool fetch)
58{
59 if (fetch) {
60 d->mAttributes.insert(type);
61 } else {
62 d->mAttributes.remove(type);
63 }
64}
65