summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/contacteditor.cpp
Side-by-side diff
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() {
cmbChooserField1->setCurrentItem( 0 );
cmbChooserField2->setCurrentItem( 1 );
cmbChooserField3->setCurrentItem( 2 );
connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) );
- connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) );
-
- connect( txtSuffix, SIGNAL(textChanged(const QString &)), this, SLOT(slotSuffixChange(const QString &)) );
-
+ connect( txtFullName, SIGNAL(textChanged(const QString &)),
+ this, SLOT(slotFullNameChange(const QString &)) );
+ connect( txtSuffix, SIGNAL(textChanged(const QString &)),
+ this, SLOT(slotSuffixChange(const QString &)) );
+ connect( txtOrganization, SIGNAL(textChanged(const QString &)),
+ this, SLOT(slotOrganizationChange(const QString &)) );
connect( txtChooserField1, SIGNAL(textChanged(const QString &)),
this, SLOT(slotChooser1Change(const QString &)) );
connect( txtChooserField2, SIGNAL(textChanged(const QString &)),
this, SLOT(slotChooser2Change(const QString &)) );
connect( txtChooserField3, SIGNAL(textChanged(const QString &)),
this, SLOT(slotChooser3Change(const QString &)) );
@@ -1054,12 +1056,22 @@ void ContactEditor::slotFullNameChange( const QString &textChanged ) {
void ContactEditor::slotSuffixChange( const QString& ) {
// Just want to update the FileAs combo if the suffix was changed..
slotFullNameChange( txtFullName->text() );
}
+void ContactEditor::slotOrganizationChange( const QString &textChanged ){
+ qWarning( "ContactEditor::slotOrganizationChange( %s )", textChanged.latin1() );
+ // Special handling for storing Companies:
+ // If no Fullname is given, we store the Company-Name as lastname
+ // to handle it like a person..
+ if ( txtFullName->text() == txtOrganization->text().left( txtFullName->text().length() ) )
+ txtFullName->setText( textChanged );
+
+}
+
void ContactEditor::accept() {
if ( isEmpty() ) {
cleanupFields();
reject();
} else {