From 37084d3961026893840ef9891132bdf193a312b3 Mon Sep 17 00:00:00 2001 From: eilers Date: Sun, 11 May 2003 12:36:30 +0000 Subject: Some improvements in handling of organizations: - If you enter a organization name and no Fullname is entered, the organization name will be used. Thus, the organization is shown correctly in the listview.. - The letterpicker now searches for the SaveAs Entry (configurable) instead for lastname. Ths guarantees that the organization is found as expected.. This addresses bugreport #590 and #895.. --- (limited to 'core/pim/addressbook/contacteditor.cpp') 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 @@ -656,10 +656,12 @@ void ContactEditor::init() { 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 &)), @@ -1057,6 +1059,16 @@ void ContactEditor::slotSuffixChange( const QString& ) { 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() ) { -- cgit v0.9.0.2