root / kadu-core / buddies / filter / non-account-buddy-filter.cpp @ d8068106
History | View | Annotate | Download (1.3 kB)
| 1 | /*
|
|---|---|
| 2 | * %kadu copyright begin% |
| 3 | * Copyright 2009, 2009, 2010 RafaĆ Malinowski (rafal.przemyslaw.malinowski@gmail.com) |
| 4 | * %kadu copyright end% |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as |
| 8 | * published by the Free Software Foundation; either version 2 of |
| 9 | * the License, or (at your option) any later version. |
| 10 | * |
| 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. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | |
| 20 | #include "buddies/buddy.h" |
| 21 | |
| 22 | #include "non-account-buddy-filter.h" |
| 23 | |
| 24 | NonAccountBuddyFilter::NonAccountBuddyFilter(QObject *parent) : |
| 25 | AbstractBuddyFilter(parent) |
| 26 | {
|
| 27 | } |
| 28 | |
| 29 | NonAccountBuddyFilter::~NonAccountBuddyFilter() |
| 30 | {
|
| 31 | } |
| 32 | |
| 33 | void NonAccountBuddyFilter::setAccount(Account account)
|
| 34 | {
|
| 35 | if (CurrentAccount != account)
|
| 36 | {
|
| 37 | CurrentAccount = account; |
| 38 | emit filterChanged(); |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | bool NonAccountBuddyFilter::acceptBuddy(Buddy buddy)
|
| 43 | {
|
| 44 | return CurrentAccount.isNull() || !buddy.hasContact(CurrentAccount);
|
| 45 | } |