summaryrefslogtreecommitdiffabout
path: root/kabc/addresseeview.cpp
Unidiff
Diffstat (limited to 'kabc/addresseeview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addresseeview.cpp26
1 files changed, 15 insertions, 11 deletions
diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp
index 2691d9a..f3cfb23 100644
--- a/kabc/addresseeview.cpp
+++ b/kabc/addresseeview.cpp
@@ -225,29 +225,31 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee )
225 225
226 226
227 QString notes; 227 QString notes;
228 if ( sFullDetailsMode ) { 228 if ( sFullDetailsMode ) {
229 notes = QString( 229 notes = QString(
230 "<tr><td align=\"right\"><b>%1</b></td>" 230 "<tr><td align=\"right\"><b>%1</b></td>"
231 "<td align=\"left\"><a href=\"notAllDetails\">%4</a></td></tr>" ) 231 "<td align=\"left\"><a href=\"notAllDetails\">%4</a></td></tr>" )
232 .arg( i18n("Details") ) 232 .arg( i18n("Details") )
233 .arg( i18n("Hide!") ); 233 .arg( i18n("Hide!") );
234 234
235 QString tempX = mAddressee.custom( "KADDRESSBOOK", "X-Gender" ); 235 QString tempX = mAddressee.custom( "KADDRESSBOOK", "X-Gender" );
236 if ( !tempX.isEmpty() ) { 236 if ( !tempX.isEmpty() ) {
237 notes += QString( 237 if ( tempX == "male" || tempX == "female" ) {
238 "<tr><td align=\"right\"><b>%1</b></td>" 238 notes += QString(
239 "<td align=\"left\">%2</td></tr>" ) 239 "<tr><td align=\"right\"><b>%1</b></td>"
240 .arg( i18n( "" ) ) 240 "<td align=\"left\">%2</td></tr>" )
241 .arg( i18n(tempX) ); 241 .arg( i18n( "" ) )
242 .arg( i18n(tempX) );
243 }
242 } 244 }
243 245
244 246
245 tempX = mAddressee.secrecy().asString(); 247 tempX = mAddressee.secrecy().asString();
246 248
247 notes += QString( 249 notes += QString(
248 "<tr><td align=\"right\"><b>%1</b></td>" 250 "<tr><td align=\"right\"><b>%1</b></td>"
249 "<td align=\"left\">%2</td></tr>" ) 251 "<td align=\"left\">%2</td></tr>" )
250 .arg( "" ) 252 .arg( "" )
251 .arg( tempX ); 253 .arg( tempX );
252 254
253 255
@@ -318,30 +320,32 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee )
318 tempX = mAddressee.custom( "KADDRESSBOOK", "X-IMAddress" ); 320 tempX = mAddressee.custom( "KADDRESSBOOK", "X-IMAddress" );
319 if ( !tempX.isEmpty() ) { 321 if ( !tempX.isEmpty() ) {
320 notes += QString( 322 notes += QString(
321 "<tr><td align=\"right\"><b>%1</b></td>" 323 "<tr><td align=\"right\"><b>%1</b></td>"
322 "<td align=\"left\">%2</td></tr>" ) 324 "<td align=\"left\">%2</td></tr>" )
323 .arg( i18n( "Messanger" ) ) 325 .arg( i18n( "Messanger" ) )
324 .arg( tempX ); 326 .arg( tempX );
325 } 327 }
326 328
327 tempX = mAddressee.custom( "KADDRESSBOOK", "X-Anniversary" ); 329 tempX = mAddressee.custom( "KADDRESSBOOK", "X-Anniversary" );
328 if ( !tempX.isEmpty() ) { 330 if ( !tempX.isEmpty() ) {
329 QDate dt = KGlobal::locale()->readDate( tempX, "%Y-%m-%d"); 331 QDate dt = KGlobal::locale()->readDate( tempX, "%Y-%m-%d");
330 tempX = KGlobal::locale()->formatDate(dt, true); 332 if ( dt.isValid () ) {
331 notes += QString( 333 tempX = KGlobal::locale()->formatDate(dt, true);
332 "<tr><td align=\"right\"><b>%1</b></td>" 334 notes += QString(
333 "<td align=\"left\">%2</td></tr>" ) 335 "<tr><td align=\"right\"><b>%1</b></td>"
334 .arg( i18n( "Anniversary" ) ) 336 "<td align=\"left\">%2</td></tr>" )
335 .arg( tempX ); 337 .arg( i18n( "Anniversary" ) )
338 .arg( tempX );
339 }
336 } 340 }
337 tempX = mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ); 341 tempX = mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" );
338 if ( !tempX.isEmpty() ) { 342 if ( !tempX.isEmpty() ) {
339 notes += QString( 343 notes += QString(
340 "<tr><td align=\"right\"><b>%1</b></td>" 344 "<tr><td align=\"right\"><b>%1</b></td>"
341 "<td align=\"left\">%2</td></tr>" ) 345 "<td align=\"left\">%2</td></tr>" )
342 .arg( i18n( "Spouse" ) ) 346 .arg( i18n( "Spouse" ) )
343 .arg( tempX ); 347 .arg( tempX );
344 } 348 }
345 tempX = mAddressee.custom( "KADDRESSBOOK", "X-Children" ); 349 tempX = mAddressee.custom( "KADDRESSBOOK", "X-Children" );
346 if ( !tempX.isEmpty() ) { 350 if ( !tempX.isEmpty() ) {
347 notes += QString( 351 notes += QString(