summaryrefslogtreecommitdiffabout
path: root/kaddressbook/filter.cpp
authorzautrix <zautrix>2005-01-16 14:10:42 (UTC)
committer zautrix <zautrix>2005-01-16 14:10:42 (UTC)
commitde5f08d69c716f85cc92f20700cd24fb1ad41295 (patch) (side-by-side diff)
tree0a4f5dbbdb4fc24215ab85fa4b5e073d0e8104ef /kaddressbook/filter.cpp
parent3f61f5a339e9c0c67c17b16214abded0d123f246 (diff)
downloadkdepimpi-de5f08d69c716f85cc92f20700cd24fb1ad41295.zip
kdepimpi-de5f08d69c716f85cc92f20700cd24fb1ad41295.tar.gz
kdepimpi-de5f08d69c716f85cc92f20700cd24fb1ad41295.tar.bz2
added AB filter settings
Diffstat (limited to 'kaddressbook/filter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/filter.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/kaddressbook/filter.cpp b/kaddressbook/filter.cpp
index 39d2ae4..9cb4c2d 100644
--- a/kaddressbook/filter.cpp
+++ b/kaddressbook/filter.cpp
@@ -30,2 +30,3 @@
#include "filter.h"
+#include <secrecy.h>
@@ -35,2 +36,3 @@ Filter::Filter()
{
+ mCriteria = ShowPublic | ShowPrivate| ShowConfidential ;
}
@@ -41,2 +43,3 @@ Filter::Filter( const QString &name )
{
+ mCriteria = ShowPublic | ShowPrivate| ShowConfidential ;
}
@@ -81,2 +84,19 @@ bool Filter::filterAddressee( const KABC::Addressee &a )
{
+ switch ( a.secrecy().type()) {
+ case KABC::Secrecy::Public:
+ if (! (mCriteria & ShowPublic ))
+ return false;
+ break;
+ case KABC::Secrecy::Private:
+ if (! (mCriteria & ShowPrivate ))
+ return false;
+ break;
+ case KABC::Secrecy::Confidential:
+ if (! (mCriteria & ShowConfidential ))
+ return false;
+ break;
+ default:
+ return false;
+ break;
+ }
QStringList::Iterator iter;
@@ -122,2 +142,3 @@ void Filter::save( KConfig *config )
config->writeEntry( "MatchRule", (int)mMatchRule );
+ config->writeEntry( "Criteria", (int)mCriteria );
}
@@ -130,2 +151,3 @@ void Filter::restore( KConfig *config )
mMatchRule = (MatchRule)config->readNumEntry( "MatchRule", Matching );
+ mCriteria = config->readNumEntry( "Criteria", (ShowPublic | ShowPrivate| ShowConfidential) );
}