Diffstat (limited to 'core/pim/addressbook/contacteditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 82 |
1 files changed, 43 insertions, 39 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 534666d..e496387 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -18,12 +18,13 @@ | |||
18 | * is made to operate exactly in interface with the exception of name. | 18 | * is made to operate exactly in interface with the exception of name. |
19 | * | 19 | * |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include "contacteditor.h" | 22 | #include "contacteditor.h" |
23 | 23 | ||
24 | #include <opie2/odebug.h> | ||
24 | #include <opie2/opimcontact.h> | 25 | #include <opie2/opimcontact.h> |
25 | 26 | ||
26 | #include <qpe/categoryselect.h> | 27 | #include <qpe/categoryselect.h> |
27 | #include <qpe/qpeapplication.h> | 28 | #include <qpe/qpeapplication.h> |
28 | #include <qpe/qpedialog.h> | 29 | #include <qpe/qpedialog.h> |
29 | #include <qpe/resource.h> | 30 | #include <qpe/resource.h> |
@@ -74,13 +75,13 @@ ContactEditor::ContactEditor( const Opie::OPimContact &entry, | |||
74 | } | 75 | } |
75 | 76 | ||
76 | ContactEditor::~ContactEditor() { | 77 | ContactEditor::~ContactEditor() { |
77 | } | 78 | } |
78 | 79 | ||
79 | void ContactEditor::init() { | 80 | void ContactEditor::init() { |
80 | qWarning("init() START"); | 81 | Opie::Core::owarn << "init() START" << oendl; |
81 | 82 | ||
82 | uint i = 0; | 83 | uint i = 0; |
83 | 84 | ||
84 | QStringList trlChooserNames; | 85 | QStringList trlChooserNames; |
85 | 86 | ||
86 | for (i = 0; i <= 6; i++) { | 87 | for (i = 0; i <= 6; i++) { |
@@ -683,24 +684,24 @@ void ContactEditor::init() { | |||
683 | this, SLOT(slotAddressTypeChange(int)) ); | 684 | this, SLOT(slotAddressTypeChange(int)) ); |
684 | 685 | ||
685 | new QPEDialogListener(this); | 686 | new QPEDialogListener(this); |
686 | 687 | ||
687 | setPersonalView ( m_personalView ); | 688 | setPersonalView ( m_personalView ); |
688 | 689 | ||
689 | qWarning("init() END"); | 690 | Opie::Core::owarn << "init() END" << oendl; |
690 | } | 691 | } |
691 | 692 | ||
692 | void ContactEditor::defaultEmailChanged(int i){ | 693 | void ContactEditor::defaultEmailChanged(int i){ |
693 | qDebug("defaultEmailChanged"); | 694 | Opie::Core::odebug << "defaultEmailChanged" << oendl; |
694 | 695 | ||
695 | // was sollte das ? (se) | 696 | // was sollte das ? (se) |
696 | // int index = cmbChooserField1->currentItem(); | 697 | // int index = cmbChooserField1->currentItem(); |
697 | // slChooserValues[index] = cmbDefaultEmail->text(i); | 698 | // slChooserValues[index] = cmbDefaultEmail->text(i); |
698 | 699 | ||
699 | defaultEmail = cmbDefaultEmail->text(i); | 700 | defaultEmail = cmbDefaultEmail->text(i); |
700 | qDebug ("Changed to: %s", defaultEmail.latin1()); | 701 | Opie::Core::odebug << "Changed to: " << defaultEmail << oendl; |
701 | 702 | ||
702 | } | 703 | } |
703 | 704 | ||
704 | void ContactEditor::populateDefaultEmailCmb(){ | 705 | void ContactEditor::populateDefaultEmailCmb(){ |
705 | 706 | ||
706 | // if the default-email combo was not selected and therfore not created | 707 | // if the default-email combo was not selected and therfore not created |
@@ -713,18 +714,18 @@ void ContactEditor::populateDefaultEmailCmb(){ | |||
713 | cmbDefaultEmail->insertStringList( emails ); | 714 | cmbDefaultEmail->insertStringList( emails ); |
714 | // cmbDefaultEmail->show(); | 715 | // cmbDefaultEmail->show(); |
715 | 716 | ||
716 | // Select default email in combo.. | 717 | // Select default email in combo.. |
717 | bool found = false; | 718 | bool found = false; |
718 | for ( int i = 0; i < cmbDefaultEmail->count(); i++){ | 719 | for ( int i = 0; i < cmbDefaultEmail->count(); i++){ |
719 | qDebug(" populateDefaultEmailCmb text >%s< defaultEmail >%s<", | 720 | Opie::Core::odebug << " populateDefaultEmailCmb text >" << cmbDefaultEmail->text( i ) |
720 | cmbDefaultEmail->text( i ).latin1(), defaultEmail.latin1()); | 721 | << "< defaultEmail >" << defaultEmail << "<" << oendl; |
721 | 722 | ||
722 | if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){ | 723 | if ( cmbDefaultEmail->text( i ).stripWhiteSpace() == defaultEmail.stripWhiteSpace() ){ |
723 | cmbDefaultEmail->setCurrentItem( i ); | 724 | cmbDefaultEmail->setCurrentItem( i ); |
724 | qDebug("set"); | 725 | Opie::Core::odebug << "set" << oendl; |
725 | found = true; | 726 | found = true; |
726 | } | 727 | } |
727 | } | 728 | } |
728 | 729 | ||
729 | // If the current default email is not found in the list, we choose the | 730 | // If the current default email is not found in the list, we choose the |
730 | // first one.. | 731 | // first one.. |
@@ -734,20 +735,22 @@ void ContactEditor::populateDefaultEmailCmb(){ | |||
734 | 735 | ||
735 | // Called when any combobox was changed. | 736 | // Called when any combobox was changed. |
736 | // "true" returned if the change was chandled by this function, else it should | 737 | // "true" returned if the change was chandled by this function, else it should |
737 | // be handled by something else.. | 738 | // be handled by something else.. |
738 | bool ContactEditor::cmbChooserChange( int index, QWidgetStack* inputStack, int widgetPos ) { | 739 | bool ContactEditor::cmbChooserChange( int index, QWidgetStack* inputStack, int widgetPos ) { |
739 | QString type = slChooserNames[index]; | 740 | QString type = slChooserNames[index]; |
740 | qWarning("ContactEditor::cmbChooserChange -> Type: %s, WidgetPos: %d", type.latin1(), widgetPos ); | 741 | Opie::Core::owarn << "ContactEditor::cmbChooserChange -> Type: " << type |
742 | << ", WidgetPos: " << widgetPos << oendl; | ||
741 | 743 | ||
742 | if ( !initializing ) | 744 | if ( !initializing ) |
743 | contactfields.setFieldOrder( widgetPos-1, index ); | 745 | contactfields.setFieldOrder( widgetPos-1, index ); |
744 | 746 | ||
745 | // Create and connect combobox for selecting the default email | 747 | // Create and connect combobox for selecting the default email |
746 | if ( type == "Default Email"){ | 748 | if ( type == "Default Email"){ |
747 | qWarning("Choosing default-email (defaultEmailChooserPosition= %d) ", defaultEmailChooserPosition); | 749 | Opie::Core::owarn << "Choosing default-email (defaultEmailChooserPosition= " |
750 | << defaultEmailChooserPosition << ") " << oendl; | ||
748 | 751 | ||
749 | // More than one default-email chooser is not allowed ! | 752 | // More than one default-email chooser is not allowed ! |
750 | if ( ( defaultEmailChooserPosition != -1 ) && | 753 | if ( ( defaultEmailChooserPosition != -1 ) && |
751 | defaultEmailChooserPosition != widgetPos && !initializing){ | 754 | defaultEmailChooserPosition != widgetPos && !initializing){ |
752 | chooserError( widgetPos ); | 755 | chooserError( widgetPos ); |
753 | return true; | 756 | return true; |
@@ -774,13 +777,13 @@ bool ContactEditor::cmbChooserChange( int index, QWidgetStack* inputStack, int w | |||
774 | // Set current default email | 777 | // Set current default email |
775 | populateDefaultEmailCmb(); | 778 | populateDefaultEmailCmb(); |
776 | 779 | ||
777 | 780 | ||
778 | } else { | 781 | } else { |
779 | // Something else was selected: Hide combo.. | 782 | // Something else was selected: Hide combo.. |
780 | qWarning(" Hiding default-email combo" ); | 783 | Opie::Core::owarn << " Hiding default-email combo" << oendl; |
781 | if ( defaultEmailChooserPosition == widgetPos ){ | 784 | if ( defaultEmailChooserPosition == widgetPos ){ |
782 | defaultEmailChooserPosition = -1; | 785 | defaultEmailChooserPosition = -1; |
783 | } | 786 | } |
784 | QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo ); | 787 | QComboBox* cmbo = ( QComboBox* ) inputStack -> widget( Combo ); |
785 | if ( cmbo ){ | 788 | if ( cmbo ){ |
786 | inputStack->raiseWidget( TextField ); | 789 | inputStack->raiseWidget( TextField ); |
@@ -799,13 +802,13 @@ bool ContactEditor::cmbChooserChange( int index, QWidgetStack* inputStack, int w | |||
799 | 802 | ||
800 | } | 803 | } |
801 | 804 | ||
802 | // Currently accessed when we select default-email more than once ! | 805 | // Currently accessed when we select default-email more than once ! |
803 | void ContactEditor::chooserError( int index ) | 806 | void ContactEditor::chooserError( int index ) |
804 | { | 807 | { |
805 | qWarning("ContactEditor::chooserError( %d )", index); | 808 | Opie::Core::owarn << "ContactEditor::chooserError( " << index << " )" << oendl; |
806 | QMessageBox::warning( this, "Chooser Error", | 809 | QMessageBox::warning( this, "Chooser Error", |
807 | "Multiple selection of this\n" | 810 | "Multiple selection of this\n" |
808 | "Item is not allowed !\n\n" | 811 | "Item is not allowed !\n\n" |
809 | "First deselect the previous one !", | 812 | "First deselect the previous one !", |
810 | "&OK", 0, 0, | 813 | "&OK", 0, 0, |
811 | 0, 0 ); | 814 | 0, 0 ); |
@@ -835,52 +838,53 @@ void ContactEditor::chooserError( int index ) | |||
835 | 838 | ||
836 | // Called when something was changed in a textfield (shouldn't it called textchanged? (se)) | 839 | // Called when something was changed in a textfield (shouldn't it called textchanged? (se)) |
837 | void ContactEditor::chooserChange( const QString &textChanged, int index, | 840 | void ContactEditor::chooserChange( const QString &textChanged, int index, |
838 | QLineEdit* , int widgetPos ) { | 841 | QLineEdit* , int widgetPos ) { |
839 | 842 | ||
840 | QString type = slChooserNames[index]; // :SX | 843 | QString type = slChooserNames[index]; // :SX |
841 | qDebug("ContactEditor::chooserChange( type=>%s<, textChanged=>%s< index=%i, widgetPos=%i", | 844 | Opie::Core::odebug << "ContactEditor::chooserChange( type=>" << type << "<, textChanged=>" |
842 | type.latin1(),textChanged.latin1(), index, widgetPos ); | 845 | << textChanged << "< index=" << index << ", widgetPos=" << widgetPos |
846 | << " )" << oendl; | ||
843 | 847 | ||
844 | if ( type == "Default Email"){ | 848 | if ( type == "Default Email"){ |
845 | qWarning ("??? Wozu??: %s", textChanged.latin1()); | 849 | Opie::Core::owarn << "??? Wozu??: " << textChanged << oendl; |
846 | defaultEmail = textChanged; | 850 | defaultEmail = textChanged; |
847 | 851 | ||
848 | populateDefaultEmailCmb(); | 852 | populateDefaultEmailCmb(); |
849 | 853 | ||
850 | }else if (type == "Emails"){ | 854 | }else if (type == "Emails"){ |
851 | qDebug("emails"); | 855 | Opie::Core::odebug << "emails" << oendl; |
852 | 856 | ||
853 | QString de; | 857 | QString de; |
854 | emails = QStringList::split (",", textChanged ); | 858 | emails = QStringList::split (",", textChanged ); |
855 | 859 | ||
856 | populateDefaultEmailCmb(); | 860 | populateDefaultEmailCmb(); |
857 | } | 861 | } |
858 | 862 | ||
859 | slChooserValues[index] = textChanged; | 863 | slChooserValues[index] = textChanged; |
860 | 864 | ||
861 | } | 865 | } |
862 | 866 | ||
863 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { | 867 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { |
864 | qWarning("ContactEditor::slotChooser1Change( %s )", textChanged.latin1()); | 868 | Opie::Core::owarn << "ContactEditor::slotChooser1Change( " << textChanged << " )" << oendl; |
865 | chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1); | 869 | chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1); |
866 | } | 870 | } |
867 | 871 | ||
868 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { | 872 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { |
869 | qWarning("ContactEditor::slotChooser2Change( %s )", textChanged.latin1()); | 873 | Opie::Core::owarn << "ContactEditor::slotChooser2Change( " << textChanged << " )" << oendl; |
870 | chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2); | 874 | chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2); |
871 | 875 | ||
872 | } | 876 | } |
873 | 877 | ||
874 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { | 878 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { |
875 | qWarning("ContactEditor::slotChooser3Change( %s )", textChanged.latin1()); | 879 | Opie::Core::owarn << "ContactEditor::slotChooser3Change( " << textChanged << " )" << oendl; |
876 | chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3); | 880 | chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3); |
877 | } | 881 | } |
878 | 882 | ||
879 | void ContactEditor::slotChooser4Change( const QString &textChanged ) { | 883 | void ContactEditor::slotChooser4Change( const QString &textChanged ) { |
880 | qWarning("ContactEditor::slotChooser4Change( %s )", textChanged.latin1()); | 884 | Opie::Core::owarn << "ContactEditor::slotChooser4Change( " << textChanged << " )" << oendl; |
881 | chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4); | 885 | chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4); |
882 | } | 886 | } |
883 | 887 | ||
884 | void ContactEditor::slotAddressChange( const QString &textChanged ) { | 888 | void ContactEditor::slotAddressChange( const QString &textChanged ) { |
885 | 889 | ||
886 | if ( cmbAddress->currentItem() == 0 ) { | 890 | if ( cmbAddress->currentItem() == 0 ) { |
@@ -944,46 +948,46 @@ void ContactEditor::slotCountryChange( const QString &textChanged ) { | |||
944 | slHomeAddress[6] = textChanged; | 948 | slHomeAddress[6] = textChanged; |
945 | } | 949 | } |
946 | } | 950 | } |
947 | 951 | ||
948 | 952 | ||
949 | void ContactEditor::slotCmbChooser1Change( int index ) { | 953 | void ContactEditor::slotCmbChooser1Change( int index ) { |
950 | qWarning("ContactEditor::slotCmbChooser1Change( %d )", index); | 954 | Opie::Core::owarn << "ContactEditor::slotCmbChooser1Change( " << index << " )" << oendl; |
951 | if ( !cmbChooserChange( cmbChooserField1->currentItem(), m_widgetStack1, 1) ){ | 955 | if ( !cmbChooserChange( cmbChooserField1->currentItem(), m_widgetStack1, 1) ){ |
952 | 956 | ||
953 | txtChooserField1->setText( slChooserValues[index] ); | 957 | txtChooserField1->setText( slChooserValues[index] ); |
954 | txtChooserField1->setFocus(); | 958 | txtChooserField1->setFocus(); |
955 | 959 | ||
956 | } | 960 | } |
957 | 961 | ||
958 | } | 962 | } |
959 | 963 | ||
960 | void ContactEditor::slotCmbChooser2Change( int index ) { | 964 | void ContactEditor::slotCmbChooser2Change( int index ) { |
961 | qWarning("ContactEditor::slotCmbChooser2Change( %d )", index); | 965 | Opie::Core::owarn << "ContactEditor::slotCmbChooser2Change( " << index << " )" << oendl; |
962 | 966 | ||
963 | if ( !cmbChooserChange( cmbChooserField2->currentItem(), m_widgetStack2, 2) ){ | 967 | if ( !cmbChooserChange( cmbChooserField2->currentItem(), m_widgetStack2, 2) ){ |
964 | 968 | ||
965 | txtChooserField2->setText( slChooserValues[index] ); | 969 | txtChooserField2->setText( slChooserValues[index] ); |
966 | txtChooserField2->setFocus(); | 970 | txtChooserField2->setFocus(); |
967 | 971 | ||
968 | } | 972 | } |
969 | } | 973 | } |
970 | 974 | ||
971 | void ContactEditor::slotCmbChooser3Change( int index ) { | 975 | void ContactEditor::slotCmbChooser3Change( int index ) { |
972 | qWarning("ContactEditor::slotCmbChooser3Change( %d )", index); | 976 | Opie::Core::owarn << "ContactEditor::slotCmbChooser3Change( " << index << " )" << oendl; |
973 | 977 | ||
974 | if ( !cmbChooserChange( cmbChooserField3->currentItem(), m_widgetStack3, 3) ){ | 978 | if ( !cmbChooserChange( cmbChooserField3->currentItem(), m_widgetStack3, 3) ){ |
975 | 979 | ||
976 | txtChooserField3->setText( slChooserValues[index] ); | 980 | txtChooserField3->setText( slChooserValues[index] ); |
977 | txtChooserField3->setFocus(); | 981 | txtChooserField3->setFocus(); |
978 | 982 | ||
979 | } | 983 | } |
980 | } | 984 | } |
981 | 985 | ||
982 | void ContactEditor::slotCmbChooser4Change( int index ) { | 986 | void ContactEditor::slotCmbChooser4Change( int index ) { |
983 | qWarning("ContactEditor::slotCmbChooser4Change( %d )", index); | 987 | Opie::Core::owarn << "ContactEditor::slotCmbChooser4Change( " << index << " )" << oendl; |
984 | 988 | ||
985 | if ( !cmbChooserChange( cmbChooserField4->currentItem(), m_widgetStack4, 4) ){ | 989 | if ( !cmbChooserChange( cmbChooserField4->currentItem(), m_widgetStack4, 4) ){ |
986 | 990 | ||
987 | txtChooserField4->setText( slChooserValues[index] ); | 991 | txtChooserField4->setText( slChooserValues[index] ); |
988 | txtChooserField4->setFocus(); | 992 | txtChooserField4->setFocus(); |
989 | 993 | ||
@@ -1022,13 +1026,13 @@ void ContactEditor::slotAddressTypeChange( int index ) { | |||
1022 | } | 1026 | } |
1023 | 1027 | ||
1024 | } | 1028 | } |
1025 | 1029 | ||
1026 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { | 1030 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { |
1027 | 1031 | ||
1028 | qWarning( "ContactEditor::slotFullNameChange( %s )", textChanged.latin1() ); | 1032 | Opie::Core::owarn << "ContactEditor::slotFullNameChange( " << textChanged << " )" << oendl; |
1029 | 1033 | ||
1030 | int index = cmbFileAs->currentItem(); | 1034 | int index = cmbFileAs->currentItem(); |
1031 | 1035 | ||
1032 | cmbFileAs->clear(); | 1036 | cmbFileAs->clear(); |
1033 | 1037 | ||
1034 | cmbFileAs->insertItem( parseName( textChanged, NAME_LF ) ); | 1038 | cmbFileAs->insertItem( parseName( textChanged, NAME_LF ) ); |
@@ -1046,13 +1050,13 @@ void ContactEditor::slotFullNameChange( const QString &textChanged ) { | |||
1046 | void ContactEditor::slotSuffixChange( const QString& ) { | 1050 | void ContactEditor::slotSuffixChange( const QString& ) { |
1047 | // Just want to update the FileAs combo if the suffix was changed.. | 1051 | // Just want to update the FileAs combo if the suffix was changed.. |
1048 | slotFullNameChange( txtFullName->text() ); | 1052 | slotFullNameChange( txtFullName->text() ); |
1049 | } | 1053 | } |
1050 | 1054 | ||
1051 | void ContactEditor::slotOrganizationChange( const QString &textChanged ){ | 1055 | void ContactEditor::slotOrganizationChange( const QString &textChanged ){ |
1052 | qWarning( "ContactEditor::slotOrganizationChange( %s )", textChanged.latin1() ); | 1056 | Opie::Core::owarn << "ContactEditor::slotOrganizationChange( " << textChanged << " )" << oendl; |
1053 | // Special handling for storing Companies: | 1057 | // Special handling for storing Companies: |
1054 | // If no Fullname is given, we store the Company-Name as lastname | 1058 | // If no Fullname is given, we store the Company-Name as lastname |
1055 | // to handle it like a person.. | 1059 | // to handle it like a person.. |
1056 | if ( txtFullName->text() == txtOrganization->text().left( txtFullName->text().length() ) ) | 1060 | if ( txtFullName->text() == txtOrganization->text().left( txtFullName->text().length() ) ) |
1057 | txtFullName->setText( textChanged ); | 1061 | txtFullName->setText( textChanged ); |
1058 | 1062 | ||
@@ -1128,26 +1132,26 @@ QString ContactEditor::parseName( const QString fullName, int type ) { | |||
1128 | QString strMiddleName; | 1132 | QString strMiddleName; |
1129 | QString strLastName; | 1133 | QString strLastName; |
1130 | QString strTitle; | 1134 | QString strTitle; |
1131 | int commapos; | 1135 | int commapos; |
1132 | bool haveLastName = false; | 1136 | bool haveLastName = false; |
1133 | 1137 | ||
1134 | qWarning("Fullname: %s", simplifiedName.latin1()); | 1138 | Opie::Core::owarn << "Fullname: " << simplifiedName << oendl; |
1135 | 1139 | ||
1136 | commapos = simplifiedName.find( ',', 0, TRUE); | 1140 | commapos = simplifiedName.find( ',', 0, TRUE); |
1137 | if ( commapos >= 0 ) { | 1141 | if ( commapos >= 0 ) { |
1138 | qWarning(" Commapos: %d", commapos ); | 1142 | Opie::Core::owarn << " Commapos: " << commapos << oendl; |
1139 | 1143 | ||
1140 | // A comma (",") separates the lastname from one or | 1144 | // A comma (",") separates the lastname from one or |
1141 | // many first names. Thus, remove the lastname from the | 1145 | // many first names. Thus, remove the lastname from the |
1142 | // String and parse the firstnames. | 1146 | // String and parse the firstnames. |
1143 | 1147 | ||
1144 | strLastName = simplifiedName.left( commapos ); | 1148 | strLastName = simplifiedName.left( commapos ); |
1145 | simplifiedName= simplifiedName.mid( commapos + 1 ); | 1149 | simplifiedName= simplifiedName.mid( commapos + 1 ); |
1146 | haveLastName = true; | 1150 | haveLastName = true; |
1147 | qWarning("Fullname without ',': %s", simplifiedName.latin1()); | 1151 | Opie::Core::owarn << "Fullname without ',': " << simplifiedName << oendl; |
1148 | 1152 | ||
1149 | // If we have any lastname, we should now split all first names. | 1153 | // If we have any lastname, we should now split all first names. |
1150 | // The first one will be the used as first, the rest as "middle names" | 1154 | // The first one will be the used as first, the rest as "middle names" |
1151 | 1155 | ||
1152 | QStringList allFirstNames = QStringList::split(" ", simplifiedName); | 1156 | QStringList allFirstNames = QStringList::split(" ", simplifiedName); |
1153 | QStringList::Iterator it = allFirstNames.begin(); | 1157 | QStringList::Iterator it = allFirstNames.begin(); |
@@ -1175,16 +1179,16 @@ QString ContactEditor::parseName( const QString fullName, int type ) { | |||
1175 | 1179 | ||
1176 | } | 1180 | } |
1177 | 1181 | ||
1178 | if ( strFirstName == strLastName ) | 1182 | if ( strFirstName == strLastName ) |
1179 | strFirstName = ""; | 1183 | strFirstName = ""; |
1180 | 1184 | ||
1181 | qWarning(" strFirstName: %s", strFirstName.latin1()); | 1185 | Opie::Core::owarn << "strFirstName: " << strFirstName << oendl; |
1182 | qWarning(" strMiddleName: %s", strMiddleName.latin1()); | 1186 | Opie::Core::owarn << "strMiddletName: " << strMiddleName << oendl; |
1183 | qWarning(" strLastName: %s", strLastName.latin1()); | 1187 | Opie::Core::owarn << "strLastName: " << strLastName << oendl; |
1184 | qWarning(" strTitle: %s", strTitle.latin1()); | 1188 | Opie::Core::owarn << "strTitle: " << strTitle << oendl; |
1185 | 1189 | ||
1186 | switch (type) { | 1190 | switch (type) { |
1187 | case NAME_FL: | 1191 | case NAME_FL: |
1188 | return strFirstName + " " + strLastName; | 1192 | return strFirstName + " " + strLastName; |
1189 | 1193 | ||
1190 | case NAME_LF: | 1194 | case NAME_LF: |
@@ -1261,13 +1265,13 @@ void ContactEditor::setEntry( const Opie::OPimContact &entry ) { | |||
1261 | 1265 | ||
1262 | ent = entry; | 1266 | ent = entry; |
1263 | 1267 | ||
1264 | emails = QStringList(ent.emailList()); | 1268 | emails = QStringList(ent.emailList()); |
1265 | defaultEmail = ent.defaultEmail(); | 1269 | defaultEmail = ent.defaultEmail(); |
1266 | if (defaultEmail.isEmpty()) defaultEmail = emails[0]; | 1270 | if (defaultEmail.isEmpty()) defaultEmail = emails[0]; |
1267 | qDebug("default email=%s",defaultEmail.latin1()); | 1271 | Opie::Core::odebug << "default email=" << defaultEmail << oendl; |
1268 | 1272 | ||
1269 | txtFirstName->setText( ent.firstName() ); | 1273 | txtFirstName->setText( ent.firstName() ); |
1270 | txtMiddleName->setText( ent.middleName() ); | 1274 | txtMiddleName->setText( ent.middleName() ); |
1271 | txtLastName->setText( ent.lastName() ); | 1275 | txtLastName->setText( ent.lastName() ); |
1272 | txtSuffix->setText( ent.suffix() ); | 1276 | txtSuffix->setText( ent.suffix() ); |
1273 | 1277 | ||
@@ -1321,13 +1325,13 @@ void ContactEditor::setEntry( const Opie::OPimContact &entry ) { | |||
1321 | //} | 1325 | //} |
1322 | 1326 | ||
1323 | QStringList::ConstIterator it; | 1327 | QStringList::ConstIterator it; |
1324 | QListIterator<QLineEdit> itLE( listValue ); | 1328 | QListIterator<QLineEdit> itLE( listValue ); |
1325 | for ( it = slDynamicEntries.begin(); itLE.current()/* != slDynamicEntries.end()*/; ++it, ++itLE) { | 1329 | for ( it = slDynamicEntries.begin(); itLE.current()/* != slDynamicEntries.end()*/; ++it, ++itLE) { |
1326 | 1330 | ||
1327 | qWarning(" Filling dynamic Field: %s", (*it).latin1() ); | 1331 | Opie::Core::owarn << " Filling dynamic Field: " << (*it) << oendl; |
1328 | 1332 | ||
1329 | if ( *it == "Department" ) | 1333 | if ( *it == "Department" ) |
1330 | (*itLE)->setText( ent.department() ); | 1334 | (*itLE)->setText( ent.department() ); |
1331 | 1335 | ||
1332 | if ( *it == "Company" ) | 1336 | if ( *it == "Company" ) |
1333 | (*itLE)->setText( ent.company() ); | 1337 | (*itLE)->setText( ent.company() ); |
@@ -1345,13 +1349,13 @@ void ContactEditor::setEntry( const Opie::OPimContact &entry ) { | |||
1345 | (*itLE)->setText( ent.manager() ); | 1349 | (*itLE)->setText( ent.manager() ); |
1346 | 1350 | ||
1347 | if ( *it == "Spouse" ) | 1351 | if ( *it == "Spouse" ) |
1348 | (*itLE)->setText( ent.spouse() ); | 1352 | (*itLE)->setText( ent.spouse() ); |
1349 | 1353 | ||
1350 | if ( *it == "Nickname" ){ | 1354 | if ( *it == "Nickname" ){ |
1351 | qWarning("**** Nichname: %s", ent.nickname().latin1() ); | 1355 | Opie::Core::owarn << "**** Nichname: " << ent.nickname() << oendl; |
1352 | (*itLE)->setText( ent.nickname() ); | 1356 | (*itLE)->setText( ent.nickname() ); |
1353 | } | 1357 | } |
1354 | 1358 | ||
1355 | if ( *it == "Children" ) | 1359 | if ( *it == "Children" ) |
1356 | (*itLE)->setText( ent.children() ); | 1360 | (*itLE)->setText( ent.children() ); |
1357 | 1361 | ||
@@ -1578,14 +1582,14 @@ void ContactEditor::saveEntry() { | |||
1578 | 1582 | ||
1579 | if ( *it == "Emails" ){ | 1583 | if ( *it == "Emails" ){ |
1580 | QString allemail; | 1584 | QString allemail; |
1581 | QString defaultmail; | 1585 | QString defaultmail; |
1582 | parseEmailFrom( emails.join(","), defaultmail, allemail ); | 1586 | parseEmailFrom( emails.join(","), defaultmail, allemail ); |
1583 | if ( defaultEmail.isEmpty() ){ | 1587 | if ( defaultEmail.isEmpty() ){ |
1584 | qWarning("Default email was not set by user!"); | 1588 | Opie::Core::owarn << "Default email was not set by user!" << oendl; |
1585 | qWarning("Using first email in list: %s", defaultmail.latin1()); | 1589 | Opie::Core::owarn << "Using first email in list: " << defaultmail << oendl; |
1586 | ent.setDefaultEmail( defaultmail ); | 1590 | ent.setDefaultEmail( defaultmail ); |
1587 | } | 1591 | } |
1588 | ent.setEmails( allemail ); | 1592 | ent.setEmails( allemail ); |
1589 | } | 1593 | } |
1590 | 1594 | ||
1591 | if ( *it == "Default Email") | 1595 | if ( *it == "Default Email") |
@@ -1731,17 +1735,17 @@ void ContactEditor::slotBirthdayDateChanged( int year, int month, int day) | |||
1731 | birthdayButton->setText( dateString ); | 1735 | birthdayButton->setText( dateString ); |
1732 | ent.setBirthday ( date ); | 1736 | ent.setBirthday ( date ); |
1733 | } | 1737 | } |
1734 | 1738 | ||
1735 | void ContactEditor::slotRemoveBirthday() | 1739 | void ContactEditor::slotRemoveBirthday() |
1736 | { | 1740 | { |
1737 | qWarning("void ContactEditor::slotRemoveBirthday()"); | 1741 | Opie::Core::owarn << "void ContactEditor::slotRemoveBirthday()" << oendl; |
1738 | ent.setBirthday( QDate() ); | 1742 | ent.setBirthday( QDate() ); |
1739 | updateDatePicker(); | 1743 | updateDatePicker(); |
1740 | } | 1744 | } |
1741 | 1745 | ||
1742 | void ContactEditor::slotRemoveAnniversary() | 1746 | void ContactEditor::slotRemoveAnniversary() |
1743 | { | 1747 | { |
1744 | qWarning("void ContactEditor::slotRemoveAnniversary()"); | 1748 | Opie::Core::owarn << "void ContactEditor::slotRemoveAnniversary()" << oendl; |
1745 | ent.setAnniversary( QDate() ); | 1749 | ent.setAnniversary( QDate() ); |
1746 | updateDatePicker(); | 1750 | updateDatePicker(); |
1747 | } | 1751 | } |