summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/filter.cpp18
-rw-r--r--kaddressbook/filter.h1
2 files changed, 15 insertions, 4 deletions
diff --git a/kaddressbook/filter.cpp b/kaddressbook/filter.cpp
index 7a869fa..12ab1e3 100644
--- a/kaddressbook/filter.cpp
+++ b/kaddressbook/filter.cpp
@@ -33,3 +33,3 @@
Filter::Filter()
- : mName( QString::null ), mMatchRule( Matching ), mEnabled( true ),
+ : mName( QString::null ), mMatchRule( NotMatching ), mEnabled( true ),
mInternal( false )
@@ -37,2 +37,3 @@ Filter::Filter()
mCriteria = ShowPublic | ShowPrivate| ShowConfidential ;
+ noName = true;
}
@@ -40,3 +41,3 @@ Filter::Filter()
Filter::Filter( const QString &name )
- : mName( name ), mMatchRule( Matching ), mEnabled( true ),
+ : mName( name ), mMatchRule( NotMatching ), mEnabled( true ),
mInternal( false )
@@ -44,2 +45,3 @@ Filter::Filter( const QString &name )
mCriteria = ShowPublic | ShowPrivate| ShowConfidential ;
+ noName = false;
}
@@ -53,2 +55,3 @@ void Filter::setName( const QString &name )
mName = name;
+ noName = false;
}
@@ -67,2 +70,4 @@ void Filter::apply( KABC::Addressee::List &addresseeList )
{
+ if ( noName )
+ return;
KABC::Addressee::List::Iterator iter;
@@ -84,2 +89,6 @@ bool Filter::filterAddressee( const KABC::Addressee &a )
{
+
+ if ( noName )
+ return true;
+ //qDebug("Filter::filterAddressee %s",mName.latin1() );
switch ( a.secrecy().type()) {
@@ -103,6 +112,5 @@ bool Filter::filterAddressee( const KABC::Addressee &a )
iter = mCategoryList.begin();
- // empty filter always matches
if ( iter == mCategoryList.end() )
- return true;
+ return ( !(mMatchRule == Matching) );
@@ -147,2 +155,3 @@ void Filter::restore( KConfig *config )
{
+ noName = false;
mName = config->readEntry( "Name", "<internal error>" );
@@ -208,2 +217,3 @@ Filter::List Filter::restore( KConfig *config, QString baseGroup )
Filter filter;
+ filter.noName = false;
filter.mName = *it;
diff --git a/kaddressbook/filter.h b/kaddressbook/filter.h
index 93f1352..f4ae123 100644
--- a/kaddressbook/filter.h
+++ b/kaddressbook/filter.h
@@ -148,2 +148,3 @@ class Filter
private:
+ bool noName;
int mCriteria;