-rw-r--r-- | kaddressbook/views/kaddressbookcardview.cpp | 22 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbookiconview.cpp | 39 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 16 |
3 files changed, 70 insertions, 7 deletions
diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp index ca21016..b503652 100644 --- a/kaddressbook/views/kaddressbookcardview.cpp +++ b/kaddressbook/views/kaddressbookcardview.cpp | |||
@@ -331,2 +331,3 @@ void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field ) | |||
331 | continue; | 331 | continue; |
332 | bool match = false; | ||
332 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { | 333 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { |
@@ -338,4 +339,5 @@ void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field ) | |||
338 | { | 339 | { |
339 | new AddresseeCardViewItem(fields(), mShowEmptyFields, | 340 | new AddresseeCardViewItem(fields(), mShowEmptyFields, |
340 | addressBook(), *it, mCardView); | 341 | addressBook(), *it, mCardView); |
342 | match = true; | ||
341 | break; | 343 | break; |
@@ -343,2 +345,18 @@ void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field ) | |||
343 | } | 345 | } |
346 | if ( ! match ) { | ||
347 | if ( (*it).matchPhoneNumber( &re ) ) { | ||
348 | new AddresseeCardViewItem(fields(), mShowEmptyFields, | ||
349 | addressBook(), *it, mCardView); | ||
350 | match = true; | ||
351 | break; | ||
352 | } | ||
353 | } | ||
354 | if ( ! match ) { | ||
355 | if ( (*it).matchAddress( &re ) ) { | ||
356 | new AddresseeCardViewItem(fields(), mShowEmptyFields, | ||
357 | addressBook(), *it, mCardView); | ||
358 | match = true; | ||
359 | break; | ||
360 | } | ||
361 | } | ||
344 | } | 362 | } |
diff --git a/kaddressbook/views/kaddressbookiconview.cpp b/kaddressbook/views/kaddressbookiconview.cpp index 4bbdf1d..d6ddec3 100644 --- a/kaddressbook/views/kaddressbookiconview.cpp +++ b/kaddressbook/views/kaddressbookiconview.cpp | |||
@@ -152,3 +152,3 @@ class AddresseeIconViewItem : public QIconViewItem | |||
152 | QPixmap icon; | 152 | QPixmap icon; |
153 | QPixmap defaultIcon( KGlobal::iconLoader()->loadIcon( "vcard", KIcon::Desktop, 128 ) ); | 153 | |
154 | KABC::Picture pic = mAddressee.photo(); | 154 | KABC::Picture pic = mAddressee.photo(); |
@@ -165,9 +165,22 @@ class AddresseeIconViewItem : public QIconViewItem | |||
165 | #else //KAB_EMBEDDED | 165 | #else //KAB_EMBEDDED |
166 | |||
167 | int wid = pic.data().width(); | ||
168 | int hei = pic.data().height(); | ||
169 | int max = 48; | ||
170 | if ( wid > max || hei > max ) { | ||
171 | if ( wid > hei ) { | ||
172 | hei = (hei*max)/wid; | ||
173 | wid = max; | ||
174 | } else { | ||
175 | wid = (wid*max)/hei; | ||
176 | hei = max; | ||
177 | } | ||
178 | } | ||
166 | qDebug("AddresseeIconViewItem::refresh - scale here dependend of the displaysize and the right factor"); | 179 | qDebug("AddresseeIconViewItem::refresh - scale here dependend of the displaysize and the right factor"); |
167 | icon.convertFromImage(img.smoothScale(32, 32)); | 180 | icon.convertFromImage(img.smoothScale(wid, hei)); |
168 | #endif //KAB_EMBEDDED | 181 | #endif //KAB_EMBEDDED |
169 | 182 | ||
170 | } else | 183 | } else { |
171 | icon = defaultIcon; | 184 | icon = KGlobal::iconLoader()->loadIcon( "vcard", KIcon::Desktop, 128 ); |
172 | 185 | } | |
173 | setPixmap( icon ); | 186 | setPixmap( icon ); |
@@ -285,2 +298,3 @@ void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field ) | |||
285 | continue; | 298 | continue; |
299 | bool match = false; | ||
286 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { | 300 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { |
@@ -293,4 +307,19 @@ void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field ) | |||
293 | mIconList.append( new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); | 307 | mIconList.append( new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); |
308 | match = true; | ||
294 | break; | 309 | break; |
295 | } | 310 | } |
311 | } | ||
312 | if ( ! match ) { | ||
313 | if ( (*it).matchPhoneNumber( &re ) ) { | ||
314 | mIconList.append( new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); | ||
315 | match = true; | ||
316 | break; | ||
317 | } | ||
318 | } | ||
319 | if ( ! match ) { | ||
320 | if ( (*it).matchAddress( &re ) ) { | ||
321 | mIconList.append( new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); | ||
322 | match = true; | ||
323 | break; | ||
324 | } | ||
296 | } | 325 | } |
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp index 348f491..02fc40a 100644 --- a/kaddressbook/views/kaddressbooktableview.cpp +++ b/kaddressbook/views/kaddressbooktableview.cpp | |||
@@ -172,2 +172,3 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) | |||
172 | continue; | 172 | continue; |
173 | bool match = false; | ||
173 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { | 174 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { |
@@ -181,2 +182,3 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) | |||
181 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); | 182 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); |
183 | match = true; | ||
182 | break; | 184 | break; |
@@ -184,2 +186,16 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) | |||
184 | } | 186 | } |
187 | if ( ! match ) { | ||
188 | if ( (*it).matchPhoneNumber( &re ) ) { | ||
189 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); | ||
190 | match = true; | ||
191 | break; | ||
192 | } | ||
193 | } | ||
194 | if ( ! match ) { | ||
195 | if ( (*it).matchAddress( &re ) ) { | ||
196 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); | ||
197 | match = true; | ||
198 | break; | ||
199 | } | ||
200 | } | ||
185 | } | 201 | } |