summaryrefslogtreecommitdiffabout
authorulf69 <ulf69>2004-07-02 15:36:32 (UTC)
committer ulf69 <ulf69>2004-07-02 15:36:32 (UTC)
commitead0dcba2c607297137e2b47418eb17864e0caaa (patch) (unidiff)
treef222147cf9f591188853ba22adf981c7a6139ca1
parentb21b6754c93e5aaa53638a060e26f4efea755d37 (diff)
downloadkdepimpi-ead0dcba2c607297137e2b47418eb17864e0caaa.zip
kdepimpi-ead0dcba2c607297137e2b47418eb17864e0caaa.tar.gz
kdepimpi-ead0dcba2c607297137e2b47418eb17864e0caaa.tar.bz2
improved conversion
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/converter/opie/opieconverter.cpp45
1 files changed, 29 insertions, 16 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
@@ -158,5 +158,2 @@ bool OpieConverter::opieToAddressee( OContact &contact, Addressee &addr )
158 158
159//???
160//US QString businessWebpage() const { return find( Qtopia::BusinessWebPage ); }
161
162 //personal 159 //personal
@@ -165,15 +162,27 @@ bool OpieConverter::opieToAddressee( OContact &contact, Addressee &addr )
165 162
166 int orgformat = KGlobal::locale()->getIntDateFormat(); 163 if (contact.anniversary().isValid()) {
167 KGlobal::locale()->setIntDateFormat( 2 ); // = Qt::ISODate 164 int orgformat = KGlobal::locale()->getIntDateFormat();
168 QString dt = KGlobal::locale()->formatDate(contact.anniversary(), true); 165 KGlobal::locale()->setIntDateFormat( 2 ); // = Qt::ISODate
169 KGlobal::locale()->setIntDateFormat(orgformat ); 166 QString dt = KGlobal::locale()->formatDate(contact.anniversary(), true);
170 addr.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt); 167//US
168 qDebug("OpieConverter::opieToAddressee found:%s", dt.latin1());
169 KGlobal::locale()->setIntDateFormat(orgformat );
170 addr.insertCustom( "KADDRESSBOOK", "X-Anniversary", dt);
171 }
171 172
172 addr.insertCustom( "KADDRESSBOOK", "X-Children", contact.children() ); 173 addr.insertCustom( "KADDRESSBOOK", "X-Children", contact.children() );
173 addr.setBirthday( contact.birthday() ); 174 if (contact.birthday().isValid())
175 addr.setBirthday( contact.birthday() );
176
174 addr.setNickName( contact.nickname() ); 177 addr.setNickName( contact.nickname() );
175 178
176 // other 179 // others
180 //US I put opies BusinessWebPage into Ka/Pi's notes block, because no other native field is available.
181 QString notes = contact.notes();
182 notes += "\nBusinessWebPage: " + contact.businessWebpage() + "\n";
183
177 addr.setNote( contact.notes() ); 184 addr.setNote( contact.notes() );
185
178 186
187
179//US QString groups() const { return find( Qtopia::Groups ); } 188//US QString groups() const { return find( Qtopia::Groups ); }
@@ -181,3 +190,3 @@ bool OpieConverter::opieToAddressee( OContact &contact, Addressee &addr )
181 190
182/*US 191
183 QStringList cats = contact.categoryNames("Contacts"); 192 QStringList cats = contact.categoryNames("Contacts");
@@ -186,3 +195,4 @@ bool OpieConverter::opieToAddressee( OContact &contact, Addressee &addr )
186 } 195 }
187*/ 196
197
188 addr.setCategories( contact.categoryNames("Contacts") ); 198 addr.setCategories( contact.categoryNames("Contacts") );
@@ -313,5 +323,7 @@ bool OpieConverter::addresseeToOpie( const Addressee &addr, OContact &contact )
313*/ 323*/
314/*US 324
315 Categories catDB; 325 Categories catDB;
316 catDB.load( contact.categoryFileName() ); 326 catDB.dump();
327//US catDB.load( contact.categoryFileName() );
328 catDB.load( "contact" );
317 329
@@ -319,5 +331,6 @@ bool OpieConverter::addresseeToOpie( const Addressee &addr, OContact &contact )
319 for ( QStringList::Iterator it = cats.begin(); it != cats.end(); ++it ) { 331 for ( QStringList::Iterator it = cats.begin(); it != cats.end(); ++it ) {
320 contact.setCategories(catDB.id(*it)); 332 qDebug("categories: %s", (*it).latin1());
333// contact.setCategories(catDB.id(*it));
321 } 334 }
322*/ 335
323 336