summaryrefslogtreecommitdiff
authortux_mike <tux_mike>2002-04-18 20:07:11 (UTC)
committer tux_mike <tux_mike>2002-04-18 20:07:11 (UTC)
commit56c20411484700350362b5041e3c9db030084caf (patch) (unidiff)
tree4779dffaf8a4b54312f63a103c01b5042f9c876c
parent706686e0ee82390b85bd4e3ba2813251cae5ea0d (diff)
downloadopie-56c20411484700350362b5041e3c9db030084caf.zip
opie-56c20411484700350362b5041e3c9db030084caf.tar.gz
opie-56c20411484700350362b5041e3c9db030084caf.tar.bz2
Fixed a bug with Suffixes due to a missing 2
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index cbcd11f..adea1a1 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -1004,47 +1004,47 @@ QString ContactEditor::parseName( const QString fullName, int type ) {
1004 strFirstName = simplifiedName.left( spPos ); 1004 strFirstName = simplifiedName.left( spPos );
1005 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1005 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1006 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1006 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1007 strLastName = simplifiedName.mid( spPos2 + 1 ); 1007 strLastName = simplifiedName.mid( spPos2 + 1 );
1008 break; 1008 break;
1009 1009
1010 case 3: 1010 case 3:
1011 spPos = simplifiedName.find( ' ', 0, TRUE ); 1011 spPos = simplifiedName.find( ' ', 0, TRUE );
1012 strFirstName = simplifiedName.left( spPos ); 1012 strFirstName = simplifiedName.left( spPos );
1013 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1013 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1014 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1014 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1015 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1015 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1016 strLastName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); 1016 strLastName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 );
1017 strSuffix = simplifiedName.mid( spPos + 1 ); 1017 strSuffix = simplifiedName.mid( spPos + 1 );
1018 break; 1018 break;
1019 1019
1020 case 4: 1020 case 4:
1021 spPos = simplifiedName.find( ' ', 0, TRUE ); 1021 spPos = simplifiedName.find( ' ', 0, TRUE );
1022 strTitle = simplifiedName.left( spPos ); 1022 strTitle = simplifiedName.left( spPos );
1023 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1023 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1024 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1024 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1025 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1025 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1026 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); 1026 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 );
1027 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1027 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1028 strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1028 strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1029 strSuffix = simplifiedName.mid( spPos2 + 1 ); 1029 strSuffix = simplifiedName.mid( spPos2 + 1 );
1030 break; 1030 break;
1031 1031
1032 default: 1032 default:
1033 spPos = simplifiedName.find( ' ', 0, TRUE ); 1033 spPos = simplifiedName.find( ' ', 0, TRUE );
1034 strTitle = simplifiedName.left( spPos ); 1034 strTitle = simplifiedName.left( spPos );
1035 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1035 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1036 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1036 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1037 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1037 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1038 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); 1038 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 );
1039 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1039 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1040 strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1040 strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1041 strSuffix = simplifiedName.mid( spPos2 + 1 ); 1041 strSuffix = simplifiedName.mid( spPos2 + 1 );
1042 break; 1042 break;
1043 } 1043 }
1044 } else { 1044 } else {
1045 simplifiedName.replace( commapos, 1, " " ); 1045 simplifiedName.replace( commapos, 1, " " );
1046 simplifiedName = simplifiedName.simplifyWhiteSpace(); 1046 simplifiedName = simplifiedName.simplifyWhiteSpace();
1047 1047
1048 switch (spCount) { 1048 switch (spCount) {
1049 case 0: 1049 case 0:
1050 return simplifiedName; 1050 return simplifiedName;
@@ -1060,35 +1060,35 @@ QString ContactEditor::parseName( const QString fullName, int type ) {
1060 strLastName = simplifiedName.left( spPos ); 1060 strLastName = simplifiedName.left( spPos );
1061 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1061 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1062 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1062 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1063 strMiddleName = simplifiedName.mid( spPos2 + 1 ); 1063 strMiddleName = simplifiedName.mid( spPos2 + 1 );
1064 break; 1064 break;
1065 1065
1066 case 3: 1066 case 3:
1067 spPos = simplifiedName.find( ' ', 0, TRUE ); 1067 spPos = simplifiedName.find( ' ', 0, TRUE );
1068 strLastName = simplifiedName.left( spPos ); 1068 strLastName = simplifiedName.left( spPos );
1069 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1069 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1070 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1070 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1071 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1071 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1072 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); 1072 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 );
1073 strSuffix = simplifiedName.mid( spPos + 1 ); 1073 strSuffix = simplifiedName.mid( spPos + 1 );
1074 break; 1074 break;
1075 1075
1076 case 4: 1076 case 4:
1077 spPos = simplifiedName.find( ' ', 0, TRUE ); 1077 spPos = simplifiedName.find( ' ', 0, TRUE );
1078 strLastName = simplifiedName.left( spPos ); 1078 strLastName = simplifiedName.left( spPos );
1079 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1079 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1080 strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1080 strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1081 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1081 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1082 strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); 1082 strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 );
1083 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1083 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1084 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1084 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1085 strSuffix = simplifiedName.mid( spPos2 + 1 ); 1085 strSuffix = simplifiedName.mid( spPos2 + 1 );
1086 break; 1086 break;
1087 1087
1088 default: 1088 default:
1089 spPos = simplifiedName.find( ' ', 0, TRUE ); 1089 spPos = simplifiedName.find( ' ', 0, TRUE );
1090 strLastName = simplifiedName.left( spPos ); 1090 strLastName = simplifiedName.left( spPos );
1091 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1091 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1092 strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1092 strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1093 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1093 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1094 strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); 1094 strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos );
@@ -1370,24 +1370,25 @@ void ContactEditor::saveEntry() {
1370 txtSuffix->setText( parseName( txtFullName->text(), NAME_S ) ); 1370 txtSuffix->setText( parseName( txtFullName->text(), NAME_S ) );
1371 1371
1372 useFullName = FALSE; 1372 useFullName = FALSE;
1373 } 1373 }
1374 1374
1375 /*if ( ent.firstName() != txtFirstName->text() || 1375 /*if ( ent.firstName() != txtFirstName->text() ||
1376 ent.lastName != txtLastName->text() || 1376 ent.lastName != txtLastName->text() ||
1377 ent.middleName != txtMiddleName->text() ) { 1377 ent.middleName != txtMiddleName->text() ) {
1378 */ 1378 */
1379 ent.setFirstName( txtFirstName->text() ); 1379 ent.setFirstName( txtFirstName->text() );
1380 ent.setLastName( txtLastName->text() ); 1380 ent.setLastName( txtLastName->text() );
1381 ent.setMiddleName( txtMiddleName->text() ); 1381 ent.setMiddleName( txtMiddleName->text() );
1382 ent.setSuffix( txtSuffix->text() );
1382 1383
1383 //} 1384 //}
1384 1385
1385 ent.setFileAs( cmbFileAs->currentText() ); 1386 ent.setFileAs( cmbFileAs->currentText() );
1386 1387
1387 ent.setCategories( cmbCat->currentCategories() ); 1388 ent.setCategories( cmbCat->currentCategories() );
1388 1389
1389 if (hasTitle) 1390 if (hasTitle)
1390 ent.setJobTitle( txtJobTitle->text() ); 1391 ent.setJobTitle( txtJobTitle->text() );
1391 1392
1392 if (hasCompany) 1393 if (hasCompany)
1393 ent.setCompany( txtOrganization->text() ); 1394 ent.setCompany( txtOrganization->text() );