author | zautrix <zautrix> | 2005-10-28 14:43:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-28 14:43:31 (UTC) |
commit | ab099bc1be027fe01dc252a9d7a0f8821e782d65 (patch) (unidiff) | |
tree | 85bfb03f334da60dffcc52d54202f51d0f947e3f /kaddressbook | |
parent | caaa030d8bc2aa82c53e5d30abc314b992d7226f (diff) | |
download | kdepimpi-ab099bc1be027fe01dc252a9d7a0f8821e782d65.zip kdepimpi-ab099bc1be027fe01dc252a9d7a0f8821e782d65.tar.gz kdepimpi-ab099bc1be027fe01dc252a9d7a0f8821e782d65.tar.bz2 |
fixxxx
-rw-r--r-- | kaddressbook/phoneeditwidget.cpp | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/kaddressbook/phoneeditwidget.cpp b/kaddressbook/phoneeditwidget.cpp index 9e7e221..66f0a5e 100644 --- a/kaddressbook/phoneeditwidget.cpp +++ b/kaddressbook/phoneeditwidget.cpp | |||
@@ -159,40 +159,49 @@ void PhoneEditWidget::pendingDelete() | |||
159 | { | 159 | { |
160 | mTypeNumberEditList.removeRef( mPendingDelete ); | 160 | mTypeNumberEditList.removeRef( mPendingDelete ); |
161 | emit modified(); | 161 | emit modified(); |
162 | } | 162 | } |
163 | 163 | ||
164 | void PhoneEditWidget::setPhoneNumbers( const KABC::PhoneNumber::List &li ) | 164 | void PhoneEditWidget::setPhoneNumbers( const KABC::PhoneNumber::List &li ) |
165 | { | 165 | { |
166 | if ( li.isEmpty() ) { | 166 | if ( li.isEmpty() ) { |
167 | setDefaults(); | 167 | setDefaults(); |
168 | return; | 168 | return; |
169 | } | 169 | } |
170 | mTypeNumberEditList.clear(); | 170 | mTypeNumberEditList.clear(); |
171 | KABC::PhoneNumber::List::Iterator it; | 171 | KABC::PhoneNumber::List::Iterator it; |
172 | KABC::PhoneNumber::List list = li; | 172 | KABC::PhoneNumber::List list2 = li; |
173 | PhoneTypeNumberEdit* edit = 0;//mTypeNumberEditList.first(); | 173 | KABC::PhoneNumber::List list ; |
174 | |||
175 | PhoneNumber::TypeList tList = PhoneNumber::supportedTypeList(); | ||
176 | int i = 0; | ||
177 | int max = tList.count(); | ||
178 | while ( i < max-1 ) { | ||
179 | for ( it = list2.begin(); it != list2.end(); ++it ) { | ||
180 | if ( (*it).type() == tList[i] ) { | ||
181 | list.append( (*it ) ); | ||
182 | break; | ||
183 | } | ||
184 | } | ||
185 | ++i; | ||
186 | } | ||
187 | for ( it = list2.begin(); it != list2.end(); ++it ) { | ||
188 | if ( (*it).type() == tList[ max-1 ] ) | ||
189 | list.append( (*it ) ); | ||
190 | } | ||
174 | for ( it = list.begin(); it != list.end(); ++it ) { | 191 | for ( it = list.begin(); it != list.end(); ++it ) { |
175 | if ( edit ) { | ||
176 | edit->setPhoneNumber( (*it ) ); | ||
177 | edit = mTypeNumberEditList.next(); | ||
178 | } else { | ||
179 | PhoneTypeNumberEdit* editNew = appendEditCombo(); | 192 | PhoneTypeNumberEdit* editNew = appendEditCombo(); |
180 | editNew->setPhoneNumber( (*it ) ); | 193 | editNew->setPhoneNumber( (*it ) ); |
181 | } | ||
182 | } | ||
183 | while ( edit ) { | ||
184 | edit->hide(); | ||
185 | edit = mTypeNumberEditList.next(); | ||
186 | } | 194 | } |
195 | |||
187 | } | 196 | } |
188 | KABC::PhoneNumber::List PhoneEditWidget::phoneNumbers() | 197 | KABC::PhoneNumber::List PhoneEditWidget::phoneNumbers() |
189 | { | 198 | { |
190 | KABC::PhoneNumber::List retList; | 199 | KABC::PhoneNumber::List retList; |
191 | 200 | ||
192 | PhoneTypeNumberEdit* edit = mTypeNumberEditList.first(); | 201 | PhoneTypeNumberEdit* edit = mTypeNumberEditList.first(); |
193 | while ( edit ) { | 202 | while ( edit ) { |
194 | if ( edit->isValid() ) { | 203 | if ( edit->isValid() ) { |
195 | retList.append( edit->phoneNumber()); | 204 | retList.append( edit->phoneNumber()); |
196 | } | 205 | } |
197 | edit = mTypeNumberEditList.next(); | 206 | edit = mTypeNumberEditList.next(); |
198 | 207 | ||