Bug 116980 - CSV import won't import home locality
Summary: CSV import won't import home locality
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kab3
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Tobias Koenig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-24 00:47 UTC by Oliver Waddell
Modified: 2009-08-05 16:27 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 Oliver Waddell 2005-11-24 00:47:40 UTC
Version:            (using KDE KDE 3.4.2)
Installed from:    Debian testing/unstable Packages
Compiler:          gcc (GCC) 4.0.2 (Debian 4.0.2-2) 
OS:                Linux

Hi

I try to import my 742 addresses from The Bat! via a CSV file (to keep the birthday dates which get lost with the other export formats).

Your CSV Import Dialog is very nice, but the import field

"Home Address City"

is not imported into the field

(Home) "Locality"

of the addresses imported.

If run from the console, it also prints the following error over and over while opening the CSV file:

X Error: BadMatch (invalid parameter attributes) 8
  Major opcode:  59
  Minor opcode:  0
  Resource id:  0x0

I tried the same with KAddressBook 3.4.2 (using KDE 3.4.3) on Ubuntu Linux.

There the Resource id is sometimes 0x3c0624f, and the same field is missing.

Thank you for your fine work.

Oliver
Comment 1 Cp Hennessy 2005-12-03 20:33:31 UTC
Can you please provide an example CSV file ?
Comment 2 Oliver Waddell 2005-12-11 23:34:57 UTC
Hi Cp Hennessy

I don't have time to do that right now (and I don't want my personal
addressen in the bugs-database).

But I've a little addition to my report: the location of the business
location is assigned to the home location in the csv import data.

Greetings,
         Oliver

> ------- Additional Comments From cp.hennessy iname com  2005-12-03 20:33 -------
> Can you please provide an example CSV file ?

Comment 3 Tobias Koenig 2005-12-12 10:04:08 UTC
On Sun, Dec 11, 2005 at 10:34:58PM -0000, Oliver Waddell wrote:
> Hi Cp Hennessy

Hi Oliver,

> But I've a little addition to my report: the location of the business
> location is assigned to the home location in the csv import data.

Well, so when there is no correct assignment, the data won't be imported
properly of course...

Did you use a predefined assignment (template)?

Ciao,
Tobias
Comment 4 Tobias Koenig 2007-02-06 00:00:12 UTC
SVN commit 630659 by tokoe:

Import phonenumbers and address data correctly when using Field::setValue()

BUG:116980


 M  +129 -0    field.src.cpp  


--- branches/KDE/3.5/kdelibs/kabc/scripts/field.src.cpp #630658:630659
@@ -23,6 +23,7 @@
 #include <kglobal.h>
 
 #include "field.h"
+#include "address.h"
 
 using namespace KABC;
 
@@ -216,10 +217,138 @@
 {
   switch ( mImpl->fieldId() ) {
     --CASESETVALUE--
+    case FieldImpl::MobilePhone:
+      {
+        PhoneNumber number = a.phoneNumber( PhoneNumber::Cell );
+        number.setNumber( value );
+        a.insertPhoneNumber( number );
+        return true;
+      }
+    case FieldImpl::HomeFax:
+      {
+        PhoneNumber number = a.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax );
+        number.setNumber( value );
+        a.insertPhoneNumber( number );
+        return true;
+      }
+    case FieldImpl::BusinessFax:
+      {
+        PhoneNumber number = a.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax );
+        number.setNumber( value );
+        a.insertPhoneNumber( number );
+        return true;
+      }
+    case FieldImpl::CarPhone:
+      {
+        PhoneNumber number = a.phoneNumber( PhoneNumber::Car );
+        number.setNumber( value );
+        a.insertPhoneNumber( number );
+        return true;
+      }
+    case FieldImpl::Isdn:
+      {
+        PhoneNumber number = a.phoneNumber( PhoneNumber::Isdn );
+        number.setNumber( value );
+        a.insertPhoneNumber( number );
+        return true;
+      }
+    case FieldImpl::Pager:
+      {
+        PhoneNumber number = a.phoneNumber( PhoneNumber::Pager );
+        number.setNumber( value );
+        a.insertPhoneNumber( number );
+        return true;
+      }
+    case FieldImpl::HomeAddressStreet:
+      {
+        KABC::Address address = a.address( Address::Home );
+        address.setStreet( value );
+        a.insertAddress( address );
+        return true;
+      }
+    case FieldImpl::HomeAddressLocality:
+      {
+        KABC::Address address = a.address( Address::Home );
+        address.setLocality( value );
+        a.insertAddress( address );
+        return true;
+      }
+    case FieldImpl::HomeAddressRegion:
+      {
+        KABC::Address address = a.address( Address::Home );
+        address.setRegion( value );
+        a.insertAddress( address );
+        return true;
+      }
+    case FieldImpl::HomeAddressPostalCode:
+      {
+        KABC::Address address = a.address( Address::Home );
+        address.setPostalCode( value );
+        a.insertAddress( address );
+        return true;
+      }
+    case FieldImpl::HomeAddressCountry:
+      {
+        KABC::Address address = a.address( Address::Home );
+        address.setCountry( value );
+        a.insertAddress( address );
+        return true;
+      }
+    case FieldImpl::HomeAddressLabel:
+      {
+        KABC::Address address = a.address( Address::Home );
+        address.setLabel( value );
+        a.insertAddress( address );
+        return true;
+      }
+    case FieldImpl::BusinessAddressStreet:
+      {
+        KABC::Address address = a.address( Address::Work );
+        address.setStreet( value );
+        a.insertAddress( address );
+        return true;
+      }
+    case FieldImpl::BusinessAddressLocality:
+      {
+        KABC::Address address = a.address( Address::Work );
+        address.setLocality( value );
+        a.insertAddress( address );
+        return true;
+      }
+    case FieldImpl::BusinessAddressRegion:
+      {
+        KABC::Address address = a.address( Address::Work );
+        address.setRegion( value );
+        a.insertAddress( address );
+        return true;
+      }
+    case FieldImpl::BusinessAddressPostalCode:
+      {
+        KABC::Address address = a.address( Address::Work );
+        address.setPostalCode( value );
+        a.insertAddress( address );
+        return true;
+      }
+    case FieldImpl::BusinessAddressCountry:
+      {
+        KABC::Address address = a.address( Address::Work );
+        address.setCountry( value );
+        a.insertAddress( address );
+        return true;
+      }
+    case FieldImpl::BusinessAddressLabel:
+      {
+        KABC::Address address = a.address( Address::Work );
+        address.setLabel( value );
+        a.insertAddress( address );
+        return true;
+      }
     case FieldImpl::Birthday:
       a.setBirthday( QDate::fromString( value, Qt::ISODate ) );
+      return true;
     case FieldImpl::CustomField:
       a.insertCustom( mImpl->app(), mImpl->key(), value );
+      return true;
     default:
       return false;
   }
Comment 5 Tobias Koenig 2009-08-05 16:27:56 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.