Diffstat (limited to 'core/pim/addressbook/contacteditor.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index df97b85..f33ee0a 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -1235,49 +1235,51 @@ void ContactEditor::cleanupFields() { | |||
1235 | txtLastName->setText(""); | 1235 | txtLastName->setText(""); |
1236 | txtSuffix->setText(""); | 1236 | txtSuffix->setText(""); |
1237 | txtNote->setText(""); | 1237 | txtNote->setText(""); |
1238 | txtFullName->setText(""); | 1238 | txtFullName->setText(""); |
1239 | txtJobTitle->setText(""); | 1239 | txtJobTitle->setText(""); |
1240 | txtOrganization->setText(""); | 1240 | txtOrganization->setText(""); |
1241 | txtChooserField1->setText(""); | 1241 | txtChooserField1->setText(""); |
1242 | txtChooserField2->setText(""); | 1242 | txtChooserField2->setText(""); |
1243 | txtChooserField3->setText(""); | 1243 | txtChooserField3->setText(""); |
1244 | txtAddress->setText(""); | 1244 | txtAddress->setText(""); |
1245 | txtCity->setText(""); | 1245 | txtCity->setText(""); |
1246 | txtState->setText(""); | 1246 | txtState->setText(""); |
1247 | txtZip->setText(""); | 1247 | txtZip->setText(""); |
1248 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 1248 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
1249 | txtTmp->setText(""); | 1249 | txtTmp->setText(""); |
1250 | txtTmp = cmbFileAs->lineEdit(); | 1250 | txtTmp = cmbFileAs->lineEdit(); |
1251 | txtTmp->setText(""); | 1251 | txtTmp->setText(""); |
1252 | 1252 | ||
1253 | } | 1253 | } |
1254 | 1254 | ||
1255 | void ContactEditor::setEntry( const OContact &entry ) { | 1255 | void ContactEditor::setEntry( const OContact &entry ) { |
1256 | 1256 | ||
1257 | initializing = true; | 1257 | initializing = true; |
1258 | 1258 | ||
1259 | // Cleanup and activate the general Page .. | ||
1259 | cleanupFields(); | 1260 | cleanupFields(); |
1261 | tabMain->setCurrentPage( 0 ); | ||
1260 | 1262 | ||
1261 | ent = entry; | 1263 | ent = entry; |
1262 | 1264 | ||
1263 | emails = QStringList(ent.emailList()); | 1265 | emails = QStringList(ent.emailList()); |
1264 | defaultEmail = ent.defaultEmail(); | 1266 | defaultEmail = ent.defaultEmail(); |
1265 | if (defaultEmail.isEmpty()) defaultEmail = emails[0]; | 1267 | if (defaultEmail.isEmpty()) defaultEmail = emails[0]; |
1266 | qDebug("default email=%s",defaultEmail.latin1()); | 1268 | qDebug("default email=%s",defaultEmail.latin1()); |
1267 | 1269 | ||
1268 | txtFirstName->setText( ent.firstName() ); | 1270 | txtFirstName->setText( ent.firstName() ); |
1269 | txtMiddleName->setText( ent.middleName() ); | 1271 | txtMiddleName->setText( ent.middleName() ); |
1270 | txtLastName->setText( ent.lastName() ); | 1272 | txtLastName->setText( ent.lastName() ); |
1271 | txtSuffix->setText( ent.suffix() ); | 1273 | txtSuffix->setText( ent.suffix() ); |
1272 | 1274 | ||
1273 | // QString *tmpString = new QString; | 1275 | // QString *tmpString = new QString; |
1274 | // *tmpString = ent.firstName() + " " + ent.middleName() + | 1276 | // *tmpString = ent.firstName() + " " + ent.middleName() + |
1275 | // + " " + ent.lastName() + " " + ent.suffix(); | 1277 | // + " " + ent.lastName() + " " + ent.suffix(); |
1276 | //txtFullName->setText( tmpString->simplifyWhiteSpace() ); | 1278 | //txtFullName->setText( tmpString->simplifyWhiteSpace() ); |
1277 | 1279 | ||
1278 | if ( !ent.isEmpty() ){ | 1280 | if ( !ent.isEmpty() ){ |
1279 | // Lastnames with multiple words need to be protected by a comma ! | 1281 | // Lastnames with multiple words need to be protected by a comma ! |
1280 | if ( ent.lastName().contains( ' ', TRUE ) ) | 1282 | if ( ent.lastName().contains( ' ', TRUE ) ) |
1281 | txtFullName->setText( ent.lastName() + ", " + ent.firstName() + " " + ent.middleName() ); | 1283 | txtFullName->setText( ent.lastName() + ", " + ent.firstName() + " " + ent.middleName() ); |
1282 | else | 1284 | else |
1283 | txtFullName->setText( ent.firstName() + " " + ent.middleName() + " " + ent.lastName() ); | 1285 | txtFullName->setText( ent.firstName() + " " + ent.middleName() + " " + ent.lastName() ); |