author | zautrix <zautrix> | 2004-10-12 20:14:39 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-12 20:14:39 (UTC) |
commit | 77e3a7bc670f4c9b7eb5a5d6652a7986ea196533 (patch) (unidiff) | |
tree | 963c068c7648899a4c3ac26542605f05492019c5 /kaddressbook | |
parent | d3759373291c08d2cde93d85a76d190dc8a33830 (diff) | |
download | kdepimpi-77e3a7bc670f4c9b7eb5a5d6652a7986ea196533.zip kdepimpi-77e3a7bc670f4c9b7eb5a5d6652a7986ea196533.tar.gz kdepimpi-77e3a7bc670f4c9b7eb5a5d6652a7986ea196533.tar.bz2 |
Changed phone number sorting in details view
-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 | |||
@@ -202,32 +202,33 @@ KABC::PhoneNumber::List PhoneEditWidget::phoneNumbers() | |||
202 | KABC::PhoneNumber::List::Iterator it; | 202 | KABC::PhoneNumber::List::Iterator it; |
203 | for ( it = mPhoneList.begin(); it != mPhoneList.end(); ++it ) | 203 | for ( it = mPhoneList.begin(); it != mPhoneList.end(); ++it ) |
204 | if ( !(*it).number().isEmpty() ) | 204 | if ( !(*it).number().isEmpty() ) |
205 | retList.append( *it ); | 205 | retList.append( *it ); |
206 | 206 | ||
207 | return retList; | 207 | return retList; |
208 | } | 208 | } |
209 | 209 | ||
210 | void PhoneEditWidget::edit() | 210 | void PhoneEditWidget::edit() |
211 | { | 211 | { |
212 | PhoneEditDialog dlg( mPhoneList, this ); | 212 | PhoneEditDialog dlg( mPhoneList, this ); |
213 | 213 | ||
214 | if ( dlg.exec() ) { | 214 | if ( dlg.exec() ) { |
215 | if ( dlg.changed() ) { | 215 | if ( dlg.changed() ) { |
216 | mPhoneList = dlg.phoneNumbers(); | 216 | mPhoneList = dlg.phoneNumbers(); |
217 | updateCombos(); | 217 | updateCombos(); |
218 | updateLineEdits(); | ||
218 | emit modified(); | 219 | emit modified(); |
219 | } | 220 | } |
220 | } | 221 | } |
221 | } | 222 | } |
222 | 223 | ||
223 | void PhoneEditWidget::updatePrefEdit() | 224 | void PhoneEditWidget::updatePrefEdit() |
224 | { | 225 | { |
225 | updateEdit( mPrefCombo ); | 226 | updateEdit( mPrefCombo ); |
226 | } | 227 | } |
227 | 228 | ||
228 | void PhoneEditWidget::updateSecondEdit() | 229 | void PhoneEditWidget::updateSecondEdit() |
229 | { | 230 | { |
230 | updateEdit( mSecondCombo ); | 231 | updateEdit( mSecondCombo ); |
231 | } | 232 | } |
232 | 233 | ||
233 | void PhoneEditWidget::updateThirdEdit() | 234 | void PhoneEditWidget::updateThirdEdit() |
@@ -276,36 +277,33 @@ void PhoneEditWidget::slotThirdEditChanged() | |||
276 | updatePhoneNumber( mThirdCombo ); | 277 | updatePhoneNumber( mThirdCombo ); |
277 | } | 278 | } |
278 | 279 | ||
279 | void PhoneEditWidget::slotFourthEditChanged() | 280 | void PhoneEditWidget::slotFourthEditChanged() |
280 | { | 281 | { |
281 | updatePhoneNumber( mFourthCombo ); | 282 | updatePhoneNumber( mFourthCombo ); |
282 | } | 283 | } |
283 | 284 | ||
284 | void PhoneEditWidget::updatePhoneNumber( PhoneTypeCombo *combo ) | 285 | void PhoneEditWidget::updatePhoneNumber( PhoneTypeCombo *combo ) |
285 | { | 286 | { |
286 | QLineEdit *edit = combo->lineEdit(); | 287 | QLineEdit *edit = combo->lineEdit(); |
287 | if ( !edit ) return; | 288 | if ( !edit ) return; |
288 | 289 | ||
289 | PhoneNumber::List::Iterator it = combo->selectedElement(); | 290 | PhoneNumber::List::Iterator it = combo->selectedElement(); |
290 | if ( it != mPhoneList.end() ) { | 291 | if ( it != mPhoneList.end() ) { |
291 | (*it).setNumber( edit->text() ); | 292 | (*it).setNumber( edit->text() ); |
292 | } else { | 293 | } |
293 | kdDebug(5720) << "PhoneEditWidget::updatePhoneNumber(): no selected element" | ||
294 | << endl; | ||
295 | } | ||
296 | 294 | ||
297 | updateOtherEdit( combo, mPrefCombo ); | 295 | updateOtherEdit( combo, mPrefCombo ); |
298 | updateOtherEdit( combo, mSecondCombo ); | 296 | updateOtherEdit( combo, mSecondCombo ); |
299 | updateOtherEdit( combo, mThirdCombo ); | 297 | updateOtherEdit( combo, mThirdCombo ); |
300 | updateOtherEdit( combo, mFourthCombo ); | 298 | updateOtherEdit( combo, mFourthCombo ); |
301 | 299 | ||
302 | emit modified(); | 300 | emit modified(); |
303 | } | 301 | } |
304 | 302 | ||
305 | void PhoneEditWidget::updateOtherEdit( PhoneTypeCombo *combo, PhoneTypeCombo *otherCombo ) | 303 | void PhoneEditWidget::updateOtherEdit( PhoneTypeCombo *combo, PhoneTypeCombo *otherCombo ) |
306 | { | 304 | { |
307 | if ( combo == otherCombo ) return; | 305 | if ( combo == otherCombo ) return; |
308 | 306 | ||
309 | if ( combo->currentItem() == otherCombo->currentItem() ) { | 307 | if ( combo->currentItem() == otherCombo->currentItem() ) { |
310 | updateEdit( otherCombo ); | 308 | updateEdit( otherCombo ); |
311 | } | 309 | } |