summaryrefslogtreecommitdiffabout
path: root/kaddressbook/views
authorzautrix <zautrix>2005-01-27 14:46:38 (UTC)
committer zautrix <zautrix>2005-01-27 14:46:38 (UTC)
commit3a6e3862e0b813965f633a51e9a116e5f8f26b23 (patch) (unidiff)
treeea53a2b248257a2a50aee4f6df98749b13401df1 /kaddressbook/views
parentcd1b9287f2bcd59652ef66186d00dcf5ff8a2a46 (diff)
downloadkdepimpi-3a6e3862e0b813965f633a51e9a116e5f8f26b23.zip
kdepimpi-3a6e3862e0b813965f633a51e9a116e5f8f26b23.tar.gz
kdepimpi-3a6e3862e0b813965f633a51e9a116e5f8f26b23.tar.bz2
fix
Diffstat (limited to 'kaddressbook/views') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/views/kaddressbookcardview.cpp6
-rw-r--r--kaddressbook/views/kaddressbookiconview.cpp6
-rw-r--r--kaddressbook/views/kaddressbooktableview.cpp6
3 files changed, 3 insertions, 15 deletions
diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp
index 9d8c5ce..2b40909 100644
--- a/kaddressbook/views/kaddressbookcardview.cpp
+++ b/kaddressbook/views/kaddressbookcardview.cpp
@@ -287,37 +287,33 @@ void KAddressBookCardView::readConfig(KConfig *config)
287 connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)), 287 connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)),
288 this, SLOT(addresseeExecuted(CardViewItem *))); 288 this, SLOT(addresseeExecuted(CardViewItem *)));
289} 289}
290 290
291void KAddressBookCardView::writeConfig( KConfig *config ) 291void KAddressBookCardView::writeConfig( KConfig *config )
292{ 292{
293 config->writeEntry( "ItemWidth", mCardView->itemWidth() ); 293 config->writeEntry( "ItemWidth", mCardView->itemWidth() );
294 KAddressBookView::writeConfig( config ); 294 KAddressBookView::writeConfig( config );
295} 295}
296void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field ) 296void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field )
297{ 297{
298 mCardView->clear(); 298 mCardView->clear();
299 if ( s.isEmpty() || s == "*" ) { 299 if ( s.isEmpty() || s == "*" ) {
300 refresh(); 300 refresh();
301 return; 301 return;
302 } 302 }
303 QString pattern = s.lower()+"*"; 303 QRegExp re = getRegExp( s );
304 QRegExp re;
305 re.setWildcard(true); // most people understand these better.
306 re.setCaseSensitive(false);
307 re.setPattern( pattern );
308 if (!re.isValid()) 304 if (!re.isValid())
309 return; 305 return;
310 mCardView->viewport()->setUpdatesEnabled( false ); 306 mCardView->viewport()->setUpdatesEnabled( false );
311 KABC::Addressee::List addresseeList = addressees(); 307 KABC::Addressee::List addresseeList = addressees();
312 KABC::Addressee::List::Iterator it; 308 KABC::Addressee::List::Iterator it;
313 if ( field ) { 309 if ( field ) {
314 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { 310 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) {
315 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) 311 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
316 continue; 312 continue;
317#if QT_VERSION >= 0x030000 313#if QT_VERSION >= 0x030000
318 if (re.search(field->value( *it ).lower()) != -1) 314 if (re.search(field->value( *it ).lower()) != -1)
319#else 315#else
320 if (re.match(field->value( *it ).lower()) != -1) 316 if (re.match(field->value( *it ).lower()) != -1)
321#endif 317#endif
322 new AddresseeCardViewItem(fields(), mShowEmptyFields, 318 new AddresseeCardViewItem(fields(), mShowEmptyFields,
323 addressBook(), *it, mCardView); 319 addressBook(), *it, mCardView);
diff --git a/kaddressbook/views/kaddressbookiconview.cpp b/kaddressbook/views/kaddressbookiconview.cpp
index fb53215..3bdfd1a 100644
--- a/kaddressbook/views/kaddressbookiconview.cpp
+++ b/kaddressbook/views/kaddressbookiconview.cpp
@@ -246,37 +246,33 @@ void KAddressBookIconView::readConfig(KConfig *config)
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 QString pattern = s.lower()+"*"; 262 QRegExp re = getRegExp( s );
263 QRegExp re;
264 re.setWildcard(true); // most people understand these better.
265 re.setCaseSensitive(false);
266 re.setPattern( pattern );
267 if (!re.isValid()) 263 if (!re.isValid())
268 return; 264 return;
269 KABC::Addressee::List addresseeList = addressees(); 265 KABC::Addressee::List addresseeList = addressees();
270 KABC::Addressee::List::Iterator it; 266 KABC::Addressee::List::Iterator it;
271 if ( field ) { 267 if ( field ) {
272 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { 268 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) {
273 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-") )
274 continue; 270 continue;
275#if QT_VERSION >= 0x030000 271#if QT_VERSION >= 0x030000
276 if (re.search(field->value( *it ).lower()) != -1) 272 if (re.search(field->value( *it ).lower()) != -1)
277#else 273#else
278 if (re.match(field->value( *it ).lower()) != -1) 274 if (re.match(field->value( *it ).lower()) != -1)
279#endif 275#endif
280 mIconList.append(new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); 276 mIconList.append(new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView ));
281 277
282 278
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp
index b73ceaa..f4b008c 100644
--- a/kaddressbook/views/kaddressbooktableview.cpp
+++ b/kaddressbook/views/kaddressbooktableview.cpp
@@ -130,37 +130,33 @@ void KAddressBookTableView::reconstructListView()
130//US performceimprovement. Refresh is done from the outside 130//US performceimprovement. Refresh is done from the outside
131//US refresh(); 131//US refresh();
132 132
133 mListView->setSorting( 0, true ); 133 mListView->setSorting( 0, true );
134 mainLayout->addWidget( mListView ); 134 mainLayout->addWidget( mListView );
135 mainLayout->activate(); 135 mainLayout->activate();
136 mListView->show(); 136 mListView->show();
137} 137}
138 138
139void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) 139void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field )
140{ 140{
141 mListView->clear(); 141 mListView->clear();
142 if ( s.isEmpty() || s == "*" ) { 142 if ( s.isEmpty() || s == "*" ) {
143 refresh(); 143 refresh();
144 return; 144 return;
145 } 145 }
146 QString pattern = s.lower()+"*"; 146 QRegExp re = getRegExp( s );
147 QRegExp re;
148 re.setWildcard(true); // most people understand these better.
149 re.setCaseSensitive(false);
150 re.setPattern( pattern );
151 if (!re.isValid()) 147 if (!re.isValid())
152 return; 148 return;
153 KABC::Addressee::List addresseeList = addressees(); 149 KABC::Addressee::List addresseeList = addressees();
154 KABC::Addressee::List::Iterator it; 150 KABC::Addressee::List::Iterator it;
155 if ( field ) { 151 if ( field ) {
156 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { 152 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) {
157 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) 153 if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") )
158 continue; 154 continue;
159#if QT_VERSION >= 0x030000 155#if QT_VERSION >= 0x030000
160 if (re.search(field->value( *it ).lower()) == 0) 156 if (re.search(field->value( *it ).lower()) == 0)
161#else 157#else
162 if (re.match(field->value( *it ).lower()) != -1) 158 if (re.match(field->value( *it ).lower()) != -1)
163#endif 159#endif
164 ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); 160 ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields());
165 161
166 } 162 }