summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/contacteditor.cpp
Unidiff
Diffstat (limited to 'core/pim/addressbook/contacteditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp2
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
@@ -1211,97 +1211,99 @@ QString ContactEditor::parseName( const QString fullName, int type ) {
1211 1211
1212 } 1212 }
1213 return QString::null; 1213 return QString::null;
1214} 1214}
1215 1215
1216void ContactEditor::cleanupFields() { 1216void ContactEditor::cleanupFields() {
1217 QStringList::Iterator it = slChooserValues.begin(); 1217 QStringList::Iterator it = slChooserValues.begin();
1218 1218
1219 for ( int i = 0; it != slChooserValues.end(); i++, ++it ) { 1219 for ( int i = 0; it != slChooserValues.end(); i++, ++it ) {
1220 (*it) = ""; 1220 (*it) = "";
1221 } 1221 }
1222 1222
1223 for ( int i = 0; i < 7; i++ ) { 1223 for ( int i = 0; i < 7; i++ ) {
1224 slHomeAddress[i] = ""; 1224 slHomeAddress[i] = "";
1225 slBusinessAddress[i] = ""; 1225 slBusinessAddress[i] = "";
1226 } 1226 }
1227 1227
1228 QListIterator<QLineEdit> itLV( listValue ); 1228 QListIterator<QLineEdit> itLV( listValue );
1229 for ( ; itLV.current(); ++itLV ) { 1229 for ( ; itLV.current(); ++itLV ) {
1230 (*itLV)->setText( "" ); 1230 (*itLV)->setText( "" );
1231 } 1231 }
1232 1232
1233 txtFirstName->setText(""); 1233 txtFirstName->setText("");
1234 txtMiddleName->setText(""); 1234 txtMiddleName->setText("");
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
1255void ContactEditor::setEntry( const OContact &entry ) { 1255void 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() );
1284 } 1286 }
1285 1287
1286 cmbFileAs->setEditText( ent.fileAs() ); 1288 cmbFileAs->setEditText( ent.fileAs() );
1287 1289
1288 //if (hasTitle) 1290 //if (hasTitle)
1289 txtJobTitle->setText( ent.jobTitle() ); 1291 txtJobTitle->setText( ent.jobTitle() );
1290 1292
1291 //if (hasCompany) 1293 //if (hasCompany)
1292 txtOrganization->setText( ent.company() ); 1294 txtOrganization->setText( ent.company() );
1293 1295
1294 //if (hasNotes) 1296 //if (hasNotes)
1295 txtNote->setText( ent.notes() ); 1297 txtNote->setText( ent.notes() );
1296 1298
1297 //if (hasStreet) { 1299 //if (hasStreet) {
1298 slHomeAddress[0] = ent.homeStreet(); 1300 slHomeAddress[0] = ent.homeStreet();
1299 slBusinessAddress[0] = ent.businessStreet(); 1301 slBusinessAddress[0] = ent.businessStreet();
1300 //} 1302 //}
1301 1303
1302 //if (hasCity) { 1304 //if (hasCity) {
1303 slHomeAddress[3] = ent.homeCity(); 1305 slHomeAddress[3] = ent.homeCity();
1304 slBusinessAddress[3] = ent.businessCity(); 1306 slBusinessAddress[3] = ent.businessCity();
1305 //} 1307 //}
1306 1308
1307 //if (hasState) { 1309 //if (hasState) {