-rw-r--r-- | kabc/addresseeview.cpp | 26 |
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 @@ -221,37 +221,39 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) .arg( (*addrIt).label() /*replace( QRegExp("\n"), "<br>" )*/ ); } } QString notes; if ( sFullDetailsMode ) { notes = QString( "<tr><td align=\"right\"><b>%1</b></td>" "<td align=\"left\"><a href=\"notAllDetails\">%4</a></td></tr>" ) .arg( i18n("Details") ) .arg( i18n("Hide!") ); QString tempX = mAddressee.custom( "KADDRESSBOOK", "X-Gender" ); if ( !tempX.isEmpty() ) { - notes += QString( - "<tr><td align=\"right\"><b>%1</b></td>" - "<td align=\"left\">%2</td></tr>" ) - .arg( i18n( "" ) ) - .arg( i18n(tempX) ); + if ( tempX == "male" || tempX == "female" ) { + notes += QString( + "<tr><td align=\"right\"><b>%1</b></td>" + "<td align=\"left\">%2</td></tr>" ) + .arg( i18n( "" ) ) + .arg( i18n(tempX) ); + } } tempX = mAddressee.secrecy().asString(); notes += QString( "<tr><td align=\"right\"><b>%1</b></td>" "<td align=\"left\">%2</td></tr>" ) .arg( "" ) .arg( tempX ); tempX = mAddressee.categories().join(" - "); if ( !tempX.isEmpty() ) { notes += QString( "<tr><td align=\"right\"><b>%1</b></td>" @@ -314,38 +316,40 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) "<td align=\"left\">%2</td></tr>" ) .arg( i18n( "Nickname" ) ) .arg( tempX ); } tempX = mAddressee.custom( "KADDRESSBOOK", "X-IMAddress" ); if ( !tempX.isEmpty() ) { notes += QString( "<tr><td align=\"right\"><b>%1</b></td>" "<td align=\"left\">%2</td></tr>" ) .arg( i18n( "Messanger" ) ) .arg( tempX ); } tempX = mAddressee.custom( "KADDRESSBOOK", "X-Anniversary" ); if ( !tempX.isEmpty() ) { QDate dt = KGlobal::locale()->readDate( tempX, "%Y-%m-%d"); - tempX = KGlobal::locale()->formatDate(dt, true); - notes += QString( - "<tr><td align=\"right\"><b>%1</b></td>" - "<td align=\"left\">%2</td></tr>" ) - .arg( i18n( "Anniversary" ) ) - .arg( tempX ); + if ( dt.isValid () ) { + tempX = KGlobal::locale()->formatDate(dt, true); + notes += QString( + "<tr><td align=\"right\"><b>%1</b></td>" + "<td align=\"left\">%2</td></tr>" ) + .arg( i18n( "Anniversary" ) ) + .arg( tempX ); + } } tempX = mAddressee.custom( "KADDRESSBOOK", "X-SpousesName" ); if ( !tempX.isEmpty() ) { notes += QString( "<tr><td align=\"right\"><b>%1</b></td>" "<td align=\"left\">%2</td></tr>" ) .arg( i18n( "Spouse" ) ) .arg( tempX ); } tempX = mAddressee.custom( "KADDRESSBOOK", "X-Children" ); if ( !tempX.isEmpty() ) { notes += QString( "<tr><td align=\"right\"><b>%1</b></td>" "<td align=\"left\">%2</td></tr>" ) .arg( i18n( "Children" ) ) .arg( tempX ); |