Bug 118932

Summary: Adding address from KMail does not apply default name formatting
Product: kab3 Reporter: S Bufton <kdebugs>
Component: generalAssignee: Tobias Koenig <tokoe>
Status: RESOLVED UNMAINTAINED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

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.