This class represents both the blacklist and the whitelist. For using create an object of it and call check() to test a sender address. You have to call load() after the settings in the config file was changed. More...
#include <senderlistfilter.h>
Public Member Functions | |
SenderListFilter () | |
~SenderListFilter () | |
FilterAction_Type | check (QString sender) const |
void | load () |
void | print () |
bool | isOnWhitelist (const QString &sender) const |
QStringList | getBlacklist () const |
QStringList | getWhitelist () const |
Protected Member Functions | |
bool | search (QStringList list, QString sender) const |
Private Attributes | |
KSharedConfigPtr | config |
QStringList | blacklist |
QStringList | whitelist |
FilterAction_Type | blacklistAction |
This class represents both the blacklist and the whitelist. For using create an object of it and call check() to test a sender address. You have to call load() after the settings in the config file was changed.
Definition at line 44 of file senderlistfilter.h.
SenderListFilter::SenderListFilter | ( | ) |
Constructor
Definition at line 20 of file senderlistfilter.cpp.
SenderListFilter::~SenderListFilter | ( | ) |
Destructor
Definition at line 32 of file senderlistfilter.cpp.
FilterAction_Type SenderListFilter::check | ( | QString | sender | ) | const |
Checks the given sender whether it is listed in the blacklist or whitelist.
sender | sender which shall be checked
|
Definition at line 36 of file senderlistfilter.cpp.
QStringList SenderListFilter::getBlacklist | ( | ) | const |
QStringList SenderListFilter::getWhitelist | ( | ) | const |
bool SenderListFilter::isOnWhitelist | ( | const QString & | sender | ) | const |
Checks whether sender is on the whitelist
sender | the sender to check
|
Definition at line 110 of file senderlistfilter.cpp.
void SenderListFilter::load | ( | ) |
Loads the setup from the application config file.
Definition at line 51 of file senderlistfilter.cpp.
void SenderListFilter::print | ( | ) |
Prints the settings.
Definition at line 85 of file senderlistfilter.cpp.
bool SenderListFilter::search | ( | QStringList | list, | |
QString | sender | |||
) | const [protected] |
Returns TRUE if the given list contains the sender or a part of it. e.g.: The list contains: Ulrich Weigelt spam@spamhouse.com "Lara Croft" <lara.croft@tombraider.com>
This sender strings will cause a return value of TRUE: "Ulrich Weigelt" <ulrich.weigelt@gmx.de> "Spam King" <spam@spamhouse.com> spam@spamhouse.com lara.croft@tombraider.com "Lara Croft" <lara.croft@tombraider.com>
list | blacklist or whitelist
|
Definition at line 69 of file senderlistfilter.cpp.
QStringList SenderListFilter::blacklist [private] |
blacklisted addresses
Definition at line 104 of file senderlistfilter.h.
appointed action of the blacklist.
Definition at line 114 of file senderlistfilter.h.
KSharedConfigPtr SenderListFilter::config [private] |
Connector to the configuration file
Definition at line 99 of file senderlistfilter.h.
QStringList SenderListFilter::whitelist [private] |
whitelisted addresses
Definition at line 109 of file senderlistfilter.h.