summaryrefslogtreecommitdiff
authoreilers <eilers>2003-01-13 17:38:53 (UTC)
committer eilers <eilers>2003-01-13 17:38:53 (UTC)
commit90706ff3edbf0c30856bb9786e69a6d3a0e0867a (patch) (unidiff)
tree19839cdc38a737724a9228f421cd291cbe45baa1
parent6bae3504f8eacd604bc6d543d3eb09f996221dcc (diff)
downloadopie-90706ff3edbf0c30856bb9786e69a6d3a0e0867a.zip
opie-90706ff3edbf0c30856bb9786e69a6d3a0e0867a.tar.gz
opie-90706ff3edbf0c30856bb9786e69a6d3a0e0867a.tar.bz2
Removed nonsense which corrupted the business phone data
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index 37e3a54..d14ac51 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -618,66 +618,67 @@ void ContactEditor::init() {
618 this, SLOT(slotChooser4Change(const QString &)) ); 618 this, SLOT(slotChooser4Change(const QString &)) );
619 connect( txtAddress, SIGNAL(textChanged(const QString &)), 619 connect( txtAddress, SIGNAL(textChanged(const QString &)),
620 this, SLOT(slotAddressChange(const QString &)) ); 620 this, SLOT(slotAddressChange(const QString &)) );
621 connect( txtCity, SIGNAL(textChanged(const QString &)), 621 connect( txtCity, SIGNAL(textChanged(const QString &)),
622 this, SLOT(slotCityChange(const QString &)) ); 622 this, SLOT(slotCityChange(const QString &)) );
623 connect( txtState, SIGNAL(textChanged(const QString &)), 623 connect( txtState, SIGNAL(textChanged(const QString &)),
624 this, SLOT(slotStateChange(const QString &)) ); 624 this, SLOT(slotStateChange(const QString &)) );
625 connect( txtZip, SIGNAL(textChanged(const QString &)), 625 connect( txtZip, SIGNAL(textChanged(const QString &)),
626 this, SLOT(slotZipChange(const QString &)) ); 626 this, SLOT(slotZipChange(const QString &)) );
627 connect( cmbCountry, SIGNAL(textChanged(const QString &)), 627 connect( cmbCountry, SIGNAL(textChanged(const QString &)),
628 this, SLOT(slotCountryChange(const QString &)) ); 628 this, SLOT(slotCountryChange(const QString &)) );
629 connect( cmbCountry, SIGNAL(activated(const QString &)), 629 connect( cmbCountry, SIGNAL(activated(const QString &)),
630 this, SLOT(slotCountryChange(const QString &)) ); 630 this, SLOT(slotCountryChange(const QString &)) );
631 connect( cmbChooserField1, SIGNAL(activated(int)), 631 connect( cmbChooserField1, SIGNAL(activated(int)),
632 this, SLOT(slotCmbChooser1Change(int)) ); 632 this, SLOT(slotCmbChooser1Change(int)) );
633 connect( cmbChooserField2, SIGNAL(activated(int)), 633 connect( cmbChooserField2, SIGNAL(activated(int)),
634 this, SLOT(slotCmbChooser2Change(int)) ); 634 this, SLOT(slotCmbChooser2Change(int)) );
635 connect( cmbChooserField3, SIGNAL(activated(int)), 635 connect( cmbChooserField3, SIGNAL(activated(int)),
636 this, SLOT(slotCmbChooser3Change(int)) ); 636 this, SLOT(slotCmbChooser3Change(int)) );
637 connect( cmbChooserField4, SIGNAL(activated(int)), 637 connect( cmbChooserField4, SIGNAL(activated(int)),
638 this, SLOT(slotCmbChooser4Change(int)) ); 638 this, SLOT(slotCmbChooser4Change(int)) );
639 connect( cmbAddress, SIGNAL(activated(int)), 639 connect( cmbAddress, SIGNAL(activated(int)),
640 this, SLOT(slotAddressTypeChange(int)) ); 640 this, SLOT(slotAddressTypeChange(int)) );
641 641
642 new QPEDialogListener(this); 642 new QPEDialogListener(this);
643 643
644 setPersonalView ( m_personalView ); 644 setPersonalView ( m_personalView );
645} 645}
646 646
647void ContactEditor::defaultEmailChanged(int i){ 647void ContactEditor::defaultEmailChanged(int i){
648 qDebug("defaultEmailChanged"); 648 qDebug("defaultEmailChanged");
649 649
650 int index = cmbChooserField1->currentItem(); 650 // was sollte das ? (se)
651 slChooserValues[index] = cmbDefaultEmail->text(i); 651 // int index = cmbChooserField1->currentItem();
652 // slChooserValues[index] = cmbDefaultEmail->text(i);
652 653
653 defaultEmail = cmbDefaultEmail->text(i); 654 defaultEmail = cmbDefaultEmail->text(i);
654 qDebug ("Changed to: %s", defaultEmail.latin1()); 655 qDebug ("Changed to: %s", defaultEmail.latin1());
655 656
656} 657}
657 658
658void ContactEditor::populateDefaultEmailCmb(){ 659void ContactEditor::populateDefaultEmailCmb(){
659 660
660 // if the default-email combo was not selected and therfore not created 661 // if the default-email combo was not selected and therfore not created
661 // we get a lot of trouble.. Therfore create an invisible one.. 662 // we get a lot of trouble.. Therfore create an invisible one..
662 if ( !cmbDefaultEmail ){ 663 if ( !cmbDefaultEmail ){
663 cmbDefaultEmail = new QComboBox(this); 664 cmbDefaultEmail = new QComboBox(this);
664 cmbDefaultEmail -> hide(); 665 cmbDefaultEmail -> hide();
665 } 666 }
666 cmbDefaultEmail->clear(); 667 cmbDefaultEmail->clear();
667 cmbDefaultEmail->insertStringList( emails ); 668 cmbDefaultEmail->insertStringList( emails );
668 // cmbDefaultEmail->show(); 669 // cmbDefaultEmail->show();
669 670
670 // Select default email in combo.. 671 // Select default email in combo..
671 bool found = false; 672 bool found = false;
672 for ( int i = 0; i < cmbDefaultEmail->count(); i++){ 673 for ( int i = 0; i < cmbDefaultEmail->count(); i++){
673 qDebug(" populateDefaultEmailCmb text >%s< defaultEmail >%s<", 674 qDebug(" populateDefaultEmailCmb text >%s< defaultEmail >%s<",
674 cmbDefaultEmail->text( i ).latin1(), defaultEmail.latin1()); 675 cmbDefaultEmail->text( i ).latin1(), defaultEmail.latin1());
675 676
676 if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){ 677 if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){
677 cmbDefaultEmail->setCurrentItem( i ); 678 cmbDefaultEmail->setCurrentItem( i );
678 qDebug("set"); 679 qDebug("set");
679 found = true; 680 found = true;
680 } 681 }
681 } 682 }
682 683
683 // If the current default email is not found in the list, we choose the 684 // If the current default email is not found in the list, we choose the
@@ -870,65 +871,64 @@ void ContactEditor::slotCityChange( const QString &textChanged ) {
870 871
871void ContactEditor::slotStateChange( const QString &textChanged ) { 872void ContactEditor::slotStateChange( const QString &textChanged ) {
872 873
873 874
874 if ( cmbAddress->currentItem() == 0 ) { 875 if ( cmbAddress->currentItem() == 0 ) {
875 slBusinessAddress[4] = textChanged; 876 slBusinessAddress[4] = textChanged;
876 } else { 877 } else {
877 slHomeAddress[4] = textChanged; 878 slHomeAddress[4] = textChanged;
878 } 879 }
879} 880}
880 881
881void ContactEditor::slotZipChange( const QString &textChanged ) { 882void ContactEditor::slotZipChange( const QString &textChanged ) {
882 883
883 if ( cmbAddress->currentItem() == 0 ) { 884 if ( cmbAddress->currentItem() == 0 ) {
884 slBusinessAddress[5] = textChanged; 885 slBusinessAddress[5] = textChanged;
885 } else { 886 } else {
886 slHomeAddress[5] = textChanged; 887 slHomeAddress[5] = textChanged;
887 } 888 }
888} 889}
889 890
890void ContactEditor::slotCountryChange( const QString &textChanged ) { 891void ContactEditor::slotCountryChange( const QString &textChanged ) {
891 892
892 if ( cmbAddress->currentItem() == 0 ) { 893 if ( cmbAddress->currentItem() == 0 ) {
893 slBusinessAddress[6] = textChanged; 894 slBusinessAddress[6] = textChanged;
894 } else { 895 } else {
895 slHomeAddress[6] = textChanged; 896 slHomeAddress[6] = textChanged;
896 } 897 }
897} 898}
898 899
899 900
900void ContactEditor::slotCmbChooser1Change( int index ) { 901void ContactEditor::slotCmbChooser1Change( int index ) {
901 qWarning("ContactEditor::slotCmbChooser1Change( %d )", index); 902 qWarning("ContactEditor::slotCmbChooser1Change( %d )", index);
902
903 if ( !cmbChooserChange( cmbChooserField1->currentItem(), txtChooserField1, 1) ){ 903 if ( !cmbChooserChange( cmbChooserField1->currentItem(), txtChooserField1, 1) ){
904 904
905 txtChooserField1->setText( slChooserValues[index] ); 905 txtChooserField1->setText( slChooserValues[index] );
906 txtChooserField1->setFocus(); 906 txtChooserField1->setFocus();
907 907
908 } 908 }
909 909
910} 910}
911 911
912void ContactEditor::slotCmbChooser2Change( int index ) { 912void ContactEditor::slotCmbChooser2Change( int index ) {
913 qWarning("ContactEditor::slotCmbChooser2Change( %d )", index); 913 qWarning("ContactEditor::slotCmbChooser2Change( %d )", index);
914 914
915 if ( !cmbChooserChange( cmbChooserField2->currentItem(), txtChooserField2, 2) ){ 915 if ( !cmbChooserChange( cmbChooserField2->currentItem(), txtChooserField2, 2) ){
916 916
917 txtChooserField2->setText( slChooserValues[index] ); 917 txtChooserField2->setText( slChooserValues[index] );
918 txtChooserField2->setFocus(); 918 txtChooserField2->setFocus();
919 919
920 } 920 }
921} 921}
922 922
923void ContactEditor::slotCmbChooser3Change( int index ) { 923void ContactEditor::slotCmbChooser3Change( int index ) {
924 qWarning("ContactEditor::slotCmbChooser3Change( %d )", index); 924 qWarning("ContactEditor::slotCmbChooser3Change( %d )", index);
925 925
926 if ( !cmbChooserChange( cmbChooserField3->currentItem(), txtChooserField3, 3) ){ 926 if ( !cmbChooserChange( cmbChooserField3->currentItem(), txtChooserField3, 3) ){
927 927
928 txtChooserField3->setText( slChooserValues[index] ); 928 txtChooserField3->setText( slChooserValues[index] );
929 txtChooserField3->setFocus(); 929 txtChooserField3->setFocus();
930 930
931 } 931 }
932} 932}
933 933
934void ContactEditor::slotCmbChooser4Change( int index ) { 934void ContactEditor::slotCmbChooser4Change( int index ) {
@@ -1454,64 +1454,65 @@ void ContactEditor::setEntry( const OContact &entry ) {
1454 cmbGender->setCurrentItem( gender.toInt() ); 1454 cmbGender->setCurrentItem( gender.toInt() );
1455 1455
1456 txtNote->setText( ent.notes() ); 1456 txtNote->setText( ent.notes() );
1457 1457
1458 slotCmbChooser1Change( cmbChooserField1->currentItem() ); 1458 slotCmbChooser1Change( cmbChooserField1->currentItem() );
1459 slotCmbChooser2Change( cmbChooserField2->currentItem() ); 1459 slotCmbChooser2Change( cmbChooserField2->currentItem() );
1460 slotCmbChooser3Change( cmbChooserField3->currentItem() ); 1460 slotCmbChooser3Change( cmbChooserField3->currentItem() );
1461 1461
1462 slotAddressTypeChange( cmbAddress->currentItem() ); 1462 slotAddressTypeChange( cmbAddress->currentItem() );
1463 1463
1464 // loadFields(); :SX 1464 // loadFields(); :SX
1465 updateDatePicker(); 1465 updateDatePicker();
1466} 1466}
1467void ContactEditor::updateDatePicker() 1467void ContactEditor::updateDatePicker()
1468{ 1468{
1469 // Set DatePicker 1469 // Set DatePicker
1470 if ( !ent.birthday().isNull() ){ 1470 if ( !ent.birthday().isNull() ){
1471 birthdayButton->setText( TimeString::numberDateString( ent.birthday() ) ); 1471 birthdayButton->setText( TimeString::numberDateString( ent.birthday() ) );
1472 birthdayPicker->setDate( ent.birthday() ); 1472 birthdayPicker->setDate( ent.birthday() );
1473 } else 1473 } else
1474 birthdayButton->setText( tr ("Unknown") ); 1474 birthdayButton->setText( tr ("Unknown") );
1475 1475
1476 if ( !ent.anniversary().isNull() ){ 1476 if ( !ent.anniversary().isNull() ){
1477 anniversaryButton->setText( TimeString::numberDateString( ent.anniversary() ) ); 1477 anniversaryButton->setText( TimeString::numberDateString( ent.anniversary() ) );
1478 anniversaryPicker->setDate( ent.anniversary() ); 1478 anniversaryPicker->setDate( ent.anniversary() );
1479 } else 1479 } else
1480 anniversaryButton->setText( tr ("Unknown") ); 1480 anniversaryButton->setText( tr ("Unknown") );
1481 1481
1482} 1482}
1483 1483
1484void ContactEditor::saveEntry() { 1484void ContactEditor::saveEntry() {
1485 1485
1486
1486 if ( useFullName ) { 1487 if ( useFullName ) {
1487 txtFirstName->setText( parseName( txtFullName->text(), NAME_F ) ); 1488 txtFirstName->setText( parseName( txtFullName->text(), NAME_F ) );
1488 txtMiddleName->setText( parseName( txtFullName->text(), NAME_M ) ); 1489 txtMiddleName->setText( parseName( txtFullName->text(), NAME_M ) );
1489 txtLastName->setText( parseName( txtFullName->text(), NAME_L ) ); 1490 txtLastName->setText( parseName( txtFullName->text(), NAME_L ) );
1490 txtSuffix->setText( parseName( txtFullName->text(), NAME_S ) ); 1491 txtSuffix->setText( parseName( txtFullName->text(), NAME_S ) );
1491 1492
1492 useFullName = false; 1493 useFullName = false;
1493 } 1494 }
1494 1495
1495 ent.setFirstName( txtFirstName->text() ); 1496 ent.setFirstName( txtFirstName->text() );
1496 ent.setLastName( txtLastName->text() ); 1497 ent.setLastName( txtLastName->text() );
1497 ent.setMiddleName( txtMiddleName->text() ); 1498 ent.setMiddleName( txtMiddleName->text() );
1498 ent.setSuffix( txtSuffix->text() ); 1499 ent.setSuffix( txtSuffix->text() );
1499 1500
1500 ent.setFileAs( cmbFileAs->currentText() ); 1501 ent.setFileAs( cmbFileAs->currentText() );
1501 1502
1502 ent.setCategories( cmbCat->currentCategories() ); 1503 ent.setCategories( cmbCat->currentCategories() );
1503 1504
1504 1505
1505 //if (hasTitle) 1506 //if (hasTitle)
1506 ent.setJobTitle( txtJobTitle->text() ); 1507 ent.setJobTitle( txtJobTitle->text() );
1507 1508
1508 //if (hasCompany) 1509 //if (hasCompany)
1509 ent.setCompany( txtOrganization->text() ); 1510 ent.setCompany( txtOrganization->text() );
1510 1511
1511 //if (hasNotes) 1512 //if (hasNotes)
1512 ent.setNotes( txtNote->text() ); 1513 ent.setNotes( txtNote->text() );
1513 1514
1514 //if (hasStreet) { 1515 //if (hasStreet) {
1515 ent.setHomeStreet( slHomeAddress[0] ); 1516 ent.setHomeStreet( slHomeAddress[0] );
1516 ent.setBusinessStreet( slBusinessAddress[0] ); 1517 ent.setBusinessStreet( slBusinessAddress[0] );
1517 //} 1518 //}