summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/nameeditdialog.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/kaddressbook/nameeditdialog.cpp b/kaddressbook/nameeditdialog.cpp
index f5dba0f..199f3d6 100644
--- a/kaddressbook/nameeditdialog.cpp
+++ b/kaddressbook/nameeditdialog.cpp
@@ -233,13 +233,18 @@ QString NameEditDialog::formattedName( const KABC::Addressee &addr, int type )
233 case FullName: 233 case FullName:
234 retval =addr.prefix() + " " + addr.givenName() + " " + 234 retval =addr.prefix() + " " + addr.givenName() + " " +
235 addr.additionalName() + " " + addr.familyName() + " " + 235 addr.additionalName() + " " + addr.familyName() + " " +
236 addr.suffix(); 236 addr.suffix();
237 break; 237 break;
238 case ReverseName: 238 case ReverseName:
239 retval = addr.familyName() + ", " + addr.givenName(); 239 if ( !addr.familyName().isEmpty() ) {
240 retval = addr.familyName();
241 if ( !addr.givenName().isEmpty() )
242 retval += ", " + addr.givenName();
243 } else
244 retval = addr.givenName();
240 break; 245 break;
241 default: 246 default:
242 return ""; 247 return "";
243 break; 248 break;
244 } 249 }
245 return retval.stripWhiteSpace (); 250 return retval.stripWhiteSpace ();