summaryrefslogtreecommitdiffabout
path: root/kaddressbook/views
Unidiff
Diffstat (limited to 'kaddressbook/views') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/views/kaddressbookcardview.cpp8
-rw-r--r--kaddressbook/views/kaddressbookiconview.cpp8
-rw-r--r--kaddressbook/views/kaddressbooktableview.cpp6
3 files changed, 11 insertions, 11 deletions
diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp
index 9c35fd6..ca21016 100644
--- a/kaddressbook/views/kaddressbookcardview.cpp
+++ b/kaddressbook/views/kaddressbookcardview.cpp
@@ -270,115 +270,115 @@ void KAddressBookCardView::readConfig(KConfig *config)
270 270
271 mCardView->setShowEmptyFields( mShowEmptyFields ); 271 mCardView->setShowEmptyFields( mShowEmptyFields );
272 272
273 mCardView->setItemWidth( config->readNumEntry( "ItemWidth", 200 ) ); 273 mCardView->setItemWidth( config->readNumEntry( "ItemWidth", 200 ) );
274 mCardView->setItemMargin( config->readNumEntry( "ItemMargin", 0 ) ); 274 mCardView->setItemMargin( config->readNumEntry( "ItemMargin", 0 ) );
275 mCardView->setItemSpacing( config->readNumEntry( "ItemSpacing", 10 ) ); 275 mCardView->setItemSpacing( config->readNumEntry( "ItemSpacing", 10 ) );
276 mCardView->setSeparatorWidth( config->readNumEntry( "SeparatorWidth", 2 ) ); 276 mCardView->setSeparatorWidth( config->readNumEntry( "SeparatorWidth", 2 ) );
277 277
278#if 0 278#if 0
279 // LR KABPrefs::instance()->mHonorSingleClick is handled and fixed in cardviews contentsMouseDoubleClickEven 279 // LR KABPrefs::instance()->mHonorSingleClick is handled and fixed in cardviews contentsMouseDoubleClickEven
280 disconnect(mCardView, SIGNAL(executed(CardViewItem *)), 280 disconnect(mCardView, SIGNAL(executed(CardViewItem *)),
281 this, SLOT(addresseeExecuted(CardViewItem *))); 281 this, SLOT(addresseeExecuted(CardViewItem *)));
282 282
283 if (KABPrefs::instance()->mHonorSingleClick) 283 if (KABPrefs::instance()->mHonorSingleClick)
284 connect(mCardView, SIGNAL(executed(CardViewItem *)), 284 connect(mCardView, SIGNAL(executed(CardViewItem *)),
285 this, SLOT(addresseeExecuted(CardViewItem *))); 285 this, SLOT(addresseeExecuted(CardViewItem *)));
286 else 286 else
287 connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)), 287 connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)),
288 this, SLOT(addresseeExecuted(CardViewItem *))); 288 this, SLOT(addresseeExecuted(CardViewItem *)));
289#endif 289#endif
290 290
291 connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)), 291 connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)),
292 this, SLOT(addresseeExecuted(CardViewItem *))); 292 this, SLOT(addresseeExecuted(CardViewItem *)));
293} 293}
294 294
295void KAddressBookCardView::writeConfig( KConfig *config ) 295void KAddressBookCardView::writeConfig( KConfig *config )
296{ 296{
297 config->writeEntry( "ItemWidth", mCardView->itemWidth() ); 297 config->writeEntry( "ItemWidth", mCardView->itemWidth() );
298 KAddressBookView::writeConfig( config ); 298 KAddressBookView::writeConfig( config );
299} 299}
300void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field ) 300void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field )
301{ 301{
302 mCardView->clear(); 302 mCardView->clear();
303 if ( s.isEmpty() || s == "*" ) { 303 if ( s.isEmpty() || s == "*" ) {
304 refresh(); 304 refresh();
305 return; 305 return;
306 } 306 }
307 QRegExp re = getRegExp( s ); 307 QRegExp re = getRegExp( s );
308 if (!re.isValid()) 308 if (!re.isValid())
309 return; 309 return;
310 mCardView->viewport()->setUpdatesEnabled( false ); 310 mCardView->viewport()->setUpdatesEnabled( false );
311 KABC::Addressee::List addresseeList = addressees(); 311 KABC::Addressee::List addresseeList = addressees();
312 KABC::Addressee::List::Iterator it; 312 KABC::Addressee::List::Iterator it;
313 if ( field ) { 313 if ( field ) {
314 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { 314 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) {
315 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) 315 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
316 continue; 316 continue;
317#if QT_VERSION >= 0x030000 317#if QT_VERSION >= 0x030000
318 if (re.search(field->value( *it ).lower()) != -1) 318 if (re.search(field->value( *it ).lower()) == 0)
319#else 319#else
320 if (re.match(field->value( *it ).lower()) != -1) 320 if (re.match(field->value( *it ).lower()) == 0)
321#endif 321#endif
322 new AddresseeCardViewItem(fields(), mShowEmptyFields, 322 new AddresseeCardViewItem(fields(), mShowEmptyFields,
323 addressBook(), *it, mCardView); 323 addressBook(), *it, mCardView);
324 324
325 } 325 }
326 } else { 326 } else {
327 KABC::Field::List fieldList = allFields(); 327 KABC::Field::List fieldList = allFields();
328 KABC::Field::List::ConstIterator fieldIt; 328 KABC::Field::List::ConstIterator fieldIt;
329 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { 329 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) {
330 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) 330 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
331 continue; 331 continue;
332 for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { 332 for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) {
333#if QT_VERSION >= 0x030000 333#if QT_VERSION >= 0x030000
334 if (re.search((*fieldIt)->value( *it ).lower()) != -1) 334 if (re.search((*fieldIt)->value( *it ).lower()) == 0)
335#else 335#else
336 if (re.match((*fieldIt)->value( *it ).lower()) != -1) 336 if (re.match((*fieldIt)->value( *it ).lower()) == 0)
337#endif 337#endif
338 { 338 {
339 new AddresseeCardViewItem(fields(), mShowEmptyFields, 339 new AddresseeCardViewItem(fields(), mShowEmptyFields,
340 addressBook(), *it, mCardView); 340 addressBook(), *it, mCardView);
341 break; 341 break;
342 } 342 }
343 } 343 }
344 } 344 }
345 } 345 }
346 mCardView->viewport()->setUpdatesEnabled( true ); 346 mCardView->viewport()->setUpdatesEnabled( true );
347 mCardView->viewport()->update(); 347 mCardView->viewport()->update();
348 if ( mCardView->firstItem() ) { 348 if ( mCardView->firstItem() ) {
349 mCardView->setCurrentItem ( mCardView->firstItem() ); 349 mCardView->setCurrentItem ( mCardView->firstItem() );
350 mCardView->setSelected ( mCardView->firstItem() , true ); 350 mCardView->setSelected ( mCardView->firstItem() , true );
351 } 351 }
352 else 352 else
353 emit selected(QString::null); 353 emit selected(QString::null);
354} 354}
355QStringList KAddressBookCardView::selectedUids() 355QStringList KAddressBookCardView::selectedUids()
356{ 356{
357 QStringList uidList; 357 QStringList uidList;
358 CardViewItem *item; 358 CardViewItem *item;
359 AddresseeCardViewItem *aItem; 359 AddresseeCardViewItem *aItem;
360 360
361 for (item = mCardView->firstItem(); item; item = item->nextItem()) 361 for (item = mCardView->firstItem(); item; item = item->nextItem())
362 { 362 {
363 if (item->isSelected()) 363 if (item->isSelected())
364 { 364 {
365#ifndef KAB_EMBEDDED 365#ifndef KAB_EMBEDDED
366 aItem = dynamic_cast<AddresseeCardViewItem*>(item); 366 aItem = dynamic_cast<AddresseeCardViewItem*>(item);
367#else //KAB_EMBEDDED 367#else //KAB_EMBEDDED
368 aItem = (AddresseeCardViewItem*)(item); 368 aItem = (AddresseeCardViewItem*)(item);
369#endif //KAB_EMBEDDED 369#endif //KAB_EMBEDDED
370 if (aItem) 370 if (aItem)
371 uidList << aItem->addressee().uid(); 371 uidList << aItem->addressee().uid();
372 } 372 }
373 } 373 }
374 374
375 return uidList; 375 return uidList;
376} 376}
377 377
378void KAddressBookCardView::refresh(QString uid) 378void KAddressBookCardView::refresh(QString uid)
379{ 379{
380 CardViewItem *item; 380 CardViewItem *item;
381 AddresseeCardViewItem *aItem; 381 AddresseeCardViewItem *aItem;
382 382
383 if (uid.isNull()) 383 if (uid.isNull())
384 { 384 {
diff --git a/kaddressbook/views/kaddressbookiconview.cpp b/kaddressbook/views/kaddressbookiconview.cpp
index 3bdfd1a..4bbdf1d 100644
--- a/kaddressbook/views/kaddressbookiconview.cpp
+++ b/kaddressbook/views/kaddressbookiconview.cpp
@@ -224,115 +224,115 @@ void KAddressBookIconView::scrollUP()
224 QApplication::postEvent( mIconView, ev ); 224 QApplication::postEvent( mIconView, ev );
225} 225}
226void KAddressBookIconView::scrollDOWN() 226void KAddressBookIconView::scrollDOWN()
227{ 227{
228 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); 228 QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 );
229 QApplication::postEvent( mIconView, ev ); 229 QApplication::postEvent( mIconView, ev );
230} 230}
231void KAddressBookIconView::readConfig(KConfig *config) 231void KAddressBookIconView::readConfig(KConfig *config)
232{ 232{
233 KAddressBookView::readConfig(config); 233 KAddressBookView::readConfig(config);
234 234
235//US method executed is part of KIconView 235//US method executed is part of KIconView
236//US disconnect(mIconView, SIGNAL(executed(QIconViewItem *)), 236//US disconnect(mIconView, SIGNAL(executed(QIconViewItem *)),
237//US this, SLOT(addresseeExecuted(QIconViewItem *))); 237//US this, SLOT(addresseeExecuted(QIconViewItem *)));
238 disconnect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), 238 disconnect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)),
239 this, SLOT(addresseeExecuted(QIconViewItem *))); 239 this, SLOT(addresseeExecuted(QIconViewItem *)));
240 240
241//US method executed is part of KIconView. Use selectionChanged instead 241//US method executed is part of KIconView. Use selectionChanged instead
242/*US 242/*US
243 if (KABPrefs::instance()->mHonorSingleClick) 243 if (KABPrefs::instance()->mHonorSingleClick)
244 connect(mIconView, SIGNAL(executed(QIconViewItem *)), 244 connect(mIconView, SIGNAL(executed(QIconViewItem *)),
245 this, SLOT(addresseeExecuted(QIconViewItem *))); 245 this, SLOT(addresseeExecuted(QIconViewItem *)));
246 else 246 else
247 connect(mIconView, SIGNAL(doubleClicked(QIconViewItem *)), 247 connect(mIconView, SIGNAL(doubleClicked(QIconViewItem *)),
248 this, SLOT(addresseeExecuted(QIconViewItem *))); 248 this, SLOT(addresseeExecuted(QIconViewItem *)));
249*/ 249*/
250 connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), 250 connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)),
251 this, SLOT(addresseeExecuted(QIconViewItem *))); 251 this, SLOT(addresseeExecuted(QIconViewItem *)));
252 252
253} 253}
254void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field ) 254void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field )
255{ 255{
256 mIconView->clear(); 256 mIconView->clear();
257 mIconList.clear(); 257 mIconList.clear();
258 if ( s.isEmpty() || s == "*" ) { 258 if ( s.isEmpty() || s == "*" ) {
259 refresh(); 259 refresh();
260 return; 260 return;
261 } 261 }
262 QRegExp re = getRegExp( s ); 262 QRegExp re = getRegExp( s );
263 if (!re.isValid()) 263 if (!re.isValid())
264 return; 264 return;
265 KABC::Addressee::List addresseeList = addressees(); 265 KABC::Addressee::List addresseeList = addressees();
266 KABC::Addressee::List::Iterator it; 266 KABC::Addressee::List::Iterator it;
267 if ( field ) { 267 if ( field ) {
268 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { 268 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) {
269 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) 269 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
270 continue; 270 continue;
271#if QT_VERSION >= 0x030000 271#if QT_VERSION >= 0x030000
272 if (re.search(field->value( *it ).lower()) != -1) 272 if (re.search(field->value( *it ).lower()) == 0)
273#else 273#else
274 if (re.match(field->value( *it ).lower()) != -1) 274 if (re.match(field->value( *it ).lower()) == 0)
275#endif 275#endif
276 mIconList.append(new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); 276 mIconList.append(new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView ));
277 277
278 278
279 } 279 }
280 } else { 280 } else {
281 KABC::Field::List fieldList = allFields(); 281 KABC::Field::List fieldList = allFields();
282 KABC::Field::List::ConstIterator fieldIt; 282 KABC::Field::List::ConstIterator fieldIt;
283 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { 283 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) {
284 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) 284 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
285 continue; 285 continue;
286 for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { 286 for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) {
287#if QT_VERSION >= 0x030000 287#if QT_VERSION >= 0x030000
288 if (re.search((*fieldIt)->value( *it ).lower()) != -1) 288 if (re.search((*fieldIt)->value( *it ).lower()) == 0)
289#else 289#else
290 if (re.match((*fieldIt)->value( *it ).lower()) != -1) 290 if (re.match((*fieldIt)->value( *it ).lower()) == 0)
291#endif 291#endif
292 { 292 {
293 mIconList.append( new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); 293 mIconList.append( new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView ));
294 break; 294 break;
295 } 295 }
296 } 296 }
297 } 297 }
298 } 298 }
299 mIconView->arrangeItemsInGrid( true ); 299 mIconView->arrangeItemsInGrid( true );
300 if ( mIconView->firstItem() ) { 300 if ( mIconView->firstItem() ) {
301 mIconView->setCurrentItem ( mIconView->firstItem() ); 301 mIconView->setCurrentItem ( mIconView->firstItem() );
302 mIconView->setSelected ( mIconView->firstItem() , true ); 302 mIconView->setSelected ( mIconView->firstItem() , true );
303 } 303 }
304 else 304 else
305 emit selected(QString::null); 305 emit selected(QString::null);
306} 306}
307QStringList KAddressBookIconView::selectedUids() 307QStringList KAddressBookIconView::selectedUids()
308{ 308{
309 QStringList uidList; 309 QStringList uidList;
310 QIconViewItem *item; 310 QIconViewItem *item;
311 AddresseeIconViewItem *aItem; 311 AddresseeIconViewItem *aItem;
312 312
313 for (item = mIconView->firstItem(); item; item = item->nextItem()) 313 for (item = mIconView->firstItem(); item; item = item->nextItem())
314 { 314 {
315 if (item->isSelected()) 315 if (item->isSelected())
316 { 316 {
317#ifndef KAB_EMBEDDED 317#ifndef KAB_EMBEDDED
318 aItem = dynamic_cast<AddresseeIconViewItem*>(item); 318 aItem = dynamic_cast<AddresseeIconViewItem*>(item);
319#else //KAB_EMBEDDED 319#else //KAB_EMBEDDED
320 aItem = (AddresseeIconViewItem*)(item); 320 aItem = (AddresseeIconViewItem*)(item);
321#endif //KAB_EMBEDDED 321#endif //KAB_EMBEDDED
322 if (aItem) 322 if (aItem)
323 uidList << aItem->addressee().uid(); 323 uidList << aItem->addressee().uid();
324 } 324 }
325 } 325 }
326 326
327 return uidList; 327 return uidList;
328} 328}
329 329
330void KAddressBookIconView::refresh(QString uid) 330void KAddressBookIconView::refresh(QString uid)
331{ 331{
332 QIconViewItem *item; 332 QIconViewItem *item;
333 AddresseeIconViewItem *aItem; 333 AddresseeIconViewItem *aItem;
334 334
335 if ( uid.isNull() ) { 335 if ( uid.isNull() ) {
336 // Rebuild the view 336 // Rebuild the view
337 mIconView->clear(); 337 mIconView->clear();
338 mIconList.clear(); 338 mIconList.clear();
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp
index 565cd1d..348f491 100644
--- a/kaddressbook/views/kaddressbooktableview.cpp
+++ b/kaddressbook/views/kaddressbooktableview.cpp
@@ -114,112 +114,112 @@ void KAddressBookTableView::reconstructListView()
114 this, SLOT(addresseeSelected())); 114 this, SLOT(addresseeSelected()));
115 connect(mListView, SIGNAL(startAddresseeDrag()), this, 115 connect(mListView, SIGNAL(startAddresseeDrag()), this,
116 SIGNAL(startDrag())); 116 SIGNAL(startDrag()));
117 connect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this, 117 connect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this,
118 SIGNAL(dropped(QDropEvent*))); 118 SIGNAL(dropped(QDropEvent*)));
119 119
120 if (KABPrefs::instance()->mHonorSingleClick) { 120 if (KABPrefs::instance()->mHonorSingleClick) {
121 // qDebug("KAddressBookTableView::reconstructListView single"); 121 // qDebug("KAddressBookTableView::reconstructListView single");
122 connect(mListView, SIGNAL(executed(QListViewItem*)), 122 connect(mListView, SIGNAL(executed(QListViewItem*)),
123 this, SLOT(addresseeExecuted(QListViewItem*))); 123 this, SLOT(addresseeExecuted(QListViewItem*)));
124 } else { 124 } else {
125 // qDebug("KAddressBookTableView::reconstructListView double"); 125 // qDebug("KAddressBookTableView::reconstructListView double");
126 connect(mListView, SIGNAL(doubleClicked(QListViewItem*)), 126 connect(mListView, SIGNAL(doubleClicked(QListViewItem*)),
127 this, SLOT(addresseeExecuted(QListViewItem*))); 127 this, SLOT(addresseeExecuted(QListViewItem*)));
128 } 128 }
129 connect(mListView, SIGNAL(returnPressed(QListViewItem*)), 129 connect(mListView, SIGNAL(returnPressed(QListViewItem*)),
130 this, SLOT(addresseeExecuted(QListViewItem*))); 130 this, SLOT(addresseeExecuted(QListViewItem*)));
131 connect(mListView, SIGNAL(signalDelete()), 131 connect(mListView, SIGNAL(signalDelete()),
132 this, SLOT(addresseeDeleted())); 132 this, SLOT(addresseeDeleted()));
133 133
134//US performceimprovement. Refresh is done from the outside 134//US performceimprovement. Refresh is done from the outside
135//US refresh(); 135//US refresh();
136 136
137 mListView->setSorting( 0, true ); 137 mListView->setSorting( 0, true );
138 mainLayout->addWidget( mListView ); 138 mainLayout->addWidget( mListView );
139 mainLayout->activate(); 139 mainLayout->activate();
140 mListView->show(); 140 mListView->show();
141} 141}
142 142
143void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) 143void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field )
144{ 144{
145 mListView->clear(); 145 mListView->clear();
146 if ( s.isEmpty() || s == "*" ) { 146 if ( s.isEmpty() || s == "*" ) {
147 refresh(); 147 refresh();
148 return; 148 return;
149 } 149 }
150 QRegExp re = getRegExp( s ); 150 QRegExp re = getRegExp( s );
151 if (!re.isValid()) 151 if (!re.isValid())
152 return; 152 return;
153 KABC::Addressee::List addresseeList = addressees(); 153 KABC::Addressee::List addresseeList = addressees();
154 KABC::Addressee::List::Iterator it; 154 KABC::Addressee::List::Iterator it;
155 if ( field ) { 155 if ( field ) {
156 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { 156 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) {
157 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) 157 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
158 continue; 158 continue;
159#if QT_VERSION >= 0x030000 159#if QT_VERSION >= 0x030000
160 if (re.search(field->value( *it ).lower()) == 0) 160 if (re.search(field->value( *it ).lower()) == 0)
161#else 161#else
162 if (re.match(field->value( *it ).lower()) != -1) 162 if (re.match(field->value( *it ).lower()) == 0)
163#endif 163#endif
164 ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); 164 ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields());
165 165
166 } 166 }
167 } else { 167 } else {
168 KABC::Field::List fieldList = allFields(); 168 KABC::Field::List fieldList = allFields();
169 KABC::Field::List::ConstIterator fieldIt; 169 KABC::Field::List::ConstIterator fieldIt;
170 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { 170 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) {
171 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) 171 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
172 continue; 172 continue;
173 for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { 173 for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) {
174#if QT_VERSION >= 0x030000 174#if QT_VERSION >= 0x030000
175 if (re.search((*fieldIt)->value( *it ).lower()) != -1) 175 if (re.search((*fieldIt)->value( *it ).lower()) == 0)
176#else 176#else
177 if (re.match((*fieldIt)->value( *it ).lower()) != -1) 177 if (re.match((*fieldIt)->value( *it ).lower()) == 0)
178#endif 178#endif
179 { 179 {
180 //qDebug("match %s %s %s", pattern.latin1(), (*fieldIt)->value( *it ).latin1(), (*fieldIt)->label().latin1() ); 180 //qDebug("match %s %s %s", pattern.latin1(), (*fieldIt)->value( *it ).latin1(), (*fieldIt)->label().latin1() );
181 ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); 181 ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields());
182 break; 182 break;
183 } 183 }
184 } 184 }
185 } 185 }
186 } 186 }
187 // Sometimes the background pixmap gets messed up when we add lots 187 // Sometimes the background pixmap gets messed up when we add lots
188 // of items. 188 // of items.
189 //mListView->repaint(); 189 //mListView->repaint();
190 if ( mListView->firstChild() ) { 190 if ( mListView->firstChild() ) {
191 mListView->setCurrentItem ( mListView->firstChild() ); 191 mListView->setCurrentItem ( mListView->firstChild() );
192 mListView->setSelected ( mListView->firstChild(), true ); 192 mListView->setSelected ( mListView->firstChild(), true );
193 } 193 }
194 else 194 else
195 emit selected(QString::null); 195 emit selected(QString::null);
196 196
197} 197}
198void KAddressBookTableView::writeConfig(KConfig *config) 198void KAddressBookTableView::writeConfig(KConfig *config)
199{ 199{
200 KAddressBookView::writeConfig(config); 200 KAddressBookView::writeConfig(config);
201 201
202 mListView->saveLayout(config, config->group()); 202 mListView->saveLayout(config, config->group());
203} 203}
204 204
205void KAddressBookTableView::readConfig(KConfig *config) 205void KAddressBookTableView::readConfig(KConfig *config)
206{ 206{
207 KAddressBookView::readConfig( config ); 207 KAddressBookView::readConfig( config );
208 // The config could have changed the fields, so we need to reconstruct 208 // The config could have changed the fields, so we need to reconstruct
209 // the listview. 209 // the listview.
210 reconstructListView(); 210 reconstructListView();
211 211
212 // costum colors? 212 // costum colors?
213 if ( config->readBoolEntry( "EnableCustomColors", false ) ) 213 if ( config->readBoolEntry( "EnableCustomColors", false ) )
214 { 214 {
215 QPalette p( mListView->palette() ); 215 QPalette p( mListView->palette() );
216 QColor c = p.color(QPalette::Normal, QColorGroup::Base ); 216 QColor c = p.color(QPalette::Normal, QColorGroup::Base );
217 p.setColor( QPalette::Normal, QColorGroup::Base, config->readColorEntry( "BackgroundColor", &c ) ); 217 p.setColor( QPalette::Normal, QColorGroup::Base, config->readColorEntry( "BackgroundColor", &c ) );
218 c = p.color(QPalette::Normal, QColorGroup::Text ); 218 c = p.color(QPalette::Normal, QColorGroup::Text );
219 p.setColor( QPalette::Normal, QColorGroup::Text, config->readColorEntry( "TextColor", &c ) ); 219 p.setColor( QPalette::Normal, QColorGroup::Text, config->readColorEntry( "TextColor", &c ) );
220 c = p.color(QPalette::Normal, QColorGroup::Button ); 220 c = p.color(QPalette::Normal, QColorGroup::Button );
221 p.setColor( QPalette::Normal, QColorGroup::Button, config->readColorEntry( "HeaderColor", &c ) ); 221 p.setColor( QPalette::Normal, QColorGroup::Button, config->readColorEntry( "HeaderColor", &c ) );
222 c = p.color(QPalette::Normal, QColorGroup::ButtonText ); 222 c = p.color(QPalette::Normal, QColorGroup::ButtonText );
223 p.setColor( QPalette::Normal, QColorGroup::ButtonText, config->readColorEntry( "HeaderTextColor", &c ) ); 223 p.setColor( QPalette::Normal, QColorGroup::ButtonText, config->readColorEntry( "HeaderTextColor", &c ) );
224 c = p.color(QPalette::Normal, QColorGroup::Highlight ); 224 c = p.color(QPalette::Normal, QColorGroup::Highlight );
225 p.setColor( QPalette::Normal, QColorGroup::Highlight, config->readColorEntry( "HighlightColor", &c ) ); 225 p.setColor( QPalette::Normal, QColorGroup::Highlight, config->readColorEntry( "HighlightColor", &c ) );