Prepare future 5.1.1
[kdepim.git] / kaddressbook / contactlist.cpp
blob0ba95387a8ceb52dbd452355495d5e92b93a9a20
1 /*
2 This file is part of KAddressBook.
4 Copyright (c) 2015 Laurent Montel <montel@kde.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #include "contactlist.h"
23 ContactList::ContactList()
28 bool ContactList::isEmpty() const
30 return (mAddressList.isEmpty() && mContactGroupList.isEmpty());
33 int ContactList::count() const
35 return (mAddressList.count() + mContactGroupList.count());
38 void ContactList::clear()
40 mAddressList.clear();
41 mContactGroupList.clear();
44 void ContactList::append(const KContacts::Addressee &addr)
46 mAddressList.append(addr);
49 void ContactList::append(const KContacts::ContactGroup &group)
51 mContactGroupList.append(group);
54 KContacts::ContactGroup::List ContactList::contactGroupList() const
56 return mContactGroupList;
59 void ContactList::setContactGroupList(const KContacts::ContactGroup::List &value)
61 mContactGroupList = value;
64 KContacts::Addressee::List ContactList::addressList() const
66 return mAddressList;
69 void ContactList::setAddressList(const KContacts::Addressee::List &value)
71 mAddressList = value;