summaryrefslogtreecommitdiffabout
path: root/kaddressbook/addresseeeditorwidget.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/addresseeeditorwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/addresseeeditorwidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kaddressbook/addresseeeditorwidget.cpp b/kaddressbook/addresseeeditorwidget.cpp
index 9814cd5..966efa5 100644
--- a/kaddressbook/addresseeeditorwidget.cpp
+++ b/kaddressbook/addresseeeditorwidget.cpp
@@ -1143,97 +1143,97 @@ void AddresseeEditorWidget::save()
mAddressee.insertCustom( "KADDRESSBOOK", "X-SpousesName", mSpouseEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-Children", mChildEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-ManagersName", mManagerEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-AssistantsName", mAssistantEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-Department", mDepartmentEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-Office", mOfficeEdit->text() );
mAddressee.insertCustom( "KADDRESSBOOK", "X-Profession", mProfessionEdit->text() );
if ( mAnniversaryPicker->inputIsValid() ) {
QString dt = KGlobal::locale()->formatDate(mAnniversaryPicker->date(), true, KLocale::ISODate);
mAddressee.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt);
}
else {
mAddressee.removeCustom( "KADDRESSBOOK", "X-Anniversary" );
mAnniversaryPicker->clear();
}
int gen = mGenderBox->currentItem ();
if ( gen == 1 )
mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "female");
else if ( gen == 2 )
mAddressee.insertCustom( "KADDRESSBOOK", "X-Gender", "male");
else
mAddressee.removeCustom( "KADDRESSBOOK", "X-Gender" );
// Save the email addresses
QStringList emails = mAddressee.emails();
QStringList::Iterator iter;
for ( iter = emails.begin(); iter != emails.end(); ++iter )
mAddressee.removeEmail( *iter );
emails = mEmailWidget->emails();
bool first = true;
for ( iter = emails.begin(); iter != emails.end(); ++iter ) {
mAddressee.insertEmail( *iter, first );
first = false;
}
// Save the phone numbers
KABC::PhoneNumber::List phoneNumbers;
KABC::PhoneNumber::List::Iterator phoneIter;
phoneNumbers = mAddressee.phoneNumbers();
for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end();
++phoneIter )
mAddressee.removePhoneNumber( *phoneIter );
phoneNumbers = mPhoneEditWidget->phoneNumbers();
for ( phoneIter = phoneNumbers.begin(); phoneIter != phoneNumbers.end();
++phoneIter )
mAddressee.insertPhoneNumber( *phoneIter );
-
+ mAddressee.makePhoneNumbersOLcompatible();
// Save the addresses
KABC::Address::List addresses;
KABC::Address::List::Iterator addressIter;
addresses = mAddressee.addresses();
for ( addressIter = addresses.begin(); addressIter != addresses.end();
++addressIter )
mAddressee.removeAddress( *addressIter );
addresses = mAddressEditWidget->addresses();
for ( addressIter = addresses.begin(); addressIter != addresses.end();
++addressIter )
mAddressee.insertAddress( *addressIter );
mDirty = false;
}
bool AddresseeEditorWidget::dirty()
{
if ( ! mDirty ) {
if ( mBirthdayPicker->inputIsValid() ) {
QDate da = mBirthdayPicker->date();
if ( !(da == mAddressee.birthday().date()))
mDirty = true;
}
else {
mBirthdayPicker->clear();
}
if ( mAnniversaryPicker->inputIsValid() ) {
QDate da = mAnniversaryPicker->date();
if ( da != KGlobal::locale()->readDate( mAddressee.custom("KADDRESSBOOK", "X-Anniversary" ),
"%Y-%m-%d"))
mDirty = true;
}
else {
mAnniversaryPicker->clear();
}
}
return mDirty;
}
void AddresseeEditorWidget::nameTextChanged( const QString &text )
{
if ( mBlockSignals )
return;
// use the addressee class to parse the name for us
mAConfig->setUid( mAddressee.uid() );
if ( mAConfig->automaticNameParsing() ) {
if ( !mAddressee.formattedName().isEmpty() ) {