summaryrefslogtreecommitdiffabout
path: root/kaddressbook/filter.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/filter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/filter.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/kaddressbook/filter.cpp b/kaddressbook/filter.cpp
index b0d04ca..39d2ae4 100644
--- a/kaddressbook/filter.cpp
+++ b/kaddressbook/filter.cpp
@@ -182,13 +182,14 @@ Filter::List Filter::restore( KConfig *config, QString baseGroup )
- QStringList cats = KABPrefs::instance()->mCustomCategories;
- for ( QStringList::Iterator it = cats.begin(); it != cats.end(); ++it ) {
- Filter filter;
- filter.mName = *it;
- filter.mEnabled = true;
- filter.mCategoryList = *it;
- filter.mMatchRule = Matching;
- filter.mInternal = true;
- list.append( filter );
+ if ( list.isEmpty()) {
+ QStringList cats = KABPrefs::instance()->mCustomCategories;
+ for ( QStringList::Iterator it = cats.begin(); it != cats.end(); ++it ) {
+ Filter filter;
+ filter.mName = *it;
+ filter.mEnabled = true;
+ filter.mCategoryList = *it;
+ filter.mMatchRule = Matching;
+ filter.mInternal = true;
+ list.append( filter );
+ }
}
-
return list;