author | eilers <eilers> | 2003-03-04 17:23:03 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-03-04 17:23:03 (UTC) |
commit | caad9c7b3e7fc0c9046993f6a152cd37f91fdceb (patch) (unidiff) | |
tree | 189006e4f369cf6a373fd20f277966ff42117b5b /core/pim | |
parent | 55e5d2c95f70d296c541e4f2564713a593c3851c (diff) | |
download | opie-caad9c7b3e7fc0c9046993f6a152cd37f91fdceb.zip opie-caad9c7b3e7fc0c9046993f6a152cd37f91fdceb.tar.gz opie-caad9c7b3e7fc0c9046993f6a152cd37f91fdceb.tar.bz2 |
Fixing suffix handling
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 15 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.h | 1 |
2 files changed, 11 insertions, 5 deletions
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() { | |||
645 | 645 | ||
646 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); | 646 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); |
647 | 647 | ||
648 | connect( txtSuffix, SIGNAL(textChanged(const QString &)), this, SLOT(slotSuffixChange(const QString &)) ); | ||
649 | |||
648 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), | 650 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), |
649 | this, SLOT(slotChooser1Change(const QString &)) ); | 651 | this, SLOT(slotChooser1Change(const QString &)) ); |
650 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), | 652 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), |
@@ -1037,6 +1039,11 @@ void ContactEditor::slotFullNameChange( const QString &textChanged ) { | |||
1037 | 1039 | ||
1038 | } | 1040 | } |
1039 | 1041 | ||
1042 | void ContactEditor::slotSuffixChange( const QString& ) { | ||
1043 | // Just want to update the FileAs combo if the suffix was changed.. | ||
1044 | slotFullNameChange( txtFullName->text() ); | ||
1045 | } | ||
1046 | |||
1040 | void ContactEditor::accept() { | 1047 | void ContactEditor::accept() { |
1041 | 1048 | ||
1042 | if ( isEmpty() ) { | 1049 | if ( isEmpty() ) { |
@@ -1070,7 +1077,7 @@ void ContactEditor::slotName() { | |||
1070 | dlgName->showMaximized(); | 1077 | dlgName->showMaximized(); |
1071 | if ( dlgName->exec() ) { | 1078 | if ( dlgName->exec() ) { |
1072 | 1079 | ||
1073 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text() + " " + txtSuffix->text(); | 1080 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text(); |
1074 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); | 1081 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); |
1075 | slotFullNameChange( txtFullName->text() ); | 1082 | slotFullNameChange( txtFullName->text() ); |
1076 | useFullName = false; | 1083 | useFullName = false; |
@@ -1106,7 +1113,6 @@ QString ContactEditor::parseName( const QString fullName, int type ) { | |||
1106 | QString strFirstName; | 1113 | QString strFirstName; |
1107 | QString strMiddleName; | 1114 | QString strMiddleName; |
1108 | QString strLastName; | 1115 | QString strLastName; |
1109 | QString strSuffix; | ||
1110 | QString strTitle; | 1116 | QString strTitle; |
1111 | int commapos; | 1117 | int commapos; |
1112 | bool haveLastName = false; | 1118 | bool haveLastName = false; |
@@ -1161,7 +1167,6 @@ QString ContactEditor::parseName( const QString fullName, int type ) { | |||
1161 | qWarning(" strFirstName: %s", strFirstName.latin1()); | 1167 | qWarning(" strFirstName: %s", strFirstName.latin1()); |
1162 | qWarning(" strMiddleName: %s", strMiddleName.latin1()); | 1168 | qWarning(" strMiddleName: %s", strMiddleName.latin1()); |
1163 | qWarning(" strLastName: %s", strLastName.latin1()); | 1169 | qWarning(" strLastName: %s", strLastName.latin1()); |
1164 | qWarning(" strSuffix: %s", strSuffix.latin1()); | ||
1165 | qWarning(" strTitle: %s", strTitle.latin1()); | 1170 | qWarning(" strTitle: %s", strTitle.latin1()); |
1166 | 1171 | ||
1167 | switch (type) { | 1172 | switch (type) { |
@@ -1175,7 +1180,7 @@ QString ContactEditor::parseName( const QString fullName, int type ) { | |||
1175 | return strLastName + ", " + strFirstName + " " + strMiddleName; | 1180 | return strLastName + ", " + strFirstName + " " + strMiddleName; |
1176 | 1181 | ||
1177 | case NAME_FMLS: | 1182 | case NAME_FMLS: |
1178 | return strFirstName + " " + strMiddleName + " " + strLastName + " " + strSuffix; | 1183 | return strFirstName + " " + strMiddleName + " " + strLastName + " " + txtSuffix->text(); |
1179 | 1184 | ||
1180 | case NAME_F: | 1185 | case NAME_F: |
1181 | return strFirstName; | 1186 | return strFirstName; |
@@ -1187,7 +1192,7 @@ QString ContactEditor::parseName( const QString fullName, int type ) { | |||
1187 | return strLastName; | 1192 | return strLastName; |
1188 | 1193 | ||
1189 | case NAME_S: | 1194 | case NAME_S: |
1190 | return strSuffix; | 1195 | return txtSuffix->text(); |
1191 | 1196 | ||
1192 | } | 1197 | } |
1193 | return QString::null; | 1198 | 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 { | |||
100 | void slotZipChange( const QString &textChanged ); | 100 | void slotZipChange( const QString &textChanged ); |
101 | void slotCountryChange( const QString &textChanged ); | 101 | void slotCountryChange( const QString &textChanged ); |
102 | void slotFullNameChange( const QString &textChanged ); | 102 | void slotFullNameChange( const QString &textChanged ); |
103 | void slotSuffixChange( const QString &textChanged ); | ||
103 | void slotAnniversaryDateChanged( int year, int month, int day); | 104 | void slotAnniversaryDateChanged( int year, int month, int day); |
104 | void slotBirthdayDateChanged( int year, int month, int day); | 105 | void slotBirthdayDateChanged( int year, int month, int day); |
105 | void slotRemoveBirthday(); | 106 | void slotRemoveBirthday(); |