Bug 118932 - Adding address from KMail does not apply default name formatting
Summary: Adding address from KMail does not apply default name formatting
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kab3
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Tobias Koenig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-24 00:14 UTC by S Bufton
Modified: 2009-08-05 16:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description S Bufton 2005-12-24 00:14:03 UTC
Version:            (using KDE KDE 3.5.0)
Installed from:    SuSE RPMs
OS:                Linux

Adding a contact to the address book by selecting an e-mail address in KMail (running in Kontakt) transfers the name correctly to the contact entry, but the formatted name is 'Simple name' instead of the default 'Reverse name with comma' from Configure Address Book -> General -> Contact.
Comment 1 Tobias Koenig 2007-02-13 20:12:37 UTC
SVN commit 633308 by tokoe:

Add the formatted name according to the kaddressbook settings

BUG:118932


 M  +31 -0     kaddrbook.cpp  


--- branches/KDE/3.5/kdepim/libkdepim/kaddrbook.cpp #633307:633308
@@ -113,6 +113,37 @@
     a.setNameFromString( name );
     a.insertEmail( email, true );
 
+    {
+      KConfig config( "kaddressbookrc" );
+      config.setGroup( "General" );
+      int type = config.readNumEntry( "FormattedNameType", 1 );
+
+      QString name;
+      switch ( type ) {
+        case 1:
+          name = a.givenName() + " " + a.familyName();
+          break;
+        case 2:
+          name = a.assembledName();
+          break;
+        case 3:
+          name = a.familyName() + ", " + a.givenName();
+          break;
+        case 4:
+          name = a.familyName() + " " + a.givenName();
+          break;
+        case 5:
+          name = a.organization();
+          break;
+        default:
+          name = "";
+          break;
+      }
+      name.simplifyWhiteSpace();
+
+      a.setFormattedName( name );
+    }
+
     if ( !KAddrBookExternal::addAddressee( a ) ) {
       KMessageBox::error( parent, i18n("Cannot save to addressbook.") );
     } else {
Comment 2 Tobias Koenig 2009-08-05 16:28:15 UTC
The development of the old KAddressBook will be discontinued for KDE 4.4.
Since the new application has the same name, but a completly new code base we close all bug reports against the old version and ask the submitters to resend there reports against the new product.