author | eilers <eilers> | 2004-06-27 17:34:44 (UTC) |
---|---|---|
committer | eilers <eilers> | 2004-06-27 17:34:44 (UTC) |
commit | 0ef75ca5409d290df36d1c0bbf0413e37bfd4124 (patch) (unidiff) | |
tree | a89d266f6ce2a6b90aff542d6c305c3fc5dde5b1 /libopie2 | |
parent | e211aea3b9201920f442b36f6726d10c09b63154 (diff) | |
download | opie-0ef75ca5409d290df36d1c0bbf0413e37bfd4124.zip opie-0ef75ca5409d290df36d1c0bbf0413e37bfd4124.tar.gz opie-0ef75ca5409d290df36d1c0bbf0413e37bfd4124.tar.bz2 |
Argh.. Sorry for making problems !
CVS committed stuff which had merging conflicts... :(
-rw-r--r-- | libopie2/opiedb/osqlitedriver.cpp | 6 | ||||
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp | 661 |
2 files changed, 228 insertions, 439 deletions
diff --git a/libopie2/opiedb/osqlitedriver.cpp b/libopie2/opiedb/osqlitedriver.cpp index b9a491e..92f89cf 100644 --- a/libopie2/opiedb/osqlitedriver.cpp +++ b/libopie2/opiedb/osqlitedriver.cpp | |||
@@ -170,9 +170,9 @@ OSQLResult OSQLiteDriver::query( OSQLQuery* qu) { | |||
170 | char *err; | 170 | char *err; |
171 | /* SQLITE_OK 0 if return code > 0 == failure */ | 171 | /* SQLITE_OK 0 if return code > 0 == failure */ |
172 | if ( sqlite_exec(m_sqlite, qu->query().utf8(),&call_back, &query, &err) > 0 ) { | 172 | if ( sqlite_exec(m_sqlite, qu->query().utf8(),&call_back, &query, &err) > 0 ) { |
173 | qWarning("OSQLiteDriver::query: Error while executing %s",err); | 173 | owarn << "OSQLiteDriver::query: Error while executing " << err << "" << oendl; |
174 | free(err ); | 174 | free( err ); |
175 | // FixMe Errors | 175 | // FixMe Errors |
176 | } | 176 | } |
177 | 177 | ||
178 | OSQLResult result(OSQLResult::Success, | 178 | OSQLResult result(OSQLResult::Success, |
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp index caf3c6e..6b66814 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_vcard.cpp | |||
@@ -66,7 +66,7 @@ bool OPimContactAccessBackend_VCard::load () | |||
66 | if ( !obj ) | 66 | if ( !obj ) |
67 | return false; | 67 | return false; |
68 | }else{ | 68 | }else{ |
69 | owarn << "File \"" << m_file << "\" not found !" << oendl; | 69 | odebug << "File \"" << m_file << "\" not found !" << oendl; |
70 | return false; | 70 | return false; |
71 | } | 71 | } |
72 | 72 | ||
@@ -210,447 +210,236 @@ OPimContact OPimContactAccessBackend_VCard::parseVObject( VObject *obj ) | |||
210 | { | 210 | { |
211 | OPimContact c; | 211 | OPimContact c; |
212 | 212 | ||
213 | <<<<<<< ocontactaccessbackend_vcard.cpp | ||
214 | VObjectIterator it; | ||
215 | initPropIterator( &it, obj ); | ||
216 | while( moreIteration( &it ) ) { | ||
217 | VObject *o = nextVObject( &it ); | ||
218 | QCString name = vObjectName( o ); | ||
219 | QString value = QString::fromUtf8( vObjectStringZValue( o ) ); | ||
220 | qDebug( "(1)Read: %s", QString( value ).latin1() ); | ||
221 | if ( name == VCNameProp ) { | ||
222 | VObjectIterator nit; | ||
223 | initPropIterator( &nit, o ); | ||
224 | while( moreIteration( &nit ) ) { | ||
225 | VObject *o = nextVObject( &nit ); | ||
226 | QCString name = vObjectTypeInfo( o ); | ||
227 | QString value = QString::fromUtf8( vObjectStringZValue( o ) ); | ||
228 | qDebug( "(2)Read: %s", value.latin1() ); | ||
229 | if ( name == VCNamePrefixesProp ) | ||
230 | c.setTitle( value ); | ||
231 | else if ( name == VCNameSuffixesProp ) | ||
232 | c.setSuffix( value ); | ||
233 | else if ( name == VCFamilyNameProp ) | ||
234 | c.setLastName( value ); | ||
235 | else if ( name == VCGivenNameProp ) | ||
236 | c.setFirstName( value ); | ||
237 | else if ( name == VCAdditionalNamesProp ) | ||
238 | c.setMiddleName( value ); | ||
239 | } | ||
240 | } | ||
241 | else if ( name == VCAdrProp ) { | ||
242 | bool work = TRUE; // default address is work address | ||
243 | QString street; | ||
244 | QString city; | ||
245 | QString region; | ||
246 | QString postal; | ||
247 | QString country; | ||
248 | |||
249 | VObjectIterator nit; | ||
250 | initPropIterator( &nit, o ); | ||
251 | while( moreIteration( &nit ) ) { | ||
252 | VObject *o = nextVObject( &nit ); | ||
253 | QCString name = vObjectName( o ); | ||
254 | QString value = QString::fromUtf8( vObjectStringZValue( o ) ); | ||
255 | if ( name == VCHomeProp ) | ||
256 | work = FALSE; | ||
257 | else if ( name == VCWorkProp ) | ||
258 | work = TRUE; | ||
259 | else if ( name == VCStreetAddressProp ) | ||
260 | street = value; | ||
261 | else if ( name == VCCityProp ) | ||
262 | city = value; | ||
263 | else if ( name == VCRegionProp ) | ||
264 | region = value; | ||
265 | else if ( name == VCPostalCodeProp ) | ||
266 | postal = value; | ||
267 | else if ( name == VCCountryNameProp ) | ||
268 | country = value; | ||
269 | } | ||
270 | if ( work ) { | ||
271 | c.setBusinessStreet( street ); | ||
272 | c.setBusinessCity( city ); | ||
273 | c.setBusinessCountry( country ); | ||
274 | c.setBusinessZip( postal ); | ||
275 | c.setBusinessState( region ); | ||
276 | } else { | ||
277 | c.setHomeStreet( street ); | ||
278 | c.setHomeCity( city ); | ||
279 | c.setHomeCountry( country ); | ||
280 | c.setHomeZip( postal ); | ||
281 | c.setHomeState( region ); | ||
282 | } | ||
283 | } | ||
284 | else if ( name == VCTelephoneProp ) { | ||
285 | enum { | ||
286 | HOME = 0x01, | ||
287 | WORK = 0x02, | ||
288 | VOICE = 0x04, | ||
289 | CELL = 0x08, | ||
290 | FAX = 0x10, | ||
291 | PAGER = 0x20, | ||
292 | UNKNOWN = 0x80 | ||
293 | }; | ||
294 | int type = 0; | ||
295 | |||
296 | VObjectIterator nit; | ||
297 | initPropIterator( &nit, o ); | ||
298 | while( moreIteration( &nit ) ) { | ||
299 | VObject *o = nextVObject( &nit ); | ||
300 | QCString name = vObjectTypeInfo( o ); | ||
301 | if ( name == VCHomeProp ) | ||
302 | type |= HOME; | ||
303 | else if ( name == VCWorkProp ) | ||
304 | type |= WORK; | ||
305 | else if ( name == VCVoiceProp ) | ||
306 | type |= VOICE; | ||
307 | else if ( name == VCCellularProp ) | ||
308 | type |= CELL; | ||
309 | else if ( name == VCFaxProp ) | ||
310 | type |= FAX; | ||
311 | else if ( name == VCPagerProp ) | ||
312 | type |= PAGER; | ||
313 | else if ( name == VCPreferredProp ) | ||
314 | ; | ||
315 | else | ||
316 | type |= UNKNOWN; | ||
317 | } | ||
318 | if ( (type & UNKNOWN) != UNKNOWN ) { | ||
319 | if ( ( type & (HOME|WORK) ) == 0 ) // default | ||
320 | type |= HOME; | ||
321 | if ( ( type & (VOICE|CELL|FAX|PAGER) ) == 0 ) // default | ||
322 | type |= VOICE; | ||
323 | |||
324 | qWarning("value %s %d", value.data(), type ); | ||
325 | if ( (type & (VOICE|HOME) ) == (VOICE|HOME) && (type & (CELL|HOME) ) != (CELL|HOME) ) | ||
326 | c.setHomePhone( value ); | ||
327 | if ( ( type & (FAX|HOME) ) == (FAX|HOME) ) | ||
328 | c.setHomeFax( value ); | ||
329 | if ( ( type & (CELL|HOME) ) == (CELL|HOME) ) | ||
330 | c.setHomeMobile( value ); | ||
331 | if ( ( type & (VOICE|WORK) ) == (VOICE|WORK) && (type & (CELL|WORK) ) != (CELL|WORK) ) | ||
332 | c.setBusinessPhone( value ); | ||
333 | if ( ( type & (FAX|WORK) ) == (FAX|WORK) ) | ||
334 | c.setBusinessFax( value ); | ||
335 | if ( ( type & (CELL|WORK) ) == (CELL|WORK) ) | ||
336 | c.setBusinessMobile( value ); | ||
337 | if ( ( type & (PAGER|WORK) ) == (PAGER|WORK) ) | ||
338 | c.setBusinessPager( value ); | ||
339 | } | ||
340 | } | ||
341 | else if ( name == VCEmailAddressProp ) { | ||
342 | QString email = QString::fromUtf8( vObjectStringZValue( o ) ); | ||
343 | bool valid = TRUE; | ||
344 | VObjectIterator nit; | ||
345 | initPropIterator( &nit, o ); | ||
346 | while( moreIteration( &nit ) ) { | ||
347 | VObject *o = nextVObject( &nit ); | ||
348 | QCString name = vObjectTypeInfo( o ); | ||
349 | if ( name != VCInternetProp && name != VCHomeProp && | ||
350 | name != VCWorkProp && | ||
351 | name != VCPreferredProp ) | ||
352 | // ### preffered should map to default email | ||
353 | valid = FALSE; | ||
354 | } | ||
355 | if ( valid ) { | ||
356 | c.insertEmail( email ); | ||
357 | } | ||
358 | } | ||
359 | else if ( name == VCURLProp ) { | ||
360 | VObjectIterator nit; | ||
361 | initPropIterator( &nit, o ); | ||
362 | while( moreIteration( &nit ) ) { | ||
363 | VObject *o = nextVObject( &nit ); | ||
364 | QCString name = vObjectTypeInfo( o ); | ||
365 | if ( name == VCHomeProp ) | ||
366 | c.setHomeWebpage( value ); | ||
367 | else if ( name == VCWorkProp ) | ||
368 | c.setBusinessWebpage( value ); | ||
369 | } | ||
370 | } | ||
371 | else if ( name == VCOrgProp ) { | ||
372 | VObjectIterator nit; | ||
373 | initPropIterator( &nit, o ); | ||
374 | while( moreIteration( &nit ) ) { | ||
375 | VObject *o = nextVObject( &nit ); | ||
376 | QCString name = vObjectName( o ); | ||
377 | QString value = QString::fromUtf8( vObjectStringZValue( o ) ); | ||
378 | if ( name == VCOrgNameProp ) | ||
379 | c.setCompany( value ); | ||
380 | else if ( name == VCOrgUnitProp ) | ||
381 | c.setDepartment( value ); | ||
382 | else if ( name == VCOrgUnit2Prop ) | ||
383 | c.setOffice( value ); | ||
384 | } | ||
385 | } | ||
386 | else if ( name == VCTitleProp ) { | ||
387 | c.setJobTitle( value ); | ||
388 | } | ||
389 | else if ( name == "X-Qtopia-Profession" ) { | ||
390 | c.setProfession( value ); | ||
391 | } | ||
392 | else if ( name == "X-Qtopia-Manager" ) { | ||
393 | c.setManager( value ); | ||
394 | } | ||
395 | else if ( name == "X-Qtopia-Assistant" ) { | ||
396 | c.setAssistant( value ); | ||
397 | } | ||
398 | else if ( name == "X-Qtopia-Spouse" ) { | ||
399 | c.setSpouse( value ); | ||
400 | } | ||
401 | else if ( name == "X-Qtopia-Gender" ) { | ||
402 | c.setGender( value ); | ||
403 | } | ||
404 | else if ( name == "X-Qtopia-Anniversary" ) { | ||
405 | c.setAnniversary( convVCardDateToDate( value ) ); | ||
406 | } | ||
407 | else if ( name == "X-Qtopia-Nickname" ) { | ||
408 | c.setNickname( value ); | ||
409 | } | ||
410 | else if ( name == "X-Qtopia-Children" ) { | ||
411 | c.setChildren( value ); | ||
412 | } | ||
413 | else if ( name == VCBirthDateProp ) { | ||
414 | // Reading Birthdate regarding RFC 2425 (5.8.4) | ||
415 | c.setBirthday( convVCardDateToDate( value ) ); | ||
416 | |||
417 | } | ||
418 | else if ( name == VCCommentProp ) { | ||
419 | c.setNotes( value ); | ||
420 | } | ||
421 | ======= | ||
422 | VObjectIterator it; | 213 | VObjectIterator it; |
423 | initPropIterator( &it, obj ); | 214 | initPropIterator( &it, obj ); |
424 | while( moreIteration( &it ) ) { | 215 | while( moreIteration( &it ) ) { |
425 | VObject *o = nextVObject( &it ); | 216 | VObject *o = nextVObject( &it ); |
426 | QCString name = vObjectName( o ); | 217 | QCString name = vObjectName( o ); |
427 | QCString value = vObjectStringZValue( o ); | 218 | QString value = QString::fromUtf8( vObjectStringZValue( o ) ); |
428 | if ( name == VCNameProp ) { | 219 | odebug << "(1)Read: %s" << QString( value ).latin1() << oendl; |
429 | VObjectIterator nit; | 220 | if ( name == VCNameProp ) { |
430 | initPropIterator( &nit, o ); | 221 | VObjectIterator nit; |
431 | while( moreIteration( &nit ) ) { | 222 | initPropIterator( &nit, o ); |
432 | VObject *o = nextVObject( &nit ); | 223 | while( moreIteration( &nit ) ) { |
433 | QCString name = vObjectTypeInfo( o ); | 224 | VObject *o = nextVObject( &nit ); |
434 | QString value = vObjectStringZValue( o ); | 225 | QCString name = vObjectTypeInfo( o ); |
435 | if ( name == VCNamePrefixesProp ) | 226 | QString value = QString::fromUtf8( vObjectStringZValue( o ) ); |
436 | c.setTitle( value ); | 227 | odebug << "(2)Read: %s" << value.latin1() << oendl; |
437 | else if ( name == VCNameSuffixesProp ) | 228 | if ( name == VCNamePrefixesProp ) |
438 | c.setSuffix( value ); | 229 | c.setTitle( value ); |
439 | else if ( name == VCFamilyNameProp ) | 230 | else if ( name == VCNameSuffixesProp ) |
440 | c.setLastName( value ); | 231 | c.setSuffix( value ); |
441 | else if ( name == VCGivenNameProp ) | 232 | else if ( name == VCFamilyNameProp ) |
442 | c.setFirstName( value ); | 233 | c.setLastName( value ); |
443 | else if ( name == VCAdditionalNamesProp ) | 234 | else if ( name == VCGivenNameProp ) |
444 | c.setMiddleName( value ); | 235 | c.setFirstName( value ); |
445 | } | 236 | else if ( name == VCAdditionalNamesProp ) |
446 | } | 237 | c.setMiddleName( value ); |
447 | else if ( name == VCAdrProp ) { | 238 | } |
448 | bool work = TRUE; // default address is work address | 239 | } |
449 | QString street; | 240 | else if ( name == VCAdrProp ) { |
450 | QString city; | 241 | bool work = TRUE; // default address is work address |
451 | QString region; | 242 | QString street; |
452 | QString postal; | 243 | QString city; |
453 | QString country; | 244 | QString region; |
454 | 245 | QString postal; | |
455 | VObjectIterator nit; | 246 | QString country; |
456 | initPropIterator( &nit, o ); | 247 | |
457 | while( moreIteration( &nit ) ) { | 248 | VObjectIterator nit; |
458 | VObject *o = nextVObject( &nit ); | 249 | initPropIterator( &nit, o ); |
459 | QCString name = vObjectName( o ); | 250 | while( moreIteration( &nit ) ) { |
460 | QString value = vObjectStringZValue( o ); | 251 | VObject *o = nextVObject( &nit ); |
461 | if ( name == VCHomeProp ) | 252 | QCString name = vObjectName( o ); |
462 | work = FALSE; | 253 | QString value = QString::fromUtf8( vObjectStringZValue( o ) ); |
463 | else if ( name == VCWorkProp ) | 254 | if ( name == VCHomeProp ) |
464 | work = TRUE; | 255 | work = FALSE; |
465 | else if ( name == VCStreetAddressProp ) | 256 | else if ( name == VCWorkProp ) |
466 | street = value; | 257 | work = TRUE; |
467 | else if ( name == VCCityProp ) | 258 | else if ( name == VCStreetAddressProp ) |
468 | city = value; | 259 | street = value; |
469 | else if ( name == VCRegionProp ) | 260 | else if ( name == VCCityProp ) |
470 | region = value; | 261 | city = value; |
471 | else if ( name == VCPostalCodeProp ) | 262 | else if ( name == VCRegionProp ) |
472 | postal = value; | 263 | region = value; |
473 | else if ( name == VCCountryNameProp ) | 264 | else if ( name == VCPostalCodeProp ) |
474 | country = value; | 265 | postal = value; |
475 | } | 266 | else if ( name == VCCountryNameProp ) |
476 | if ( work ) { | 267 | country = value; |
477 | c.setBusinessStreet( street ); | 268 | } |
478 | c.setBusinessCity( city ); | 269 | if ( work ) { |
479 | c.setBusinessCountry( country ); | 270 | c.setBusinessStreet( street ); |
480 | c.setBusinessZip( postal ); | 271 | c.setBusinessCity( city ); |
481 | c.setBusinessState( region ); | 272 | c.setBusinessCountry( country ); |
482 | } else { | 273 | c.setBusinessZip( postal ); |
483 | c.setHomeStreet( street ); | 274 | c.setBusinessState( region ); |
484 | c.setHomeCity( city ); | 275 | } else { |
485 | c.setHomeCountry( country ); | 276 | c.setHomeStreet( street ); |
486 | c.setHomeZip( postal ); | 277 | c.setHomeCity( city ); |
487 | c.setHomeState( region ); | 278 | c.setHomeCountry( country ); |
488 | } | 279 | c.setHomeZip( postal ); |
489 | } | 280 | c.setHomeState( region ); |
490 | else if ( name == VCTelephoneProp ) { | 281 | } |
491 | enum { | 282 | } |
492 | HOME = 0x01, | 283 | else if ( name == VCTelephoneProp ) { |
493 | WORK = 0x02, | 284 | enum { |
494 | VOICE = 0x04, | 285 | HOME = 0x01, |
495 | CELL = 0x08, | 286 | WORK = 0x02, |
496 | FAX = 0x10, | 287 | VOICE = 0x04, |
497 | PAGER = 0x20, | 288 | CELL = 0x08, |
498 | UNKNOWN = 0x80 | 289 | FAX = 0x10, |
499 | }; | 290 | PAGER = 0x20, |
500 | int type = 0; | 291 | UNKNOWN = 0x80 |
501 | 292 | }; | |
502 | VObjectIterator nit; | 293 | int type = 0; |
503 | initPropIterator( &nit, o ); | 294 | |
504 | while( moreIteration( &nit ) ) { | 295 | VObjectIterator nit; |
505 | VObject *o = nextVObject( &nit ); | 296 | initPropIterator( &nit, o ); |
506 | QCString name = vObjectTypeInfo( o ); | 297 | while( moreIteration( &nit ) ) { |
507 | if ( name == VCHomeProp ) | 298 | VObject *o = nextVObject( &nit ); |
508 | type |= HOME; | 299 | QCString name = vObjectTypeInfo( o ); |
509 | else if ( name == VCWorkProp ) | 300 | if ( name == VCHomeProp ) |
510 | type |= WORK; | 301 | type |= HOME; |
511 | else if ( name == VCVoiceProp ) | 302 | else if ( name == VCWorkProp ) |
512 | type |= VOICE; | 303 | type |= WORK; |
513 | else if ( name == VCCellularProp ) | 304 | else if ( name == VCVoiceProp ) |
514 | type |= CELL; | 305 | type |= VOICE; |
515 | else if ( name == VCFaxProp ) | 306 | else if ( name == VCCellularProp ) |
516 | type |= FAX; | 307 | type |= CELL; |
517 | else if ( name == VCPagerProp ) | 308 | else if ( name == VCFaxProp ) |
518 | type |= PAGER; | 309 | type |= FAX; |
519 | else if ( name == VCPreferredProp ) | 310 | else if ( name == VCPagerProp ) |
520 | ; | 311 | type |= PAGER; |
521 | else | 312 | else if ( name == VCPreferredProp ) |
522 | type |= UNKNOWN; | 313 | ; |
523 | } | 314 | else |
524 | if ( (type & UNKNOWN) != UNKNOWN ) { | 315 | type |= UNKNOWN; |
525 | if ( ( type & (HOME|WORK) ) == 0 ) // default | 316 | } |
526 | type |= HOME; | 317 | if ( (type & UNKNOWN) != UNKNOWN ) { |
527 | if ( ( type & (VOICE|CELL|FAX|PAGER) ) == 0 ) // default | 318 | if ( ( type & (HOME|WORK) ) == 0 ) // default |
528 | type |= VOICE; | 319 | type |= HOME; |
529 | 320 | if ( ( type & (VOICE|CELL|FAX|PAGER) ) == 0 ) // default | |
530 | owarn << "value " << value.data() << " " << type << "" << oendl; | 321 | type |= VOICE; |
531 | if ( (type & (VOICE|HOME) ) == (VOICE|HOME) && (type & (CELL|HOME) ) != (CELL|HOME) ) | 322 | |
532 | c.setHomePhone( value ); | 323 | owarn << "value %s %d" << value.data() << type << oendl; |
533 | if ( ( type & (FAX|HOME) ) == (FAX|HOME) ) | 324 | if ( (type & (VOICE|HOME) ) == (VOICE|HOME) && (type & (CELL|HOME) ) != (CELL|HOME) ) |
534 | c.setHomeFax( value ); | 325 | c.setHomePhone( value ); |
535 | if ( ( type & (CELL|HOME) ) == (CELL|HOME) ) | 326 | if ( ( type & (FAX|HOME) ) == (FAX|HOME) ) |
536 | c.setHomeMobile( value ); | 327 | c.setHomeFax( value ); |
537 | if ( ( type & (VOICE|WORK) ) == (VOICE|WORK) && (type & (CELL|WORK) ) != (CELL|WORK) ) | 328 | if ( ( type & (CELL|HOME) ) == (CELL|HOME) ) |
538 | c.setBusinessPhone( value ); | 329 | c.setHomeMobile( value ); |
539 | if ( ( type & (FAX|WORK) ) == (FAX|WORK) ) | 330 | if ( ( type & (VOICE|WORK) ) == (VOICE|WORK) && (type & (CELL|WORK) ) != (CELL|WORK) ) |
540 | c.setBusinessFax( value ); | 331 | c.setBusinessPhone( value ); |
541 | if ( ( type & (CELL|WORK) ) == (CELL|WORK) ) | 332 | if ( ( type & (FAX|WORK) ) == (FAX|WORK) ) |
542 | c.setBusinessMobile( value ); | 333 | c.setBusinessFax( value ); |
543 | if ( ( type & (PAGER|WORK) ) == (PAGER|WORK) ) | 334 | if ( ( type & (CELL|WORK) ) == (CELL|WORK) ) |
544 | c.setBusinessPager( value ); | 335 | c.setBusinessMobile( value ); |
545 | } | 336 | if ( ( type & (PAGER|WORK) ) == (PAGER|WORK) ) |
546 | } | 337 | c.setBusinessPager( value ); |
547 | else if ( name == VCEmailAddressProp ) { | 338 | } |
548 | QString email = vObjectStringZValue( o ); | 339 | } |
549 | bool valid = TRUE; | 340 | else if ( name == VCEmailAddressProp ) { |
550 | VObjectIterator nit; | 341 | QString email = QString::fromUtf8( vObjectStringZValue( o ) ); |
551 | initPropIterator( &nit, o ); | 342 | bool valid = TRUE; |
552 | while( moreIteration( &nit ) ) { | 343 | VObjectIterator nit; |
553 | VObject *o = nextVObject( &nit ); | 344 | initPropIterator( &nit, o ); |
554 | QCString name = vObjectTypeInfo( o ); | 345 | while( moreIteration( &nit ) ) { |
555 | if ( name != VCInternetProp && name != VCHomeProp && | 346 | VObject *o = nextVObject( &nit ); |
556 | name != VCWorkProp && | 347 | QCString name = vObjectTypeInfo( o ); |
557 | name != VCPreferredProp ) | 348 | if ( name != VCInternetProp && name != VCHomeProp && |
558 | // ### preffered should map to default email | 349 | name != VCWorkProp && |
559 | valid = FALSE; | 350 | name != VCPreferredProp ) |
560 | } | 351 | // ### preffered should map to default email |
561 | if ( valid ) { | 352 | valid = FALSE; |
562 | c.insertEmail( email ); | 353 | } |
563 | } | 354 | if ( valid ) { |
564 | } | 355 | c.insertEmail( email ); |
565 | else if ( name == VCURLProp ) { | 356 | } |
566 | VObjectIterator nit; | 357 | } |
567 | initPropIterator( &nit, o ); | 358 | else if ( name == VCURLProp ) { |
568 | while( moreIteration( &nit ) ) { | 359 | VObjectIterator nit; |
569 | VObject *o = nextVObject( &nit ); | 360 | initPropIterator( &nit, o ); |
570 | QCString name = vObjectTypeInfo( o ); | 361 | while( moreIteration( &nit ) ) { |
571 | if ( name == VCHomeProp ) | 362 | VObject *o = nextVObject( &nit ); |
572 | c.setHomeWebpage( value ); | 363 | QCString name = vObjectTypeInfo( o ); |
573 | else if ( name == VCWorkProp ) | 364 | if ( name == VCHomeProp ) |
574 | c.setBusinessWebpage( value ); | 365 | c.setHomeWebpage( value ); |
575 | } | 366 | else if ( name == VCWorkProp ) |
576 | } | 367 | c.setBusinessWebpage( value ); |
577 | else if ( name == VCOrgProp ) { | 368 | } |
578 | VObjectIterator nit; | 369 | } |
579 | initPropIterator( &nit, o ); | 370 | else if ( name == VCOrgProp ) { |
580 | while( moreIteration( &nit ) ) { | 371 | VObjectIterator nit; |
581 | VObject *o = nextVObject( &nit ); | 372 | initPropIterator( &nit, o ); |
582 | QCString name = vObjectName( o ); | 373 | while( moreIteration( &nit ) ) { |
583 | QString value = vObjectStringZValue( o ); | 374 | VObject *o = nextVObject( &nit ); |
584 | if ( name == VCOrgNameProp ) | 375 | QCString name = vObjectName( o ); |
585 | c.setCompany( value ); | 376 | QString value = QString::fromUtf8( vObjectStringZValue( o ) ); |
586 | else if ( name == VCOrgUnitProp ) | 377 | if ( name == VCOrgNameProp ) |
587 | c.setDepartment( value ); | 378 | c.setCompany( value ); |
588 | else if ( name == VCOrgUnit2Prop ) | 379 | else if ( name == VCOrgUnitProp ) |
589 | c.setOffice( value ); | 380 | c.setDepartment( value ); |
590 | } | 381 | else if ( name == VCOrgUnit2Prop ) |
591 | } | 382 | c.setOffice( value ); |
592 | else if ( name == VCTitleProp ) { | 383 | } |
593 | c.setJobTitle( value ); | 384 | } |
594 | } | 385 | else if ( name == VCTitleProp ) { |
595 | else if ( name == "X-Qtopia-Profession" ) { | 386 | c.setJobTitle( value ); |
596 | c.setProfession( value ); | 387 | } |
597 | } | 388 | else if ( name == "X-Qtopia-Profession" ) { |
598 | else if ( name == "X-Qtopia-Manager" ) { | 389 | c.setProfession( value ); |
599 | c.setManager( value ); | 390 | } |
600 | } | 391 | else if ( name == "X-Qtopia-Manager" ) { |
601 | else if ( name == "X-Qtopia-Assistant" ) { | 392 | c.setManager( value ); |
602 | c.setAssistant( value ); | 393 | } |
603 | } | 394 | else if ( name == "X-Qtopia-Assistant" ) { |
604 | else if ( name == "X-Qtopia-Spouse" ) { | 395 | c.setAssistant( value ); |
605 | c.setSpouse( value ); | 396 | } |
606 | } | 397 | else if ( name == "X-Qtopia-Spouse" ) { |
607 | else if ( name == "X-Qtopia-Gender" ) { | 398 | c.setSpouse( value ); |
608 | c.setGender( value ); | 399 | } |
609 | } | 400 | else if ( name == "X-Qtopia-Gender" ) { |
610 | else if ( name == "X-Qtopia-Anniversary" ) { | 401 | c.setGender( value ); |
611 | c.setAnniversary( convVCardDateToDate( value ) ); | 402 | } |
612 | } | 403 | else if ( name == "X-Qtopia-Anniversary" ) { |
613 | else if ( name == "X-Qtopia-Nickname" ) { | 404 | c.setAnniversary( convVCardDateToDate( value ) ); |
614 | c.setNickname( value ); | 405 | } |
615 | } | 406 | else if ( name == "X-Qtopia-Nickname" ) { |
616 | else if ( name == "X-Qtopia-Children" ) { | 407 | c.setNickname( value ); |
617 | c.setChildren( value ); | 408 | } |
618 | } | 409 | else if ( name == "X-Qtopia-Children" ) { |
619 | else if ( name == VCBirthDateProp ) { | 410 | c.setChildren( value ); |
620 | // Reading Birthdate regarding RFC 2425 (5.8.4) | 411 | } |
621 | c.setBirthday( convVCardDateToDate( value ) ); | 412 | else if ( name == VCBirthDateProp ) { |
622 | 413 | // Reading Birthdate regarding RFC 2425 (5.8.4) | |
623 | } | 414 | c.setBirthday( convVCardDateToDate( value ) ); |
624 | else if ( name == VCCommentProp ) { | 415 | |
625 | c.setNotes( value ); | 416 | } |
626 | } | 417 | else if ( name == VCCommentProp ) { |
627 | >>>>>>> 1.15 | 418 | c.setNotes( value ); |
419 | } | ||
628 | #if 0 | 420 | #if 0 |
629 | <<<<<<< ocontactaccessbackend_vcard.cpp | 421 | else { |
630 | else { | 422 | printf("Name: %s, value=%s\n", name.data(), QString::fromUtf8( vObjectStringZValue( o ) ) ); |
631 | printf("Name: %s, value=%s\n", name.data(), QString::fromUtf8( vObjectStringZValue( o ) ) ); | 423 | VObjectIterator nit; |
632 | VObjectIterator nit; | 424 | initPropIterator( &nit, o ); |
633 | initPropIterator( &nit, o ); | 425 | while( moreIteration( &nit ) ) { |
634 | while( moreIteration( &nit ) ) { | 426 | VObject *o = nextVObject( &nit ); |
635 | VObject *o = nextVObject( &nit ); | 427 | QCString name = vObjectName( o ); |
636 | QCString name = vObjectName( o ); | 428 | QString value = QString::fromUtf8( vObjectStringZValue( o ) ); |
637 | QString value = QString::fromUtf8( vObjectStringZValue( o ) ); | 429 | printf(" subprop: %s = %s\n", name.data(), value.latin1() ); |
638 | printf(" subprop: %s = %s\n", name.data(), value.latin1() ); | 430 | } |
639 | } | 431 | } |
640 | } | ||
641 | ======= | ||
642 | else { | 432 | else { |
643 | printf("Name: %s, value=%s\n", name.data(), vObjectStringZValue( o ) ); | 433 | printf("Name: %s, value=%s\n", name.data(), vObjectStringZValue( o ) ); |
644 | VObjectIterator nit; | 434 | VObjectIterator nit; |
645 | initPropIterator( &nit, o ); | 435 | initPropIterator( &nit, o ); |
646 | while( moreIteration( &nit ) ) { | 436 | while( moreIteration( &nit ) ) { |
647 | VObject *o = nextVObject( &nit ); | 437 | VObject *o = nextVObject( &nit ); |
648 | QCString name = vObjectName( o ); | 438 | QCString name = vObjectName( o ); |
649 | QString value = vObjectStringZValue( o ); | 439 | QString value = vObjectStringZValue( o ); |
650 | printf(" subprop: %s = %s\n", name.data(), value.latin1() ); | 440 | printf(" subprop: %s = %s\n", name.data(), value.latin1() ); |
651 | } | 441 | } |
652 | } | 442 | } |
653 | >>>>>>> 1.15 | ||
654 | #endif | 443 | #endif |
655 | } | 444 | } |
656 | c.setFileAs(); | 445 | c.setFileAs(); |