Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index 539d6ba..52aff36 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp @@ -607,14 +607,18 @@ void AbTable::rowHeightChanged( int row ) } ContactItem AbTable::findContactContact( const Opie::OPimContact &entry, int /* row */ ) { - ContactItem item; + int iconsize = fontMetrics().height(); + QImage icon; + ContactItem item; item.value = ""; for ( QValueList<int>::ConstIterator it = intFields.begin(); it != intFields.end(); ++it ) { + icon.reset(); + switch ( *it ) { default: break; case Qtopia::Title: @@ -628,14 +632,14 @@ ContactItem AbTable::findContactContact( const Opie::OPimContact &entry, int /* break; case Qtopia::DefaultEmail: item.value = entry.defaultEmail(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/email" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/email" ); break; case Qtopia::Emails: item.value = entry.emails(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/email" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/email" ); break; case Qtopia::HomeStreet: item.value = entry.homeStreet(); break; @@ -653,24 +657,24 @@ ContactItem AbTable::findContactContact( const Opie::OPimContact &entry, int /* break; case Qtopia::HomePhone: item.value = entry.homePhone(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/phonehome" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/phonehome" ); break; case Qtopia::HomeFax: item.value = entry.homeFax(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/faxhome" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/faxhome" ); break; case Qtopia::HomeMobile: item.value = entry.homeMobile(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/mobilehome" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/mobilehome" ); break; case Qtopia::HomeWebPage: item.value = entry.homeWebpage(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/webpagehome" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/webpagehome" ); break; case Qtopia::Company: item.value = entry.company(); break; @@ -688,9 +692,9 @@ ContactItem AbTable::findContactContact( const Opie::OPimContact &entry, int /* break; case Qtopia::BusinessWebPage: item.value = entry.businessWebpage(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/webpagework" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/webpagework" ); break; case Qtopia::JobTitle: item.value = entry.jobTitle(); break; @@ -702,19 +706,19 @@ ContactItem AbTable::findContactContact( const Opie::OPimContact &entry, int /* break; case Qtopia::BusinessPhone: item.value = entry.businessPhone(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/phonework" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/phonework" ); break; case Qtopia::BusinessFax: item.value = entry.businessFax(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/faxwork" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/faxwork" ); break; case Qtopia::BusinessMobile: item.value = entry.businessMobile(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/mobilework" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/mobilework" ); break; case Qtopia::BusinessPager: item.value = entry.businessPager(); break; @@ -752,8 +756,13 @@ ContactItem AbTable::findContactContact( const Opie::OPimContact &entry, int /* case Qtopia::Notes: item.value = entry.notes(); break; } + + if ( !icon.isNull() ) { + item.icon = icon.smoothScale( iconsize, iconsize ); + } + if ( !item.value.isEmpty() ) break; } return item; |