summaryrefslogtreecommitdiffabout
path: root/kaddressbook/filter.cpp
Unidiff
Diffstat (limited to 'kaddressbook/filter.cpp') (more/less context) (show 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 @@
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}