-rw-r--r-- | kaddressbook/phoneeditwidget.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/kaddressbook/phoneeditwidget.cpp b/kaddressbook/phoneeditwidget.cpp index 78b9941..19bb676 100644 --- a/kaddressbook/phoneeditwidget.cpp +++ b/kaddressbook/phoneeditwidget.cpp @@ -186,64 +186,65 @@ void PhoneEditWidget::updateLineEdits() updateThirdEdit(); updateFourthEdit(); } void PhoneEditWidget::updateCombos() { mPrefCombo->updateTypes(); mSecondCombo->updateTypes(); mThirdCombo->updateTypes(); mFourthCombo->updateTypes(); } KABC::PhoneNumber::List PhoneEditWidget::phoneNumbers() { KABC::PhoneNumber::List retList; KABC::PhoneNumber::List::Iterator it; for ( it = mPhoneList.begin(); it != mPhoneList.end(); ++it ) if ( !(*it).number().isEmpty() ) retList.append( *it ); return retList; } void PhoneEditWidget::edit() { PhoneEditDialog dlg( mPhoneList, this ); if ( dlg.exec() ) { if ( dlg.changed() ) { mPhoneList = dlg.phoneNumbers(); updateCombos(); + updateLineEdits(); emit modified(); } } } void PhoneEditWidget::updatePrefEdit() { updateEdit( mPrefCombo ); } void PhoneEditWidget::updateSecondEdit() { updateEdit( mSecondCombo ); } void PhoneEditWidget::updateThirdEdit() { updateEdit( mThirdCombo ); } void PhoneEditWidget::updateFourthEdit() { updateEdit( mFourthCombo ); } void PhoneEditWidget::updateEdit( PhoneTypeCombo *combo ) { QLineEdit *edit = combo->lineEdit(); if ( !edit ) return; #if 0 @@ -260,68 +261,65 @@ void PhoneEditWidget::updateEdit( PhoneTypeCombo *combo ) kdDebug(5720) << "PhoneEditWidget::updateEdit(): no selected element" << endl; } } void PhoneEditWidget::slotPrefEditChanged() { updatePhoneNumber( mPrefCombo ); } void PhoneEditWidget::slotSecondEditChanged() { updatePhoneNumber( mSecondCombo ); } void PhoneEditWidget::slotThirdEditChanged() { updatePhoneNumber( mThirdCombo ); } void PhoneEditWidget::slotFourthEditChanged() { updatePhoneNumber( mFourthCombo ); } void PhoneEditWidget::updatePhoneNumber( PhoneTypeCombo *combo ) { QLineEdit *edit = combo->lineEdit(); if ( !edit ) return; PhoneNumber::List::Iterator it = combo->selectedElement(); if ( it != mPhoneList.end() ) { (*it).setNumber( edit->text() ); - } else { - kdDebug(5720) << "PhoneEditWidget::updatePhoneNumber(): no selected element" - << endl; - } + } updateOtherEdit( combo, mPrefCombo ); updateOtherEdit( combo, mSecondCombo ); updateOtherEdit( combo, mThirdCombo ); updateOtherEdit( combo, mFourthCombo ); emit modified(); } void PhoneEditWidget::updateOtherEdit( PhoneTypeCombo *combo, PhoneTypeCombo *otherCombo ) { if ( combo == otherCombo ) return; if ( combo->currentItem() == otherCombo->currentItem() ) { updateEdit( otherCombo ); } } /////////////////////////////////////////// // PhoneEditDialog class PhoneViewItem : public QListViewItem { public: PhoneViewItem( QListView *parent, const KABC::PhoneNumber &number ); void setPhoneNumber( const KABC::PhoneNumber &number ) { mPhoneNumber = number; makeText(); } |