summaryrefslogtreecommitdiffabout
path: root/kaddressbook/filter.cpp
Unidiff
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
@@ -180,17 +180,18 @@ Filter::List Filter::restore( KConfig *config, QString baseGroup )
180 list.append( f ); 180 list.append( f );
181 } 181 }
182 182
183 QStringList cats = KABPrefs::instance()->mCustomCategories; 183 if ( list.isEmpty()) {
184 for ( QStringList::Iterator it = cats.begin(); it != cats.end(); ++it ) { 184 QStringList cats = KABPrefs::instance()->mCustomCategories;
185 Filter filter; 185 for ( QStringList::Iterator it = cats.begin(); it != cats.end(); ++it ) {
186 filter.mName = *it; 186 Filter filter;
187 filter.mEnabled = true; 187 filter.mName = *it;
188 filter.mCategoryList = *it; 188 filter.mEnabled = true;
189 filter.mMatchRule = Matching; 189 filter.mCategoryList = *it;
190 filter.mInternal = true; 190 filter.mMatchRule = Matching;
191 list.append( filter ); 191 filter.mInternal = true;
192 list.append( filter );
193 }
192 } 194 }
193
194 return list; 195 return list;
195} 196}
196 197