Diffstat (limited to 'kaddressbook/nameeditdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/nameeditdialog.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/kaddressbook/nameeditdialog.cpp b/kaddressbook/nameeditdialog.cpp index 8213c2b..f5dba0f 100644 --- a/kaddressbook/nameeditdialog.cpp +++ b/kaddressbook/nameeditdialog.cpp | |||
@@ -212,48 +212,50 @@ QString NameEditDialog::customFormattedName() const | |||
212 | { | 212 | { |
213 | return mFormattedNameEdit->text(); | 213 | return mFormattedNameEdit->text(); |
214 | } | 214 | } |
215 | 215 | ||
216 | int NameEditDialog::formattedNameType() const | 216 | int NameEditDialog::formattedNameType() const |
217 | { | 217 | { |
218 | return mFormattedNameCombo->currentItem(); | 218 | return mFormattedNameCombo->currentItem(); |
219 | } | 219 | } |
220 | 220 | ||
221 | bool NameEditDialog::changed() const | 221 | bool NameEditDialog::changed() const |
222 | { | 222 | { |
223 | return mChanged; | 223 | return mChanged; |
224 | } | 224 | } |
225 | 225 | ||
226 | QString NameEditDialog::formattedName( const KABC::Addressee &addr, int type ) | 226 | QString NameEditDialog::formattedName( const KABC::Addressee &addr, int type ) |
227 | { | 227 | { |
228 | QString retval; | ||
228 | switch ( type ) { | 229 | switch ( type ) { |
229 | case SimpleName: | 230 | case SimpleName: |
230 | return addr.givenName() + " " + addr.familyName(); | 231 | retval = addr.givenName() + " " + addr.familyName(); |
231 | break; | 232 | break; |
232 | case FullName: | 233 | case FullName: |
233 | return addr.prefix() + " " + addr.givenName() + " " + | 234 | retval =addr.prefix() + " " + addr.givenName() + " " + |
234 | addr.additionalName() + " " + addr.familyName() + " " + | 235 | addr.additionalName() + " " + addr.familyName() + " " + |
235 | addr.suffix(); | 236 | addr.suffix(); |
236 | break; | 237 | break; |
237 | case ReverseName: | 238 | case ReverseName: |
238 | return addr.familyName() + ", " + addr.givenName(); | 239 | retval = addr.familyName() + ", " + addr.givenName(); |
239 | break; | 240 | break; |
240 | default: | 241 | default: |
241 | return ""; | 242 | return ""; |
242 | break; | 243 | break; |
243 | } | 244 | } |
245 | return retval.stripWhiteSpace (); | ||
244 | } | 246 | } |
245 | 247 | ||
246 | void NameEditDialog::parseBoxChanged( bool value ) | 248 | void NameEditDialog::parseBoxChanged( bool value ) |
247 | { | 249 | { |
248 | //AddresseeConfig::instance()->setUid( addr.uid() ); | 250 | //AddresseeConfig::instance()->setUid( addr.uid() ); |
249 | AddresseeConfig::instance()->setAutomaticNameParsing( value ); | 251 | AddresseeConfig::instance()->setAutomaticNameParsing( value ); |
250 | } | 252 | } |
251 | 253 | ||
252 | void NameEditDialog::typeChanged( int pos ) | 254 | void NameEditDialog::typeChanged( int pos ) |
253 | { | 255 | { |
254 | mFormattedNameEdit->setEnabled( pos == 0 ); | 256 | mFormattedNameEdit->setEnabled( pos == 0 ); |
255 | } | 257 | } |
256 | 258 | ||
257 | void NameEditDialog::modified() | 259 | void NameEditDialog::modified() |
258 | { | 260 | { |
259 | mChanged = true; | 261 | mChanged = true; |