summaryrefslogtreecommitdiffabout
authorulf69 <ulf69>2004-07-02 15:36:32 (UTC)
committer ulf69 <ulf69>2004-07-02 15:36:32 (UTC)
commitead0dcba2c607297137e2b47418eb17864e0caaa (patch) (side-by-side diff)
treef222147cf9f591188853ba22adf981c7a6139ca1
parentb21b6754c93e5aaa53638a060e26f4efea755d37 (diff)
downloadkdepimpi-ead0dcba2c607297137e2b47418eb17864e0caaa.zip
kdepimpi-ead0dcba2c607297137e2b47418eb17864e0caaa.tar.gz
kdepimpi-ead0dcba2c607297137e2b47418eb17864e0caaa.tar.bz2
improved conversion
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kabc/converter/opie/opieconverter.cpp33
1 files changed, 23 insertions, 10 deletions
diff --git a/kabc/converter/opie/opieconverter.cpp b/kabc/converter/opie/opieconverter.cpp
index cfbe5c0..d785fbc 100644
--- a/kabc/converter/opie/opieconverter.cpp
+++ b/kabc/converter/opie/opieconverter.cpp
@@ -156,35 +156,45 @@ bool OpieConverter::opieToAddressee( OContact &contact, Addressee &addr )
addr.insertCustom( "KADDRESSBOOK", "X-ManagersName", contact.manager() );
addr.insertCustom( "KADDRESSBOOK", "X-Office", contact.office() );
-//???
-//US QString businessWebpage() const { return find( Qtopia::BusinessWebPage ); }
-
//personal
addr.insertCustom( "KADDRESSBOOK", "X-SpousesName", contact.spouse() );
addr.insertCustom( "KADDRESSBOOK", "X-Gender", contact.gender() );
+ if (contact.anniversary().isValid()) {
int orgformat = KGlobal::locale()->getIntDateFormat();
KGlobal::locale()->setIntDateFormat( 2 ); // = Qt::ISODate
QString dt = KGlobal::locale()->formatDate(contact.anniversary(), true);
+//US
+ qDebug("OpieConverter::opieToAddressee found:%s", dt.latin1());
KGlobal::locale()->setIntDateFormat(orgformat );
addr.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt);
+ }
addr.insertCustom( "KADDRESSBOOK", "X-Children", contact.children() );
+ if (contact.birthday().isValid())
addr.setBirthday( contact.birthday() );
+
addr.setNickName( contact.nickname() );
- // other
+ // others
+ //US I put opies BusinessWebPage into Ka/Pi's notes block, because no other native field is available.
+ QString notes = contact.notes();
+ notes += "\nBusinessWebPage: " + contact.businessWebpage() + "\n";
+
addr.setNote( contact.notes() );
+
+
//US QString groups() const { return find( Qtopia::Groups ); }
//US QStringList groupList() const;
-/*US
+
QStringList cats = contact.categoryNames("Contacts");
for ( QStringList::Iterator it = cats.begin(); it != cats.end(); ++it ) {
qDebug("Cat: %s", (*it).latin1());
}
-*/
+
+
addr.setCategories( contact.categoryNames("Contacts") );
// qDebug("Groups: %s", contact.groups().latin1());
// addr.setCategories( contact.groupList() );
@@ -311,15 +321,18 @@ bool OpieConverter::addresseeToOpie( const Addressee &addr, OContact &contact )
contact.setCategories( cat );
*/
-/*US
+
Categories catDB;
- catDB.load( contact.categoryFileName() );
+ catDB.dump();
+//US catDB.load( contact.categoryFileName() );
+ catDB.load( "contact" );
QStringList cats = addr.categories();
for ( QStringList::Iterator it = cats.begin(); it != cats.end(); ++it ) {
- contact.setCategories(catDB.id(*it));
+ qDebug("categories: %s", (*it).latin1());
+// contact.setCategories(catDB.id(*it));
}
-*/
+
return true;
}