-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 ) | |||
79 | if ( mAddressee.isEmpty() ) | 79 | if ( mAddressee.isEmpty() ) |
80 | return; | 80 | return; |
81 | 81 | ||
82 | QString name = ( mAddressee.formattedName().isEmpty() ? | 82 | QString name = ( mAddressee.formattedName().isEmpty() ? |
83 | mAddressee.assembledName() : mAddressee.formattedName() ); | 83 | mAddressee.assembledName() : mAddressee.formattedName() ); |
84 | 84 | ||
85 | QString dynamicPart; | 85 | QString dynamicPart; |
86 | 86 | ||
87 | QStringList emails = mAddressee.emails(); | ||
88 | QStringList::ConstIterator emailIt; | ||
89 | QString type = i18n( "Email" ); | ||
90 | emailIt = emails.begin(); | ||
91 | if ( emailIt != emails.end() ) { | ||
92 | dynamicPart += QString( | ||
93 | "<tr><td align=\"right\"><b>%1</b></td>" | ||
94 | "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" ) | ||
95 | .arg( type ) | ||
96 | .arg( name ) | ||
97 | .arg( *emailIt ) | ||
98 | .arg( *emailIt ); | ||
99 | ++emailIt; | ||
100 | } | ||
101 | |||
87 | KABC::PhoneNumber::List phones = mAddressee.phoneNumbers(); | 102 | KABC::PhoneNumber::List phones = mAddressee.phoneNumbers(); |
88 | KABC::PhoneNumber::List::ConstIterator phoneIt; | 103 | KABC::PhoneNumber::List::ConstIterator phoneIt; |
89 | for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) { | 104 | for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) { |
90 | dynamicPart += QString( | 105 | dynamicPart += QString( |
91 | "<tr><td align=\"right\"><b>%1</b></td>" | 106 | "<tr><td align=\"right\"><b>%1</b></td>" |
92 | "<td align=\"left\">%2</td></tr>" ) | 107 | "<td align=\"left\">%2</td></tr>" ) |
93 | .arg( KABC::PhoneNumber::typeLabel( (*phoneIt).type() ) ) | 108 | .arg( KABC::PhoneNumber::typeLabel( (*phoneIt).type() ) ) |
94 | .arg( (*phoneIt).number() ); | 109 | .arg( (*phoneIt).number() ); |
95 | } | 110 | } |
96 | 111 | ||
97 | QStringList emails = mAddressee.emails(); | 112 | |
98 | QStringList::ConstIterator emailIt; | 113 | for ( ; emailIt != emails.end(); ++emailIt ) { |
99 | QString type = i18n( "Email" ); | ||
100 | for ( emailIt = emails.begin(); emailIt != emails.end(); ++emailIt ) { | ||
101 | dynamicPart += QString( | 114 | dynamicPart += QString( |
102 | "<tr><td align=\"right\"><b>%1</b></td>" | 115 | "<tr><td align=\"right\"><b>%1</b></td>" |
103 | "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" ) | 116 | "<td align=\"left\"><a href=\"mailto:%2 <%3> \">%4</a></td></tr>" ) |
104 | .arg( type ) | 117 | .arg( type ) |
105 | .arg( name ) | 118 | .arg( name ) |
106 | .arg( *emailIt ) | 119 | .arg( *emailIt ) |
107 | .arg( *emailIt ); | 120 | .arg( *emailIt ); |
108 | type = i18n( "Other" ); | ||
109 | } | 121 | } |
110 | 122 | ||
111 | if ( !mAddressee.url().url().isEmpty() ) { | 123 | if ( !mAddressee.url().url().isEmpty() ) { |
112 | dynamicPart += QString( | 124 | dynamicPart += QString( |
113 | "<tr><td align=\"right\"><b>%1</b></td>" | 125 | "<tr><td align=\"right\"><b>%1</b></td>" |
114 | "<td align=\"left\">%2</td></tr>" ) | 126 | "<td align=\"left\">%2</td></tr>" ) |
115 | .arg( i18n( "Homepage" ) ) | 127 | .arg( i18n( "Homepage" ) ) |
116 | //US .arg( KStringHandler::tagURLs( mAddressee.url().url() ) ); | 128 | //US .arg( KStringHandler::tagURLs( mAddressee.url().url() ) ); |
@@ -144,17 +156,17 @@ void AddresseeView::setAddressee( const KABC::Addressee& addr ) | |||
144 | 156 | ||
145 | } | 157 | } |
146 | } | 158 | } |
147 | 159 | ||
148 | QString notes; | 160 | QString notes; |
149 | if ( !mAddressee.note().isEmpty() ) { | 161 | if ( !mAddressee.note().isEmpty() ) { |
150 | notes = QString( | 162 | notes = QString( |
151 | "<tr>" | 163 | "<tr>" |
152 | "<td align=\"right\" valign=\"top\"><b>%1:</b></td>" // note label | 164 | "<td align=\"right\" valign=\"top\"><b>%1</b></td>" // note label |
153 | "<td align=\"left\">%2</td>" // note | 165 | "<td align=\"left\">%2</td>" // note |
154 | "</tr>" ).arg( i18n( "Notes" ) ) | 166 | "</tr>" ).arg( i18n( "Notes" ) ) |
155 | //US .arg( mAddressee.note().replace( '\n', "<br>" ) ); | 167 | //US .arg( mAddressee.note().replace( '\n', "<br>" ) ); |
156 | .arg( mAddressee.note().replace( QRegExp("\n"), "<br>" ) ); | 168 | .arg( mAddressee.note().replace( QRegExp("\n"), "<br>" ) ); |
157 | //qDebug("AddresseeView::setAddressee has to be verified."); | 169 | //qDebug("AddresseeView::setAddressee has to be verified."); |
158 | } | 170 | } |
159 | 171 | ||
160 | QString aRole = ""; | 172 | QString aRole = ""; |