author | zautrix <zautrix> | 2005-01-16 14:10:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-16 14:10:42 (UTC) |
commit | de5f08d69c716f85cc92f20700cd24fb1ad41295 (patch) (unidiff) | |
tree | 0a4f5dbbdb4fc24215ab85fa4b5e073d0e8104ef /kaddressbook/filter.cpp | |
parent | 3f61f5a339e9c0c67c17b16214abded0d123f246 (diff) | |
download | kdepimpi-de5f08d69c716f85cc92f20700cd24fb1ad41295.zip kdepimpi-de5f08d69c716f85cc92f20700cd24fb1ad41295.tar.gz kdepimpi-de5f08d69c716f85cc92f20700cd24fb1ad41295.tar.bz2 |
added AB filter settings
-rw-r--r-- | kaddressbook/filter.cpp | 22 |
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 @@ | |||
30 | #include "filter.h" | 30 | #include "filter.h" |
31 | #include <secrecy.h> | ||
31 | 32 | ||
@@ -35,2 +36,3 @@ Filter::Filter() | |||
35 | { | 36 | { |
37 | mCriteria = ShowPublic | ShowPrivate| ShowConfidential ; | ||
36 | } | 38 | } |
@@ -41,2 +43,3 @@ Filter::Filter( const QString &name ) | |||
41 | { | 43 | { |
44 | mCriteria = ShowPublic | ShowPrivate| ShowConfidential ; | ||
42 | } | 45 | } |
@@ -81,2 +84,19 @@ bool Filter::filterAddressee( const KABC::Addressee &a ) | |||
81 | { | 84 | { |
85 | switch ( a.secrecy().type()) { | ||
86 | case KABC::Secrecy::Public: | ||
87 | if (! (mCriteria & ShowPublic )) | ||
88 | return false; | ||
89 | break; | ||
90 | case KABC::Secrecy::Private: | ||
91 | if (! (mCriteria & ShowPrivate )) | ||
92 | return false; | ||
93 | break; | ||
94 | case KABC::Secrecy::Confidential: | ||
95 | if (! (mCriteria & ShowConfidential )) | ||
96 | return false; | ||
97 | break; | ||
98 | default: | ||
99 | return false; | ||
100 | break; | ||
101 | } | ||
82 | QStringList::Iterator iter; | 102 | QStringList::Iterator iter; |
@@ -122,2 +142,3 @@ void Filter::save( KConfig *config ) | |||
122 | config->writeEntry( "MatchRule", (int)mMatchRule ); | 142 | config->writeEntry( "MatchRule", (int)mMatchRule ); |
143 | config->writeEntry( "Criteria", (int)mCriteria ); | ||
123 | } | 144 | } |
@@ -130,2 +151,3 @@ void Filter::restore( KConfig *config ) | |||
130 | mMatchRule = (MatchRule)config->readNumEntry( "MatchRule", Matching ); | 151 | mMatchRule = (MatchRule)config->readNumEntry( "MatchRule", Matching ); |
152 | mCriteria = config->readNumEntry( "Criteria", (ShowPublic | ShowPrivate| ShowConfidential) ); | ||
131 | } | 153 | } |