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.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index f33ee0a..ce14f98 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -653,16 +653,18 @@ void ContactEditor::init() {
653 cmbChooserField1->setCurrentItem( 0 ); 653 cmbChooserField1->setCurrentItem( 0 );
654 cmbChooserField2->setCurrentItem( 1 ); 654 cmbChooserField2->setCurrentItem( 1 );
655 cmbChooserField3->setCurrentItem( 2 ); 655 cmbChooserField3->setCurrentItem( 2 );
656 656
657 connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); 657 connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) );
658 658
659 connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); 659 connect( txtFullName, SIGNAL(textChanged(const QString &)),
660 660 this, SLOT(slotFullNameChange(const QString &)) );
661 connect( txtSuffix, SIGNAL(textChanged(const QString &)), this, SLOT(slotSuffixChange(const QString &)) ); 661 connect( txtSuffix, SIGNAL(textChanged(const QString &)),
662 662 this, SLOT(slotSuffixChange(const QString &)) );
663 connect( txtOrganization, SIGNAL(textChanged(const QString &)),
664 this, SLOT(slotOrganizationChange(const QString &)) );
663 connect( txtChooserField1, SIGNAL(textChanged(const QString &)), 665 connect( txtChooserField1, SIGNAL(textChanged(const QString &)),
664 this, SLOT(slotChooser1Change(const QString &)) ); 666 this, SLOT(slotChooser1Change(const QString &)) );
665 connect( txtChooserField2, SIGNAL(textChanged(const QString &)), 667 connect( txtChooserField2, SIGNAL(textChanged(const QString &)),
666 this, SLOT(slotChooser2Change(const QString &)) ); 668 this, SLOT(slotChooser2Change(const QString &)) );
667 connect( txtChooserField3, SIGNAL(textChanged(const QString &)), 669 connect( txtChooserField3, SIGNAL(textChanged(const QString &)),
668 this, SLOT(slotChooser3Change(const QString &)) ); 670 this, SLOT(slotChooser3Change(const QString &)) );
@@ -1054,12 +1056,22 @@ void ContactEditor::slotFullNameChange( const QString &textChanged ) {
1054 1056
1055void ContactEditor::slotSuffixChange( const QString& ) { 1057void ContactEditor::slotSuffixChange( const QString& ) {
1056 // Just want to update the FileAs combo if the suffix was changed.. 1058 // Just want to update the FileAs combo if the suffix was changed..
1057 slotFullNameChange( txtFullName->text() ); 1059 slotFullNameChange( txtFullName->text() );
1058} 1060}
1059 1061
1062void ContactEditor::slotOrganizationChange( const QString &textChanged ){
1063 qWarning( "ContactEditor::slotOrganizationChange( %s )", textChanged.latin1() );
1064 // Special handling for storing Companies:
1065 // If no Fullname is given, we store the Company-Name as lastname
1066 // to handle it like a person..
1067 if ( txtFullName->text() == txtOrganization->text().left( txtFullName->text().length() ) )
1068 txtFullName->setText( textChanged );
1069
1070}
1071
1060void ContactEditor::accept() { 1072void ContactEditor::accept() {
1061 1073
1062 if ( isEmpty() ) { 1074 if ( isEmpty() ) {
1063 cleanupFields(); 1075 cleanupFields();
1064 reject(); 1076 reject();
1065 } else { 1077 } else {