-rw-r--r-- | libkdepim/addresseeview.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/libkdepim/addresseeview.cpp b/libkdepim/addresseeview.cpp index 70fc57c..71c7817 100644 --- a/libkdepim/addresseeview.cpp +++ b/libkdepim/addresseeview.cpp @@ -79,38 +79,50 @@ void AddresseeView::setAddressee( const KABC::Addressee& addr ) if ( mAddressee.isEmpty() ) return; QString name = ( mAddressee.formattedName().isEmpty() ? mAddressee.assembledName() : mAddressee.formattedName() ); QString dynamicPart; + QStringList emails = mAddressee.emails(); + QStringList::ConstIterator emailIt; + QString type = i18n( "Email" ); + emailIt = emails.begin(); + if ( emailIt != emails.end() ) { + dynamicPart += QString( + "<tr><td align=\"right\"><b>%1</b></td>" + "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" ) + .arg( type ) + .arg( name ) + .arg( *emailIt ) + .arg( *emailIt ); + ++emailIt; + } + KABC::PhoneNumber::List phones = mAddressee.phoneNumbers(); KABC::PhoneNumber::List::ConstIterator phoneIt; for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) { dynamicPart += QString( "<tr><td align=\"right\"><b>%1</b></td>" "<td align=\"left\">%2</td></tr>" ) .arg( KABC::PhoneNumber::typeLabel( (*phoneIt).type() ) ) .arg( (*phoneIt).number() ); } - QStringList emails = mAddressee.emails(); - QStringList::ConstIterator emailIt; - QString type = i18n( "Email" ); - for ( emailIt = emails.begin(); emailIt != emails.end(); ++emailIt ) { + + for ( ; emailIt != emails.end(); ++emailIt ) { dynamicPart += QString( "<tr><td align=\"right\"><b>%1</b></td>" "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" ) .arg( type ) .arg( name ) .arg( *emailIt ) .arg( *emailIt ); - type = i18n( "Other" ); } if ( !mAddressee.url().url().isEmpty() ) { dynamicPart += QString( "<tr><td align=\"right\"><b>%1</b></td>" "<td align=\"left\">%2</td></tr>" ) .arg( i18n( "Homepage" ) ) //US .arg( KStringHandler::tagURLs( mAddressee.url().url() ) ); @@ -144,17 +156,17 @@ void AddresseeView::setAddressee( const KABC::Addressee& addr ) } } QString notes; if ( !mAddressee.note().isEmpty() ) { notes = QString( "<tr>" - "<td align=\"right\" valign=\"top\"><b>%1:</b></td>" // note label + "<td align=\"right\" valign=\"top\"><b>%1</b></td>" // note label "<td align=\"left\">%2</td>" // note "</tr>" ).arg( i18n( "Notes" ) ) //US .arg( mAddressee.note().replace( '\n', "<br>" ) ); .arg( mAddressee.note().replace( QRegExp("\n"), "<br>" ) ); //qDebug("AddresseeView::setAddressee has to be verified."); } QString aRole = ""; |