summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/contacteditor.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/addressbook/contacteditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index 7bc5bde..c4a7b10 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -1023,16 +1023,16 @@ void ContactEditor::slotFullNameChange( const QString &textChanged ) {
qWarning( "ContactEditor::slotFullNameChange( %s )", textChanged.latin1() );
int index = cmbFileAs->currentItem();
cmbFileAs->clear();
- cmbFileAs->insertItem( parseName( textChanged, NAME_FL ) );
- cmbFileAs->insertItem( parseName( textChanged, NAME_FMLS ) );
cmbFileAs->insertItem( parseName( textChanged, NAME_LF ) );
cmbFileAs->insertItem( parseName( textChanged, NAME_LFM ) );
+ cmbFileAs->insertItem( parseName( textChanged, NAME_FL ) );
+ cmbFileAs->insertItem( parseName( textChanged, NAME_FMLS ) );
cmbFileAs->setCurrentItem( index );
useFullName = true;
}
@@ -1149,15 +1149,18 @@ QString ContactEditor::parseName( const QString fullName, int type ) {
QStringList allSecondNames;
for ( ; it != --allNames.end(); ++it )
allSecondNames.append( *it );
strMiddleName = allSecondNames.join(" ");
strLastName = *(--allNames.end());
-
+
}
+ if ( strFirstName == strLastName )
+ strFirstName = "";
+
qWarning(" strFirstName: %s", strFirstName.latin1());
qWarning(" strMiddleName: %s", strMiddleName.latin1());
qWarning(" strLastName: %s", strLastName.latin1());
qWarning(" strSuffix: %s", strSuffix.latin1());
qWarning(" strTitle: %s", strTitle.latin1());