From caad9c7b3e7fc0c9046993f6a152cd37f91fdceb Mon Sep 17 00:00:00 2001 From: eilers Date: Tue, 04 Mar 2003 17:23:03 +0000 Subject: Fixing suffix handling --- diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index c4a7b10..75dd2c1 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp @@ -645,6 +645,8 @@ void ContactEditor::init() { connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); + connect( txtSuffix, SIGNAL(textChanged(const QString &)), this, SLOT(slotSuffixChange(const QString &)) ); + connect( txtChooserField1, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser1Change(const QString &)) ); connect( txtChooserField2, SIGNAL(textChanged(const QString &)), @@ -1037,6 +1039,11 @@ void ContactEditor::slotFullNameChange( const QString &textChanged ) { } +void ContactEditor::slotSuffixChange( const QString& ) { + // Just want to update the FileAs combo if the suffix was changed.. + slotFullNameChange( txtFullName->text() ); +} + void ContactEditor::accept() { if ( isEmpty() ) { @@ -1070,7 +1077,7 @@ void ContactEditor::slotName() { dlgName->showMaximized(); if ( dlgName->exec() ) { - tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text() + " " + txtSuffix->text(); + tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text(); txtFullName->setText( tmpName.simplifyWhiteSpace() ); slotFullNameChange( txtFullName->text() ); useFullName = false; @@ -1106,7 +1113,6 @@ QString ContactEditor::parseName( const QString fullName, int type ) { QString strFirstName; QString strMiddleName; QString strLastName; - QString strSuffix; QString strTitle; int commapos; bool haveLastName = false; @@ -1161,7 +1167,6 @@ QString ContactEditor::parseName( const QString fullName, int type ) { 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()); switch (type) { @@ -1175,7 +1180,7 @@ QString ContactEditor::parseName( const QString fullName, int type ) { return strLastName + ", " + strFirstName + " " + strMiddleName; case NAME_FMLS: - return strFirstName + " " + strMiddleName + " " + strLastName + " " + strSuffix; + return strFirstName + " " + strMiddleName + " " + strLastName + " " + txtSuffix->text(); case NAME_F: return strFirstName; @@ -1187,7 +1192,7 @@ QString ContactEditor::parseName( const QString fullName, int type ) { return strLastName; case NAME_S: - return strSuffix; + return txtSuffix->text(); } return QString::null; diff --git a/core/pim/addressbook/contacteditor.h b/core/pim/addressbook/contacteditor.h index 703e702..954c77e 100644 --- a/core/pim/addressbook/contacteditor.h +++ b/core/pim/addressbook/contacteditor.h @@ -100,6 +100,7 @@ class ContactEditor : public QDialog { void slotZipChange( const QString &textChanged ); void slotCountryChange( const QString &textChanged ); void slotFullNameChange( const QString &textChanged ); + void slotSuffixChange( const QString &textChanged ); void slotAnniversaryDateChanged( int year, int month, int day); void slotBirthdayDateChanged( int year, int month, int day); void slotRemoveBirthday(); -- cgit v0.9.0.2