summaryrefslogtreecommitdiff
authoreilers <eilers>2003-09-08 12:42:26 (UTC)
committer eilers <eilers>2003-09-08 12:42:26 (UTC)
commit913788f77c3f501778b7653317a4a6b06452961d (patch) (unidiff)
treeb9393e5b7eefb87f3a421a17035b702a6b688eb7
parent7fb091e12eec52e3d73896c728fc011fe40a3eb4 (diff)
downloadopie-913788f77c3f501778b7653317a4a6b06452961d.zip
opie-913788f77c3f501778b7653317a4a6b06452961d.tar.gz
opie-913788f77c3f501778b7653317a4a6b06452961d.tar.bz2
Fixing bug #1161: No space between jobtitle and organization
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/ocontact.cpp12
-rw-r--r--libopie2/opiepim/ocontact.cpp12
2 files changed, 8 insertions, 16 deletions
diff --git a/libopie/pim/ocontact.cpp b/libopie/pim/ocontact.cpp
index 0f05b65..fcf3b26 100644
--- a/libopie/pim/ocontact.cpp
+++ b/libopie/pim/ocontact.cpp
@@ -195,525 +195,521 @@ OContact::~OContact()
195*/ 195*/
196 196
197/*! \fn void OContact::setBusinessMobile( const QString &str ) 197/*! \fn void OContact::setBusinessMobile( const QString &str )
198 Sets the business mobile phone number of the contact to \a str. 198 Sets the business mobile phone number of the contact to \a str.
199*/ 199*/
200 200
201/*! \fn void OContact::setBusinessPager( const QString &str ) 201/*! \fn void OContact::setBusinessPager( const QString &str )
202 Sets the business pager number of the contact to \a str. 202 Sets the business pager number of the contact to \a str.
203*/ 203*/
204 204
205/*! \fn void OContact::setBusinessWebpage( const QString &str ) 205/*! \fn void OContact::setBusinessWebpage( const QString &str )
206 Sets the business webpage of the contact to \a str. 206 Sets the business webpage of the contact to \a str.
207*/ 207*/
208 208
209/*! \fn void OContact::setProfession( const QString &str ) 209/*! \fn void OContact::setProfession( const QString &str )
210 Sets the profession of the contact to \a str. 210 Sets the profession of the contact to \a str.
211*/ 211*/
212 212
213/*! \fn void OContact::setAssistant( const QString &str ) 213/*! \fn void OContact::setAssistant( const QString &str )
214 Sets the assistant of the contact to \a str. 214 Sets the assistant of the contact to \a str.
215*/ 215*/
216 216
217/*! \fn void OContact::setManager( const QString &str ) 217/*! \fn void OContact::setManager( const QString &str )
218 Sets the manager of the contact to \a str. 218 Sets the manager of the contact to \a str.
219*/ 219*/
220 220
221/*! \fn void OContact::setSpouse( const QString &str ) 221/*! \fn void OContact::setSpouse( const QString &str )
222 Sets the spouse of the contact to \a str. 222 Sets the spouse of the contact to \a str.
223*/ 223*/
224 224
225/*! \fn void OContact::setGender( const QString &str ) 225/*! \fn void OContact::setGender( const QString &str )
226 Sets the gender of the contact to \a str. 226 Sets the gender of the contact to \a str.
227*/ 227*/
228 228
229/*! \fn void OContact::setNickname( const QString &str ) 229/*! \fn void OContact::setNickname( const QString &str )
230 Sets the nickname of the contact to \a str. 230 Sets the nickname of the contact to \a str.
231*/ 231*/
232 232
233/*! \fn void OContact::setNotes( const QString &str ) 233/*! \fn void OContact::setNotes( const QString &str )
234 Sets the notes about the contact to \a str. 234 Sets the notes about the contact to \a str.
235*/ 235*/
236 236
237/*! \fn QString OContact::title() const 237/*! \fn QString OContact::title() const
238 Returns the title of the contact. 238 Returns the title of the contact.
239*/ 239*/
240 240
241/*! \fn QString OContact::firstName() const 241/*! \fn QString OContact::firstName() const
242 Returns the first name of the contact. 242 Returns the first name of the contact.
243*/ 243*/
244 244
245/*! \fn QString OContact::middleName() const 245/*! \fn QString OContact::middleName() const
246 Returns the middle name of the contact. 246 Returns the middle name of the contact.
247*/ 247*/
248 248
249/*! \fn QString OContact::lastName() const 249/*! \fn QString OContact::lastName() const
250 Returns the last name of the contact. 250 Returns the last name of the contact.
251*/ 251*/
252 252
253/*! \fn QString OContact::suffix() const 253/*! \fn QString OContact::suffix() const
254 Returns the suffix of the contact. 254 Returns the suffix of the contact.
255*/ 255*/
256 256
257/*! \fn QString OContact::fileAs() const 257/*! \fn QString OContact::fileAs() const
258 Returns the string the contact is filed as. 258 Returns the string the contact is filed as.
259*/ 259*/
260 260
261/*! \fn QString OContact::defaultEmail() const 261/*! \fn QString OContact::defaultEmail() const
262 Returns the default email address of the contact. 262 Returns the default email address of the contact.
263*/ 263*/
264 264
265/*! \fn QString OContact::emails() const 265/*! \fn QString OContact::emails() const
266 Returns the list of email address for a contact separated by ';'s in a single 266 Returns the list of email address for a contact separated by ';'s in a single
267 string. 267 string.
268*/ 268*/
269 269
270/*! \fn QString OContact::homeStreet() const 270/*! \fn QString OContact::homeStreet() const
271 Returns the home street address of the contact. 271 Returns the home street address of the contact.
272*/ 272*/
273 273
274/*! \fn QString OContact::homeCity() const 274/*! \fn QString OContact::homeCity() const
275 Returns the home city of the contact. 275 Returns the home city of the contact.
276*/ 276*/
277 277
278/*! \fn QString OContact::homeState() const 278/*! \fn QString OContact::homeState() const
279 Returns the home state of the contact. 279 Returns the home state of the contact.
280*/ 280*/
281 281
282/*! \fn QString OContact::homeZip() const 282/*! \fn QString OContact::homeZip() const
283 Returns the home zip of the contact. 283 Returns the home zip of the contact.
284*/ 284*/
285 285
286/*! \fn QString OContact::homeCountry() const 286/*! \fn QString OContact::homeCountry() const
287 Returns the home country of the contact. 287 Returns the home country of the contact.
288*/ 288*/
289 289
290/*! \fn QString OContact::homePhone() const 290/*! \fn QString OContact::homePhone() const
291 Returns the home phone number of the contact. 291 Returns the home phone number of the contact.
292*/ 292*/
293 293
294/*! \fn QString OContact::homeFax() const 294/*! \fn QString OContact::homeFax() const
295 Returns the home fax number of the contact. 295 Returns the home fax number of the contact.
296*/ 296*/
297 297
298/*! \fn QString OContact::homeMobile() const 298/*! \fn QString OContact::homeMobile() const
299 Returns the home mobile number of the contact. 299 Returns the home mobile number of the contact.
300*/ 300*/
301 301
302/*! \fn QString OContact::homeWebpage() const 302/*! \fn QString OContact::homeWebpage() const
303 Returns the home webpage of the contact. 303 Returns the home webpage of the contact.
304*/ 304*/
305 305
306/*! \fn QString OContact::company() const 306/*! \fn QString OContact::company() const
307 Returns the company for the contact. 307 Returns the company for the contact.
308*/ 308*/
309 309
310/*! \fn QString OContact::department() const 310/*! \fn QString OContact::department() const
311 Returns the department for the contact. 311 Returns the department for the contact.
312*/ 312*/
313 313
314/*! \fn QString OContact::office() const 314/*! \fn QString OContact::office() const
315 Returns the office for the contact. 315 Returns the office for the contact.
316*/ 316*/
317 317
318/*! \fn QString OContact::jobTitle() const 318/*! \fn QString OContact::jobTitle() const
319 Returns the job title of the contact. 319 Returns the job title of the contact.
320*/ 320*/
321 321
322/*! \fn QString OContact::profession() const 322/*! \fn QString OContact::profession() const
323 Returns the profession of the contact. 323 Returns the profession of the contact.
324*/ 324*/
325 325
326/*! \fn QString OContact::assistant() const 326/*! \fn QString OContact::assistant() const
327 Returns the assistant of the contact. 327 Returns the assistant of the contact.
328*/ 328*/
329 329
330/*! \fn QString OContact::manager() const 330/*! \fn QString OContact::manager() const
331 Returns the manager of the contact. 331 Returns the manager of the contact.
332*/ 332*/
333 333
334/*! \fn QString OContact::businessStreet() const 334/*! \fn QString OContact::businessStreet() const
335 Returns the business street address of the contact. 335 Returns the business street address of the contact.
336*/ 336*/
337 337
338/*! \fn QString OContact::businessCity() const 338/*! \fn QString OContact::businessCity() const
339 Returns the business city of the contact. 339 Returns the business city of the contact.
340*/ 340*/
341 341
342/*! \fn QString OContact::businessState() const 342/*! \fn QString OContact::businessState() const
343 Returns the business state of the contact. 343 Returns the business state of the contact.
344*/ 344*/
345 345
346/*! \fn QString OContact::businessZip() const 346/*! \fn QString OContact::businessZip() const
347 Returns the business zip of the contact. 347 Returns the business zip of the contact.
348*/ 348*/
349 349
350/*! \fn QString OContact::businessCountry() const 350/*! \fn QString OContact::businessCountry() const
351 Returns the business country of the contact. 351 Returns the business country of the contact.
352*/ 352*/
353 353
354/*! \fn QString OContact::businessPhone() const 354/*! \fn QString OContact::businessPhone() const
355 Returns the business phone number of the contact. 355 Returns the business phone number of the contact.
356*/ 356*/
357 357
358/*! \fn QString OContact::businessFax() const 358/*! \fn QString OContact::businessFax() const
359 Returns the business fax number of the contact. 359 Returns the business fax number of the contact.
360*/ 360*/
361 361
362/*! \fn QString OContact::businessMobile() const 362/*! \fn QString OContact::businessMobile() const
363 Returns the business mobile number of the contact. 363 Returns the business mobile number of the contact.
364*/ 364*/
365 365
366/*! \fn QString OContact::businessPager() const 366/*! \fn QString OContact::businessPager() const
367 Returns the business pager number of the contact. 367 Returns the business pager number of the contact.
368*/ 368*/
369 369
370/*! \fn QString OContact::businessWebpage() const 370/*! \fn QString OContact::businessWebpage() const
371 Returns the business webpage of the contact. 371 Returns the business webpage of the contact.
372*/ 372*/
373 373
374/*! \fn QString OContact::spouse() const 374/*! \fn QString OContact::spouse() const
375 Returns the spouse of the contact. 375 Returns the spouse of the contact.
376*/ 376*/
377 377
378/*! \fn QString OContact::gender() const 378/*! \fn QString OContact::gender() const
379 Returns the gender of the contact. 379 Returns the gender of the contact.
380*/ 380*/
381 381
382/*! \fn QString OContact::nickname() const 382/*! \fn QString OContact::nickname() const
383 Returns the nickname of the contact. 383 Returns the nickname of the contact.
384*/ 384*/
385 385
386/*! \fn QString OContact::children() const 386/*! \fn QString OContact::children() const
387 Returns the children of the contact. 387 Returns the children of the contact.
388*/ 388*/
389 389
390/*! \fn QString OContact::notes() const 390/*! \fn QString OContact::notes() const
391 Returns the notes relating to the the contact. 391 Returns the notes relating to the the contact.
392*/ 392*/
393 393
394/*! \fn QString OContact::groups() const 394/*! \fn QString OContact::groups() const
395 \internal 395 \internal
396 Returns the groups for the contact. 396 Returns the groups for the contact.
397*/ 397*/
398 398
399/*! \fn QStringList OContact::groupList() const 399/*! \fn QStringList OContact::groupList() const
400 \internal 400 \internal
401*/ 401*/
402 402
403/*! \fn QString OContact::field(int) const 403/*! \fn QString OContact::field(int) const
404 \internal 404 \internal
405*/ 405*/
406 406
407/*! \fn void OContact::saveJournal( journal_action, const QString & = QString::null ) 407/*! \fn void OContact::saveJournal( journal_action, const QString & = QString::null )
408 \internal 408 \internal
409*/ 409*/
410 410
411/*! \fn void OContact::setUid( int id ) 411/*! \fn void OContact::setUid( int id )
412 \internal 412 \internal
413 Sets the uid for this record to \a id. 413 Sets the uid for this record to \a id.
414*/ 414*/
415 415
416/*! \enum OContact::journal_action 416/*! \enum OContact::journal_action
417 \internal 417 \internal
418*/ 418*/
419 419
420/*! 420/*!
421 \internal 421 \internal
422*/ 422*/
423QMap<int, QString> OContact::toMap() const 423QMap<int, QString> OContact::toMap() const
424{ 424{
425 QMap<int, QString> map = mMap; 425 QMap<int, QString> map = mMap;
426 QString cats = idsToString( categories() ); 426 QString cats = idsToString( categories() );
427 if ( !cats.isEmpty() ) 427 if ( !cats.isEmpty() )
428 map.insert( Qtopia::AddressCategory, cats ); 428 map.insert( Qtopia::AddressCategory, cats );
429 return map; 429 return map;
430} 430}
431 431
432/*! 432/*!
433 Returns a rich text formatted QString representing the contents the contact. 433 Returns a rich text formatted QString representing the contents the contact.
434*/ 434*/
435QString OContact::toRichText() const 435QString OContact::toRichText() const
436{ 436{
437 QString text; 437 QString text;
438 QString value, comp, state; 438 QString value, comp, state;
439 QString str; 439 QString str;
440 bool marker = false; 440 bool marker = false;
441 441
442 Config cfg("qpe"); 442 Config cfg("qpe");
443 cfg.setGroup("Appearance"); 443 cfg.setGroup("Appearance");
444 int addressformat = cfg.readNumEntry( "AddressFormat", Zip_City_State ); 444 int addressformat = cfg.readNumEntry( "AddressFormat", Zip_City_State );
445 445
446 // name, jobtitle and company 446 // name, jobtitle and company
447 if ( !(value = fullName()).isEmpty() ) 447 if ( !(value = fullName()).isEmpty() )
448 text += "<b><h3><img src=\"addressbook/AddressBook\"> " + Qtopia::escapeString(value) + "</h3></b>"; 448 text += "<b><h3><img src=\"addressbook/AddressBook\"> " + Qtopia::escapeString(value) + "</h3></b>";
449 449
450 if ( !(value = jobTitle()).isEmpty() ) 450 if ( !(value = jobTitle()).isEmpty() )
451 text += Qtopia::escapeString(value); 451 text += Qtopia::escapeString(value) + " ";
452 452
453 comp = company(); 453 comp = company();
454 if ( !(value = department()).isEmpty() ) { 454 if ( !(value = department()).isEmpty() ) {
455 text += Qtopia::escapeString(value); 455 text += Qtopia::escapeString(value);
456 if ( comp ) 456 if ( comp )
457 text += ", "; 457 text += ", " + Qtopia::escapeString(comp);
458 else 458 }else if ( comp )
459 text += "<br>"; 459 text += "<br>" + Qtopia::escapeString(comp);
460 }
461 if ( !comp.isEmpty() )
462 text += Qtopia::escapeString(comp);
463
464 text += "<br><hr>"; 460 text += "<br><hr>";
465 461
466 // defailt email 462 // defailt email
467 QString defEmail = defaultEmail(); 463 QString defEmail = defaultEmail();
468 if ( !defEmail.isEmpty() ){ 464 if ( !defEmail.isEmpty() ){
469 text += "<b><img src=\"addressbook/email\"> " + QObject::tr("Default Email: ") + "</b>" 465 text += "<b><img src=\"addressbook/email\"> " + QObject::tr("Default Email: ") + "</b>"
470 + Qtopia::escapeString(defEmail); 466 + Qtopia::escapeString(defEmail);
471 marker = true; 467 marker = true;
472 } 468 }
473 469
474 // business address 470 // business address
475 if ( !businessStreet().isEmpty() || !businessCity().isEmpty() || 471 if ( !businessStreet().isEmpty() || !businessCity().isEmpty() ||
476 !businessZip().isEmpty() || !businessCountry().isEmpty() ) { 472 !businessZip().isEmpty() || !businessCountry().isEmpty() ) {
477 text += QObject::tr( "<br><b>Work Address:</b>" ); 473 text += QObject::tr( "<br><b>Work Address:</b>" );
478 marker = true; 474 marker = true;
479 } 475 }
480 476
481 if ( !(value = businessStreet()).isEmpty() ){ 477 if ( !(value = businessStreet()).isEmpty() ){
482 text += "<br>" + Qtopia::escapeString(value); 478 text += "<br>" + Qtopia::escapeString(value);
483 marker = true; 479 marker = true;
484 } 480 }
485 481
486 switch( addressformat ){ 482 switch( addressformat ){
487 case Zip_City_State:{ // Zip_Code City, State 483 case Zip_City_State:{ // Zip_Code City, State
488 state = businessState(); 484 state = businessState();
489 if ( !(value = businessZip()).isEmpty() ){ 485 if ( !(value = businessZip()).isEmpty() ){
490 text += "<br>" + Qtopia::escapeString(value) + " "; 486 text += "<br>" + Qtopia::escapeString(value) + " ";
491 marker = true; 487 marker = true;
492 488
493 } 489 }
494 if ( !(value = businessCity()).isEmpty() ) { 490 if ( !(value = businessCity()).isEmpty() ) {
495 marker = true; 491 marker = true;
496 if ( businessZip().isEmpty() && !businessStreet().isEmpty() ) 492 if ( businessZip().isEmpty() && !businessStreet().isEmpty() )
497 text += "<br>"; 493 text += "<br>";
498 text += Qtopia::escapeString(value); 494 text += Qtopia::escapeString(value);
499 if ( state ) 495 if ( state )
500 text += ", " + Qtopia::escapeString(state); 496 text += ", " + Qtopia::escapeString(state);
501 } else if ( !state.isEmpty() ){ 497 } else if ( !state.isEmpty() ){
502 text += "<br>" + Qtopia::escapeString(state); 498 text += "<br>" + Qtopia::escapeString(state);
503 marker = true; 499 marker = true;
504 } 500 }
505 break; 501 break;
506 } 502 }
507 case City_State_Zip:{ // City, State Zip_Code 503 case City_State_Zip:{ // City, State Zip_Code
508 state = businessState(); 504 state = businessState();
509 if ( !(value = businessCity()).isEmpty() ) { 505 if ( !(value = businessCity()).isEmpty() ) {
510 marker = true; 506 marker = true;
511 text += "<br>" + Qtopia::escapeString(value); 507 text += "<br>" + Qtopia::escapeString(value);
512 if ( state ) 508 if ( state )
513 text += ", " + Qtopia::escapeString(state); 509 text += ", " + Qtopia::escapeString(state);
514 } else if ( !state.isEmpty() ){ 510 } else if ( !state.isEmpty() ){
515 text += "<br>" + Qtopia::escapeString(state); 511 text += "<br>" + Qtopia::escapeString(state);
516 marker = true; 512 marker = true;
517 } 513 }
518 if ( !(value = businessZip()).isEmpty() ){ 514 if ( !(value = businessZip()).isEmpty() ){
519 text += " " + Qtopia::escapeString(value); 515 text += " " + Qtopia::escapeString(value);
520 marker = true; 516 marker = true;
521 } 517 }
522 break; 518 break;
523 } 519 }
524 } 520 }
525 521
526 if ( !(value = businessCountry()).isEmpty() ){ 522 if ( !(value = businessCountry()).isEmpty() ){
527 text += "<br>" + Qtopia::escapeString(value); 523 text += "<br>" + Qtopia::escapeString(value);
528 marker = true; 524 marker = true;
529 } 525 }
530 526
531 // rest of Business data 527 // rest of Business data
532 str = office(); 528 str = office();
533 if ( !str.isEmpty() ){ 529 if ( !str.isEmpty() ){
534 text += "<br><b>" + QObject::tr("Office: ") + "</b>" 530 text += "<br><b>" + QObject::tr("Office: ") + "</b>"
535 + Qtopia::escapeString(str); 531 + Qtopia::escapeString(str);
536 marker = true; 532 marker = true;
537 } 533 }
538 str = businessWebpage(); 534 str = businessWebpage();
539 if ( !str.isEmpty() ){ 535 if ( !str.isEmpty() ){
540 text += "<br><b><img src=\"addressbook/webpagework\"> " + QObject::tr("Business Web Page: ") + "</b>" 536 text += "<br><b><img src=\"addressbook/webpagework\"> " + QObject::tr("Business Web Page: ") + "</b>"
541 + Qtopia::escapeString(str); 537 + Qtopia::escapeString(str);
542 marker = true; 538 marker = true;
543 } 539 }
544 str = businessPhone(); 540 str = businessPhone();
545 if ( !str.isEmpty() ){ 541 if ( !str.isEmpty() ){
546 text += "<br><b><img src=\"addressbook/phonework\"> " + QObject::tr("Business Phone: ") + "</b>" 542 text += "<br><b><img src=\"addressbook/phonework\"> " + QObject::tr("Business Phone: ") + "</b>"
547 + Qtopia::escapeString(str); 543 + Qtopia::escapeString(str);
548 marker = true; 544 marker = true;
549 } 545 }
550 str = businessFax(); 546 str = businessFax();
551 if ( !str.isEmpty() ){ 547 if ( !str.isEmpty() ){
552 text += "<br><b><img src=\"addressbook/faxwork\"> " + QObject::tr("Business Fax: ") + "</b>" 548 text += "<br><b><img src=\"addressbook/faxwork\"> " + QObject::tr("Business Fax: ") + "</b>"
553 + Qtopia::escapeString(str); 549 + Qtopia::escapeString(str);
554 marker = true; 550 marker = true;
555 } 551 }
556 str = businessMobile(); 552 str = businessMobile();
557 if ( !str.isEmpty() ){ 553 if ( !str.isEmpty() ){
558 text += "<br><b><img src=\"addressbook/mobilework\"> " + QObject::tr("Business Mobile: ") + "</b>" 554 text += "<br><b><img src=\"addressbook/mobilework\"> " + QObject::tr("Business Mobile: ") + "</b>"
559 + Qtopia::escapeString(str); 555 + Qtopia::escapeString(str);
560 marker = true; 556 marker = true;
561 } 557 }
562 str = businessPager(); 558 str = businessPager();
563 if ( !str.isEmpty() ){ 559 if ( !str.isEmpty() ){
564 text += "<br><b>" + QObject::tr("Business Pager: ") + "</b>" 560 text += "<br><b>" + QObject::tr("Business Pager: ") + "</b>"
565 + Qtopia::escapeString(str); 561 + Qtopia::escapeString(str);
566 marker = true; 562 marker = true;
567 } 563 }
568 564
569 // text += "<br>"; 565 // text += "<br>";
570 566
571 // home address 567 // home address
572 if ( !homeStreet().isEmpty() || !homeCity().isEmpty() || 568 if ( !homeStreet().isEmpty() || !homeCity().isEmpty() ||
573 !homeZip().isEmpty() || !homeCountry().isEmpty() ) { 569 !homeZip().isEmpty() || !homeCountry().isEmpty() ) {
574 text += QObject::tr( "<br><b>Home Address:</b>" ); 570 text += QObject::tr( "<br><b>Home Address:</b>" );
575 marker = true; 571 marker = true;
576 } 572 }
577 573
578 if ( !(value = homeStreet()).isEmpty() ){ 574 if ( !(value = homeStreet()).isEmpty() ){
579 text += "<br>" + Qtopia::escapeString(value); 575 text += "<br>" + Qtopia::escapeString(value);
580 marker = true; 576 marker = true;
581 } 577 }
582 578
583 switch( addressformat ){ 579 switch( addressformat ){
584 case Zip_City_State:{ // Zip_Code City, State 580 case Zip_City_State:{ // Zip_Code City, State
585 state = homeState(); 581 state = homeState();
586 if ( !(value = homeZip()).isEmpty() ){ 582 if ( !(value = homeZip()).isEmpty() ){
587 text += "<br>" + Qtopia::escapeString(value) + " "; 583 text += "<br>" + Qtopia::escapeString(value) + " ";
588 marker = true; 584 marker = true;
589 } 585 }
590 if ( !(value = homeCity()).isEmpty() ) { 586 if ( !(value = homeCity()).isEmpty() ) {
591 marker = true; 587 marker = true;
592 if ( homeZip().isEmpty() && !homeStreet().isEmpty() ) 588 if ( homeZip().isEmpty() && !homeStreet().isEmpty() )
593 text += "<br>"; 589 text += "<br>";
594 text += Qtopia::escapeString(value); 590 text += Qtopia::escapeString(value);
595 if ( !state.isEmpty() ) 591 if ( !state.isEmpty() )
596 text += ", " + Qtopia::escapeString(state); 592 text += ", " + Qtopia::escapeString(state);
597 } else if (!state.isEmpty()) { 593 } else if (!state.isEmpty()) {
598 text += "<br>" + Qtopia::escapeString(state); 594 text += "<br>" + Qtopia::escapeString(state);
599 marker = true; 595 marker = true;
600 } 596 }
601 break; 597 break;
602 } 598 }
603 case City_State_Zip:{ // City, State Zip_Code 599 case City_State_Zip:{ // City, State Zip_Code
604 state = homeState(); 600 state = homeState();
605 if ( !(value = homeCity()).isEmpty() ) { 601 if ( !(value = homeCity()).isEmpty() ) {
606 marker = true; 602 marker = true;
607 text += "<br>" + Qtopia::escapeString(value); 603 text += "<br>" + Qtopia::escapeString(value);
608 if ( state ) 604 if ( state )
609 text += ", " + Qtopia::escapeString(state); 605 text += ", " + Qtopia::escapeString(state);
610 } else if ( !state.isEmpty() ){ 606 } else if ( !state.isEmpty() ){
611 text += "<br>" + Qtopia::escapeString(state); 607 text += "<br>" + Qtopia::escapeString(state);
612 marker = true; 608 marker = true;
613 } 609 }
614 if ( !(value = homeZip()).isEmpty() ){ 610 if ( !(value = homeZip()).isEmpty() ){
615 text += " " + Qtopia::escapeString(value); 611 text += " " + Qtopia::escapeString(value);
616 marker = true; 612 marker = true;
617 } 613 }
618 break; 614 break;
619 } 615 }
620 } 616 }
621 617
622 if ( !(value = homeCountry()).isEmpty() ){ 618 if ( !(value = homeCountry()).isEmpty() ){
623 text += "<br>" + Qtopia::escapeString(value); 619 text += "<br>" + Qtopia::escapeString(value);
624 marker = true; 620 marker = true;
625 } 621 }
626 622
627 // rest of Home data 623 // rest of Home data
628 str = homeWebpage(); 624 str = homeWebpage();
629 if ( !str.isEmpty() ){ 625 if ( !str.isEmpty() ){
630 text += "<br><b><img src=\"addressbook/webpagehome\"> " + QObject::tr("Home Web Page: ") + "</b>" 626 text += "<br><b><img src=\"addressbook/webpagehome\"> " + QObject::tr("Home Web Page: ") + "</b>"
631 + Qtopia::escapeString(str); 627 + Qtopia::escapeString(str);
632 marker = true; 628 marker = true;
633 } 629 }
634 str = homePhone(); 630 str = homePhone();
635 if ( !str.isEmpty() ){ 631 if ( !str.isEmpty() ){
636 text += "<br><b><img src=\"addressbook/phonehome\"> " + QObject::tr("Home Phone: ") + "</b>" 632 text += "<br><b><img src=\"addressbook/phonehome\"> " + QObject::tr("Home Phone: ") + "</b>"
637 + Qtopia::escapeString(str); 633 + Qtopia::escapeString(str);
638 marker = true; 634 marker = true;
639 } 635 }
640 str = homeFax(); 636 str = homeFax();
641 if ( !str.isEmpty() ){ 637 if ( !str.isEmpty() ){
642 text += "<br><b><img src=\"addressbook/faxhome\"> " + QObject::tr("Home Fax: ") + "</b>" 638 text += "<br><b><img src=\"addressbook/faxhome\"> " + QObject::tr("Home Fax: ") + "</b>"
643 + Qtopia::escapeString(str); 639 + Qtopia::escapeString(str);
644 marker = true; 640 marker = true;
645 } 641 }
646 str = homeMobile(); 642 str = homeMobile();
647 if ( !str.isEmpty() ){ 643 if ( !str.isEmpty() ){
648 text += "<br><b><img src=\"addressbook/mobilehome\"> " + QObject::tr("Home Mobile: ") + "</b>" 644 text += "<br><b><img src=\"addressbook/mobilehome\"> " + QObject::tr("Home Mobile: ") + "</b>"
649 + Qtopia::escapeString(str); 645 + Qtopia::escapeString(str);
650 marker = true; 646 marker = true;
651 } 647 }
652 648
653 if ( marker ) 649 if ( marker )
654 text += "<br><hr>"; 650 text += "<br><hr>";
655 651
656 // the rest... 652 // the rest...
657 str = emails(); 653 str = emails();
658 if ( !str.isEmpty() && ( str != defEmail ) ) 654 if ( !str.isEmpty() && ( str != defEmail ) )
659 text += "<br><b>" + QObject::tr("All Emails: ") + "</b>" 655 text += "<br><b>" + QObject::tr("All Emails: ") + "</b>"
660 + Qtopia::escapeString(str); 656 + Qtopia::escapeString(str);
661 str = profession(); 657 str = profession();
662 if ( !str.isEmpty() ) 658 if ( !str.isEmpty() )
663 text += "<br><b>" + QObject::tr("Profession: ") + "</b>" 659 text += "<br><b>" + QObject::tr("Profession: ") + "</b>"
664 + Qtopia::escapeString(str); 660 + Qtopia::escapeString(str);
665 str = assistant(); 661 str = assistant();
666 if ( !str.isEmpty() ) 662 if ( !str.isEmpty() )
667 text += "<br><b>" + QObject::tr("Assistant: ") + "</b>" 663 text += "<br><b>" + QObject::tr("Assistant: ") + "</b>"
668 + Qtopia::escapeString(str); 664 + Qtopia::escapeString(str);
669 str = manager(); 665 str = manager();
670 if ( !str.isEmpty() ) 666 if ( !str.isEmpty() )
671 text += "<br><b>" + QObject::tr("Manager: ") + "</b>" 667 text += "<br><b>" + QObject::tr("Manager: ") + "</b>"
672 + Qtopia::escapeString(str); 668 + Qtopia::escapeString(str);
673 str = gender(); 669 str = gender();
674 if ( !str.isEmpty() && str.toInt() != 0 ) { 670 if ( !str.isEmpty() && str.toInt() != 0 ) {
675 text += "<br>"; 671 text += "<br>";
676 if ( str.toInt() == 1 ) 672 if ( str.toInt() == 1 )
677 str = QObject::tr( "Male" ); 673 str = QObject::tr( "Male" );
678 else if ( str.toInt() == 2 ) 674 else if ( str.toInt() == 2 )
679 str = QObject::tr( "Female" ); 675 str = QObject::tr( "Female" );
680 text += "<b>" + QObject::tr("Gender: ") + "</b>" + str; 676 text += "<b>" + QObject::tr("Gender: ") + "</b>" + str;
681 } 677 }
682 str = spouse(); 678 str = spouse();
683 if ( !str.isEmpty() ) 679 if ( !str.isEmpty() )
684 text += "<br><b>" + QObject::tr("Spouse: ") + "</b>" 680 text += "<br><b>" + QObject::tr("Spouse: ") + "</b>"
685 + Qtopia::escapeString(str); 681 + Qtopia::escapeString(str);
686 if ( birthday().isValid() ){ 682 if ( birthday().isValid() ){
687 str = TimeString::numberDateString( birthday() ); 683 str = TimeString::numberDateString( birthday() );
688 text += "<br><b>" + QObject::tr("Birthday: ") + "</b>" 684 text += "<br><b>" + QObject::tr("Birthday: ") + "</b>"
689 + Qtopia::escapeString(str); 685 + Qtopia::escapeString(str);
690 } 686 }
691 if ( anniversary().isValid() ){ 687 if ( anniversary().isValid() ){
692 str = TimeString::numberDateString( anniversary() ); 688 str = TimeString::numberDateString( anniversary() );
693 text += "<br><b>" + QObject::tr("Anniversary: ") + "</b>" 689 text += "<br><b>" + QObject::tr("Anniversary: ") + "</b>"
694 + Qtopia::escapeString(str); 690 + Qtopia::escapeString(str);
695 } 691 }
696 str = children(); 692 str = children();
697 if ( !str.isEmpty() ) 693 if ( !str.isEmpty() )
698 text += "<br><b>" + QObject::tr("Children: ") + "</b>" 694 text += "<br><b>" + QObject::tr("Children: ") + "</b>"
699 + Qtopia::escapeString(str); 695 + Qtopia::escapeString(str);
700 696
701 str = nickname(); 697 str = nickname();
702 if ( !str.isEmpty() ) 698 if ( !str.isEmpty() )
703 text += "<br><b>" + QObject::tr("Nickname: ") + "</b>" 699 text += "<br><b>" + QObject::tr("Nickname: ") + "</b>"
704 + Qtopia::escapeString(str); 700 + Qtopia::escapeString(str);
705 701
706 // categories 702 // categories
707 if ( categoryNames("Contacts").count() ){ 703 if ( categoryNames("Contacts").count() ){
708 text += "<br><b>" + QObject::tr( "Category:") + "</b> "; 704 text += "<br><b>" + QObject::tr( "Category:") + "</b> ";
709 text += categoryNames("Contacts").join(", "); 705 text += categoryNames("Contacts").join(", ");
710 } 706 }
711 707
712 // notes last 708 // notes last
713 if ( !(value = notes()).isEmpty() ) { 709 if ( !(value = notes()).isEmpty() ) {
714 text += "<br><hr><b>" + QObject::tr( "Notes:") + "</b> "; 710 text += "<br><hr><b>" + QObject::tr( "Notes:") + "</b> ";
715 QRegExp reg("\n"); 711 QRegExp reg("\n");
716 712
717 //QString tmp = Qtopia::escapeString(value); 713 //QString tmp = Qtopia::escapeString(value);
718 QString tmp = QStyleSheet::convertFromPlainText(value); 714 QString tmp = QStyleSheet::convertFromPlainText(value);
719 //tmp.replace( reg, "<br>" ); 715 //tmp.replace( reg, "<br>" );
diff --git a/libopie2/opiepim/ocontact.cpp b/libopie2/opiepim/ocontact.cpp
index 0f05b65..fcf3b26 100644
--- a/libopie2/opiepim/ocontact.cpp
+++ b/libopie2/opiepim/ocontact.cpp
@@ -195,525 +195,521 @@ OContact::~OContact()
195*/ 195*/
196 196
197/*! \fn void OContact::setBusinessMobile( const QString &str ) 197/*! \fn void OContact::setBusinessMobile( const QString &str )
198 Sets the business mobile phone number of the contact to \a str. 198 Sets the business mobile phone number of the contact to \a str.
199*/ 199*/
200 200
201/*! \fn void OContact::setBusinessPager( const QString &str ) 201/*! \fn void OContact::setBusinessPager( const QString &str )
202 Sets the business pager number of the contact to \a str. 202 Sets the business pager number of the contact to \a str.
203*/ 203*/
204 204
205/*! \fn void OContact::setBusinessWebpage( const QString &str ) 205/*! \fn void OContact::setBusinessWebpage( const QString &str )
206 Sets the business webpage of the contact to \a str. 206 Sets the business webpage of the contact to \a str.
207*/ 207*/
208 208
209/*! \fn void OContact::setProfession( const QString &str ) 209/*! \fn void OContact::setProfession( const QString &str )
210 Sets the profession of the contact to \a str. 210 Sets the profession of the contact to \a str.
211*/ 211*/
212 212
213/*! \fn void OContact::setAssistant( const QString &str ) 213/*! \fn void OContact::setAssistant( const QString &str )
214 Sets the assistant of the contact to \a str. 214 Sets the assistant of the contact to \a str.
215*/ 215*/
216 216
217/*! \fn void OContact::setManager( const QString &str ) 217/*! \fn void OContact::setManager( const QString &str )
218 Sets the manager of the contact to \a str. 218 Sets the manager of the contact to \a str.
219*/ 219*/
220 220
221/*! \fn void OContact::setSpouse( const QString &str ) 221/*! \fn void OContact::setSpouse( const QString &str )
222 Sets the spouse of the contact to \a str. 222 Sets the spouse of the contact to \a str.
223*/ 223*/
224 224
225/*! \fn void OContact::setGender( const QString &str ) 225/*! \fn void OContact::setGender( const QString &str )
226 Sets the gender of the contact to \a str. 226 Sets the gender of the contact to \a str.
227*/ 227*/
228 228
229/*! \fn void OContact::setNickname( const QString &str ) 229/*! \fn void OContact::setNickname( const QString &str )
230 Sets the nickname of the contact to \a str. 230 Sets the nickname of the contact to \a str.
231*/ 231*/
232 232
233/*! \fn void OContact::setNotes( const QString &str ) 233/*! \fn void OContact::setNotes( const QString &str )
234 Sets the notes about the contact to \a str. 234 Sets the notes about the contact to \a str.
235*/ 235*/
236 236
237/*! \fn QString OContact::title() const 237/*! \fn QString OContact::title() const
238 Returns the title of the contact. 238 Returns the title of the contact.
239*/ 239*/
240 240
241/*! \fn QString OContact::firstName() const 241/*! \fn QString OContact::firstName() const
242 Returns the first name of the contact. 242 Returns the first name of the contact.
243*/ 243*/
244 244
245/*! \fn QString OContact::middleName() const 245/*! \fn QString OContact::middleName() const
246 Returns the middle name of the contact. 246 Returns the middle name of the contact.
247*/ 247*/
248 248
249/*! \fn QString OContact::lastName() const 249/*! \fn QString OContact::lastName() const
250 Returns the last name of the contact. 250 Returns the last name of the contact.
251*/ 251*/
252 252
253/*! \fn QString OContact::suffix() const 253/*! \fn QString OContact::suffix() const
254 Returns the suffix of the contact. 254 Returns the suffix of the contact.
255*/ 255*/
256 256
257/*! \fn QString OContact::fileAs() const 257/*! \fn QString OContact::fileAs() const
258 Returns the string the contact is filed as. 258 Returns the string the contact is filed as.
259*/ 259*/
260 260
261/*! \fn QString OContact::defaultEmail() const 261/*! \fn QString OContact::defaultEmail() const
262 Returns the default email address of the contact. 262 Returns the default email address of the contact.
263*/ 263*/
264 264
265/*! \fn QString OContact::emails() const 265/*! \fn QString OContact::emails() const
266 Returns the list of email address for a contact separated by ';'s in a single 266 Returns the list of email address for a contact separated by ';'s in a single
267 string. 267 string.
268*/ 268*/
269 269
270/*! \fn QString OContact::homeStreet() const 270/*! \fn QString OContact::homeStreet() const
271 Returns the home street address of the contact. 271 Returns the home street address of the contact.
272*/ 272*/
273 273
274/*! \fn QString OContact::homeCity() const 274/*! \fn QString OContact::homeCity() const
275 Returns the home city of the contact. 275 Returns the home city of the contact.
276*/ 276*/
277 277
278/*! \fn QString OContact::homeState() const 278/*! \fn QString OContact::homeState() const
279 Returns the home state of the contact. 279 Returns the home state of the contact.
280*/ 280*/
281 281
282/*! \fn QString OContact::homeZip() const 282/*! \fn QString OContact::homeZip() const
283 Returns the home zip of the contact. 283 Returns the home zip of the contact.
284*/ 284*/
285 285
286/*! \fn QString OContact::homeCountry() const 286/*! \fn QString OContact::homeCountry() const
287 Returns the home country of the contact. 287 Returns the home country of the contact.
288*/ 288*/
289 289
290/*! \fn QString OContact::homePhone() const 290/*! \fn QString OContact::homePhone() const
291 Returns the home phone number of the contact. 291 Returns the home phone number of the contact.
292*/ 292*/
293 293
294/*! \fn QString OContact::homeFax() const 294/*! \fn QString OContact::homeFax() const
295 Returns the home fax number of the contact. 295 Returns the home fax number of the contact.
296*/ 296*/
297 297
298/*! \fn QString OContact::homeMobile() const 298/*! \fn QString OContact::homeMobile() const
299 Returns the home mobile number of the contact. 299 Returns the home mobile number of the contact.
300*/ 300*/
301 301
302/*! \fn QString OContact::homeWebpage() const 302/*! \fn QString OContact::homeWebpage() const
303 Returns the home webpage of the contact. 303 Returns the home webpage of the contact.
304*/ 304*/
305 305
306/*! \fn QString OContact::company() const 306/*! \fn QString OContact::company() const
307 Returns the company for the contact. 307 Returns the company for the contact.
308*/ 308*/
309 309
310/*! \fn QString OContact::department() const 310/*! \fn QString OContact::department() const
311 Returns the department for the contact. 311 Returns the department for the contact.
312*/ 312*/
313 313
314/*! \fn QString OContact::office() const 314/*! \fn QString OContact::office() const
315 Returns the office for the contact. 315 Returns the office for the contact.
316*/ 316*/
317 317
318/*! \fn QString OContact::jobTitle() const 318/*! \fn QString OContact::jobTitle() const
319 Returns the job title of the contact. 319 Returns the job title of the contact.
320*/ 320*/
321 321
322/*! \fn QString OContact::profession() const 322/*! \fn QString OContact::profession() const
323 Returns the profession of the contact. 323 Returns the profession of the contact.
324*/ 324*/
325 325
326/*! \fn QString OContact::assistant() const 326/*! \fn QString OContact::assistant() const
327 Returns the assistant of the contact. 327 Returns the assistant of the contact.
328*/ 328*/
329 329
330/*! \fn QString OContact::manager() const 330/*! \fn QString OContact::manager() const
331 Returns the manager of the contact. 331 Returns the manager of the contact.
332*/ 332*/
333 333
334/*! \fn QString OContact::businessStreet() const 334/*! \fn QString OContact::businessStreet() const
335 Returns the business street address of the contact. 335 Returns the business street address of the contact.
336*/ 336*/
337 337
338/*! \fn QString OContact::businessCity() const 338/*! \fn QString OContact::businessCity() const
339 Returns the business city of the contact. 339 Returns the business city of the contact.
340*/ 340*/
341 341
342/*! \fn QString OContact::businessState() const 342/*! \fn QString OContact::businessState() const
343 Returns the business state of the contact. 343 Returns the business state of the contact.
344*/ 344*/
345 345
346/*! \fn QString OContact::businessZip() const 346/*! \fn QString OContact::businessZip() const
347 Returns the business zip of the contact. 347 Returns the business zip of the contact.
348*/ 348*/
349 349
350/*! \fn QString OContact::businessCountry() const 350/*! \fn QString OContact::businessCountry() const
351 Returns the business country of the contact. 351 Returns the business country of the contact.
352*/ 352*/
353 353
354/*! \fn QString OContact::businessPhone() const 354/*! \fn QString OContact::businessPhone() const
355 Returns the business phone number of the contact. 355 Returns the business phone number of the contact.
356*/ 356*/
357 357
358/*! \fn QString OContact::businessFax() const 358/*! \fn QString OContact::businessFax() const
359 Returns the business fax number of the contact. 359 Returns the business fax number of the contact.
360*/ 360*/
361 361
362/*! \fn QString OContact::businessMobile() const 362/*! \fn QString OContact::businessMobile() const
363 Returns the business mobile number of the contact. 363 Returns the business mobile number of the contact.
364*/ 364*/
365 365
366/*! \fn QString OContact::businessPager() const 366/*! \fn QString OContact::businessPager() const
367 Returns the business pager number of the contact. 367 Returns the business pager number of the contact.
368*/ 368*/
369 369
370/*! \fn QString OContact::businessWebpage() const 370/*! \fn QString OContact::businessWebpage() const
371 Returns the business webpage of the contact. 371 Returns the business webpage of the contact.
372*/ 372*/
373 373
374/*! \fn QString OContact::spouse() const 374/*! \fn QString OContact::spouse() const
375 Returns the spouse of the contact. 375 Returns the spouse of the contact.
376*/ 376*/
377 377
378/*! \fn QString OContact::gender() const 378/*! \fn QString OContact::gender() const
379 Returns the gender of the contact. 379 Returns the gender of the contact.
380*/ 380*/
381 381
382/*! \fn QString OContact::nickname() const 382/*! \fn QString OContact::nickname() const
383 Returns the nickname of the contact. 383 Returns the nickname of the contact.
384*/ 384*/
385 385
386/*! \fn QString OContact::children() const 386/*! \fn QString OContact::children() const
387 Returns the children of the contact. 387 Returns the children of the contact.
388*/ 388*/
389 389
390/*! \fn QString OContact::notes() const 390/*! \fn QString OContact::notes() const
391 Returns the notes relating to the the contact. 391 Returns the notes relating to the the contact.
392*/ 392*/
393 393
394/*! \fn QString OContact::groups() const 394/*! \fn QString OContact::groups() const
395 \internal 395 \internal
396 Returns the groups for the contact. 396 Returns the groups for the contact.
397*/ 397*/
398 398
399/*! \fn QStringList OContact::groupList() const 399/*! \fn QStringList OContact::groupList() const
400 \internal 400 \internal
401*/ 401*/
402 402
403/*! \fn QString OContact::field(int) const 403/*! \fn QString OContact::field(int) const
404 \internal 404 \internal
405*/ 405*/
406 406
407/*! \fn void OContact::saveJournal( journal_action, const QString & = QString::null ) 407/*! \fn void OContact::saveJournal( journal_action, const QString & = QString::null )
408 \internal 408 \internal
409*/ 409*/
410 410
411/*! \fn void OContact::setUid( int id ) 411/*! \fn void OContact::setUid( int id )
412 \internal 412 \internal
413 Sets the uid for this record to \a id. 413 Sets the uid for this record to \a id.
414*/ 414*/
415 415
416/*! \enum OContact::journal_action 416/*! \enum OContact::journal_action
417 \internal 417 \internal
418*/ 418*/
419 419
420/*! 420/*!
421 \internal 421 \internal
422*/ 422*/
423QMap<int, QString> OContact::toMap() const 423QMap<int, QString> OContact::toMap() const
424{ 424{
425 QMap<int, QString> map = mMap; 425 QMap<int, QString> map = mMap;
426 QString cats = idsToString( categories() ); 426 QString cats = idsToString( categories() );
427 if ( !cats.isEmpty() ) 427 if ( !cats.isEmpty() )
428 map.insert( Qtopia::AddressCategory, cats ); 428 map.insert( Qtopia::AddressCategory, cats );
429 return map; 429 return map;
430} 430}
431 431
432/*! 432/*!
433 Returns a rich text formatted QString representing the contents the contact. 433 Returns a rich text formatted QString representing the contents the contact.
434*/ 434*/
435QString OContact::toRichText() const 435QString OContact::toRichText() const
436{ 436{
437 QString text; 437 QString text;
438 QString value, comp, state; 438 QString value, comp, state;
439 QString str; 439 QString str;
440 bool marker = false; 440 bool marker = false;
441 441
442 Config cfg("qpe"); 442 Config cfg("qpe");
443 cfg.setGroup("Appearance"); 443 cfg.setGroup("Appearance");
444 int addressformat = cfg.readNumEntry( "AddressFormat", Zip_City_State ); 444 int addressformat = cfg.readNumEntry( "AddressFormat", Zip_City_State );
445 445
446 // name, jobtitle and company 446 // name, jobtitle and company
447 if ( !(value = fullName()).isEmpty() ) 447 if ( !(value = fullName()).isEmpty() )
448 text += "<b><h3><img src=\"addressbook/AddressBook\"> " + Qtopia::escapeString(value) + "</h3></b>"; 448 text += "<b><h3><img src=\"addressbook/AddressBook\"> " + Qtopia::escapeString(value) + "</h3></b>";
449 449
450 if ( !(value = jobTitle()).isEmpty() ) 450 if ( !(value = jobTitle()).isEmpty() )
451 text += Qtopia::escapeString(value); 451 text += Qtopia::escapeString(value) + " ";
452 452
453 comp = company(); 453 comp = company();
454 if ( !(value = department()).isEmpty() ) { 454 if ( !(value = department()).isEmpty() ) {
455 text += Qtopia::escapeString(value); 455 text += Qtopia::escapeString(value);
456 if ( comp ) 456 if ( comp )
457 text += ", "; 457 text += ", " + Qtopia::escapeString(comp);
458 else 458 }else if ( comp )
459 text += "<br>"; 459 text += "<br>" + Qtopia::escapeString(comp);
460 }
461 if ( !comp.isEmpty() )
462 text += Qtopia::escapeString(comp);
463
464 text += "<br><hr>"; 460 text += "<br><hr>";
465 461
466 // defailt email 462 // defailt email
467 QString defEmail = defaultEmail(); 463 QString defEmail = defaultEmail();
468 if ( !defEmail.isEmpty() ){ 464 if ( !defEmail.isEmpty() ){
469 text += "<b><img src=\"addressbook/email\"> " + QObject::tr("Default Email: ") + "</b>" 465 text += "<b><img src=\"addressbook/email\"> " + QObject::tr("Default Email: ") + "</b>"
470 + Qtopia::escapeString(defEmail); 466 + Qtopia::escapeString(defEmail);
471 marker = true; 467 marker = true;
472 } 468 }
473 469
474 // business address 470 // business address
475 if ( !businessStreet().isEmpty() || !businessCity().isEmpty() || 471 if ( !businessStreet().isEmpty() || !businessCity().isEmpty() ||
476 !businessZip().isEmpty() || !businessCountry().isEmpty() ) { 472 !businessZip().isEmpty() || !businessCountry().isEmpty() ) {
477 text += QObject::tr( "<br><b>Work Address:</b>" ); 473 text += QObject::tr( "<br><b>Work Address:</b>" );
478 marker = true; 474 marker = true;
479 } 475 }
480 476
481 if ( !(value = businessStreet()).isEmpty() ){ 477 if ( !(value = businessStreet()).isEmpty() ){
482 text += "<br>" + Qtopia::escapeString(value); 478 text += "<br>" + Qtopia::escapeString(value);
483 marker = true; 479 marker = true;
484 } 480 }
485 481
486 switch( addressformat ){ 482 switch( addressformat ){
487 case Zip_City_State:{ // Zip_Code City, State 483 case Zip_City_State:{ // Zip_Code City, State
488 state = businessState(); 484 state = businessState();
489 if ( !(value = businessZip()).isEmpty() ){ 485 if ( !(value = businessZip()).isEmpty() ){
490 text += "<br>" + Qtopia::escapeString(value) + " "; 486 text += "<br>" + Qtopia::escapeString(value) + " ";
491 marker = true; 487 marker = true;
492 488
493 } 489 }
494 if ( !(value = businessCity()).isEmpty() ) { 490 if ( !(value = businessCity()).isEmpty() ) {
495 marker = true; 491 marker = true;
496 if ( businessZip().isEmpty() && !businessStreet().isEmpty() ) 492 if ( businessZip().isEmpty() && !businessStreet().isEmpty() )
497 text += "<br>"; 493 text += "<br>";
498 text += Qtopia::escapeString(value); 494 text += Qtopia::escapeString(value);
499 if ( state ) 495 if ( state )
500 text += ", " + Qtopia::escapeString(state); 496 text += ", " + Qtopia::escapeString(state);
501 } else if ( !state.isEmpty() ){ 497 } else if ( !state.isEmpty() ){
502 text += "<br>" + Qtopia::escapeString(state); 498 text += "<br>" + Qtopia::escapeString(state);
503 marker = true; 499 marker = true;
504 } 500 }
505 break; 501 break;
506 } 502 }
507 case City_State_Zip:{ // City, State Zip_Code 503 case City_State_Zip:{ // City, State Zip_Code
508 state = businessState(); 504 state = businessState();
509 if ( !(value = businessCity()).isEmpty() ) { 505 if ( !(value = businessCity()).isEmpty() ) {
510 marker = true; 506 marker = true;
511 text += "<br>" + Qtopia::escapeString(value); 507 text += "<br>" + Qtopia::escapeString(value);
512 if ( state ) 508 if ( state )
513 text += ", " + Qtopia::escapeString(state); 509 text += ", " + Qtopia::escapeString(state);
514 } else if ( !state.isEmpty() ){ 510 } else if ( !state.isEmpty() ){
515 text += "<br>" + Qtopia::escapeString(state); 511 text += "<br>" + Qtopia::escapeString(state);
516 marker = true; 512 marker = true;
517 } 513 }
518 if ( !(value = businessZip()).isEmpty() ){ 514 if ( !(value = businessZip()).isEmpty() ){
519 text += " " + Qtopia::escapeString(value); 515 text += " " + Qtopia::escapeString(value);
520 marker = true; 516 marker = true;
521 } 517 }
522 break; 518 break;
523 } 519 }
524 } 520 }
525 521
526 if ( !(value = businessCountry()).isEmpty() ){ 522 if ( !(value = businessCountry()).isEmpty() ){
527 text += "<br>" + Qtopia::escapeString(value); 523 text += "<br>" + Qtopia::escapeString(value);
528 marker = true; 524 marker = true;
529 } 525 }
530 526
531 // rest of Business data 527 // rest of Business data
532 str = office(); 528 str = office();
533 if ( !str.isEmpty() ){ 529 if ( !str.isEmpty() ){
534 text += "<br><b>" + QObject::tr("Office: ") + "</b>" 530 text += "<br><b>" + QObject::tr("Office: ") + "</b>"
535 + Qtopia::escapeString(str); 531 + Qtopia::escapeString(str);
536 marker = true; 532 marker = true;
537 } 533 }
538 str = businessWebpage(); 534 str = businessWebpage();
539 if ( !str.isEmpty() ){ 535 if ( !str.isEmpty() ){
540 text += "<br><b><img src=\"addressbook/webpagework\"> " + QObject::tr("Business Web Page: ") + "</b>" 536 text += "<br><b><img src=\"addressbook/webpagework\"> " + QObject::tr("Business Web Page: ") + "</b>"
541 + Qtopia::escapeString(str); 537 + Qtopia::escapeString(str);
542 marker = true; 538 marker = true;
543 } 539 }
544 str = businessPhone(); 540 str = businessPhone();
545 if ( !str.isEmpty() ){ 541 if ( !str.isEmpty() ){
546 text += "<br><b><img src=\"addressbook/phonework\"> " + QObject::tr("Business Phone: ") + "</b>" 542 text += "<br><b><img src=\"addressbook/phonework\"> " + QObject::tr("Business Phone: ") + "</b>"
547 + Qtopia::escapeString(str); 543 + Qtopia::escapeString(str);
548 marker = true; 544 marker = true;
549 } 545 }
550 str = businessFax(); 546 str = businessFax();
551 if ( !str.isEmpty() ){ 547 if ( !str.isEmpty() ){
552 text += "<br><b><img src=\"addressbook/faxwork\"> " + QObject::tr("Business Fax: ") + "</b>" 548 text += "<br><b><img src=\"addressbook/faxwork\"> " + QObject::tr("Business Fax: ") + "</b>"
553 + Qtopia::escapeString(str); 549 + Qtopia::escapeString(str);
554 marker = true; 550 marker = true;
555 } 551 }
556 str = businessMobile(); 552 str = businessMobile();
557 if ( !str.isEmpty() ){ 553 if ( !str.isEmpty() ){
558 text += "<br><b><img src=\"addressbook/mobilework\"> " + QObject::tr("Business Mobile: ") + "</b>" 554 text += "<br><b><img src=\"addressbook/mobilework\"> " + QObject::tr("Business Mobile: ") + "</b>"
559 + Qtopia::escapeString(str); 555 + Qtopia::escapeString(str);
560 marker = true; 556 marker = true;
561 } 557 }
562 str = businessPager(); 558 str = businessPager();
563 if ( !str.isEmpty() ){ 559 if ( !str.isEmpty() ){
564 text += "<br><b>" + QObject::tr("Business Pager: ") + "</b>" 560 text += "<br><b>" + QObject::tr("Business Pager: ") + "</b>"
565 + Qtopia::escapeString(str); 561 + Qtopia::escapeString(str);
566 marker = true; 562 marker = true;
567 } 563 }
568 564
569 // text += "<br>"; 565 // text += "<br>";
570 566
571 // home address 567 // home address
572 if ( !homeStreet().isEmpty() || !homeCity().isEmpty() || 568 if ( !homeStreet().isEmpty() || !homeCity().isEmpty() ||
573 !homeZip().isEmpty() || !homeCountry().isEmpty() ) { 569 !homeZip().isEmpty() || !homeCountry().isEmpty() ) {
574 text += QObject::tr( "<br><b>Home Address:</b>" ); 570 text += QObject::tr( "<br><b>Home Address:</b>" );
575 marker = true; 571 marker = true;
576 } 572 }
577 573
578 if ( !(value = homeStreet()).isEmpty() ){ 574 if ( !(value = homeStreet()).isEmpty() ){
579 text += "<br>" + Qtopia::escapeString(value); 575 text += "<br>" + Qtopia::escapeString(value);
580 marker = true; 576 marker = true;
581 } 577 }
582 578
583 switch( addressformat ){ 579 switch( addressformat ){
584 case Zip_City_State:{ // Zip_Code City, State 580 case Zip_City_State:{ // Zip_Code City, State
585 state = homeState(); 581 state = homeState();
586 if ( !(value = homeZip()).isEmpty() ){ 582 if ( !(value = homeZip()).isEmpty() ){
587 text += "<br>" + Qtopia::escapeString(value) + " "; 583 text += "<br>" + Qtopia::escapeString(value) + " ";
588 marker = true; 584 marker = true;
589 } 585 }
590 if ( !(value = homeCity()).isEmpty() ) { 586 if ( !(value = homeCity()).isEmpty() ) {
591 marker = true; 587 marker = true;
592 if ( homeZip().isEmpty() && !homeStreet().isEmpty() ) 588 if ( homeZip().isEmpty() && !homeStreet().isEmpty() )
593 text += "<br>"; 589 text += "<br>";
594 text += Qtopia::escapeString(value); 590 text += Qtopia::escapeString(value);
595 if ( !state.isEmpty() ) 591 if ( !state.isEmpty() )
596 text += ", " + Qtopia::escapeString(state); 592 text += ", " + Qtopia::escapeString(state);
597 } else if (!state.isEmpty()) { 593 } else if (!state.isEmpty()) {
598 text += "<br>" + Qtopia::escapeString(state); 594 text += "<br>" + Qtopia::escapeString(state);
599 marker = true; 595 marker = true;
600 } 596 }
601 break; 597 break;
602 } 598 }
603 case City_State_Zip:{ // City, State Zip_Code 599 case City_State_Zip:{ // City, State Zip_Code
604 state = homeState(); 600 state = homeState();
605 if ( !(value = homeCity()).isEmpty() ) { 601 if ( !(value = homeCity()).isEmpty() ) {
606 marker = true; 602 marker = true;
607 text += "<br>" + Qtopia::escapeString(value); 603 text += "<br>" + Qtopia::escapeString(value);
608 if ( state ) 604 if ( state )
609 text += ", " + Qtopia::escapeString(state); 605 text += ", " + Qtopia::escapeString(state);
610 } else if ( !state.isEmpty() ){ 606 } else if ( !state.isEmpty() ){
611 text += "<br>" + Qtopia::escapeString(state); 607 text += "<br>" + Qtopia::escapeString(state);
612 marker = true; 608 marker = true;
613 } 609 }
614 if ( !(value = homeZip()).isEmpty() ){ 610 if ( !(value = homeZip()).isEmpty() ){
615 text += " " + Qtopia::escapeString(value); 611 text += " " + Qtopia::escapeString(value);
616 marker = true; 612 marker = true;
617 } 613 }
618 break; 614 break;
619 } 615 }
620 } 616 }
621 617
622 if ( !(value = homeCountry()).isEmpty() ){ 618 if ( !(value = homeCountry()).isEmpty() ){
623 text += "<br>" + Qtopia::escapeString(value); 619 text += "<br>" + Qtopia::escapeString(value);
624 marker = true; 620 marker = true;
625 } 621 }
626 622
627 // rest of Home data 623 // rest of Home data
628 str = homeWebpage(); 624 str = homeWebpage();
629 if ( !str.isEmpty() ){ 625 if ( !str.isEmpty() ){
630 text += "<br><b><img src=\"addressbook/webpagehome\"> " + QObject::tr("Home Web Page: ") + "</b>" 626 text += "<br><b><img src=\"addressbook/webpagehome\"> " + QObject::tr("Home Web Page: ") + "</b>"
631 + Qtopia::escapeString(str); 627 + Qtopia::escapeString(str);
632 marker = true; 628 marker = true;
633 } 629 }
634 str = homePhone(); 630 str = homePhone();
635 if ( !str.isEmpty() ){ 631 if ( !str.isEmpty() ){
636 text += "<br><b><img src=\"addressbook/phonehome\"> " + QObject::tr("Home Phone: ") + "</b>" 632 text += "<br><b><img src=\"addressbook/phonehome\"> " + QObject::tr("Home Phone: ") + "</b>"
637 + Qtopia::escapeString(str); 633 + Qtopia::escapeString(str);
638 marker = true; 634 marker = true;
639 } 635 }
640 str = homeFax(); 636 str = homeFax();
641 if ( !str.isEmpty() ){ 637 if ( !str.isEmpty() ){
642 text += "<br><b><img src=\"addressbook/faxhome\"> " + QObject::tr("Home Fax: ") + "</b>" 638 text += "<br><b><img src=\"addressbook/faxhome\"> " + QObject::tr("Home Fax: ") + "</b>"
643 + Qtopia::escapeString(str); 639 + Qtopia::escapeString(str);
644 marker = true; 640 marker = true;
645 } 641 }
646 str = homeMobile(); 642 str = homeMobile();
647 if ( !str.isEmpty() ){ 643 if ( !str.isEmpty() ){
648 text += "<br><b><img src=\"addressbook/mobilehome\"> " + QObject::tr("Home Mobile: ") + "</b>" 644 text += "<br><b><img src=\"addressbook/mobilehome\"> " + QObject::tr("Home Mobile: ") + "</b>"
649 + Qtopia::escapeString(str); 645 + Qtopia::escapeString(str);
650 marker = true; 646 marker = true;
651 } 647 }
652 648
653 if ( marker ) 649 if ( marker )
654 text += "<br><hr>"; 650 text += "<br><hr>";
655 651
656 // the rest... 652 // the rest...
657 str = emails(); 653 str = emails();
658 if ( !str.isEmpty() && ( str != defEmail ) ) 654 if ( !str.isEmpty() && ( str != defEmail ) )
659 text += "<br><b>" + QObject::tr("All Emails: ") + "</b>" 655 text += "<br><b>" + QObject::tr("All Emails: ") + "</b>"
660 + Qtopia::escapeString(str); 656 + Qtopia::escapeString(str);
661 str = profession(); 657 str = profession();
662 if ( !str.isEmpty() ) 658 if ( !str.isEmpty() )
663 text += "<br><b>" + QObject::tr("Profession: ") + "</b>" 659 text += "<br><b>" + QObject::tr("Profession: ") + "</b>"
664 + Qtopia::escapeString(str); 660 + Qtopia::escapeString(str);
665 str = assistant(); 661 str = assistant();
666 if ( !str.isEmpty() ) 662 if ( !str.isEmpty() )
667 text += "<br><b>" + QObject::tr("Assistant: ") + "</b>" 663 text += "<br><b>" + QObject::tr("Assistant: ") + "</b>"
668 + Qtopia::escapeString(str); 664 + Qtopia::escapeString(str);
669 str = manager(); 665 str = manager();
670 if ( !str.isEmpty() ) 666 if ( !str.isEmpty() )
671 text += "<br><b>" + QObject::tr("Manager: ") + "</b>" 667 text += "<br><b>" + QObject::tr("Manager: ") + "</b>"
672 + Qtopia::escapeString(str); 668 + Qtopia::escapeString(str);
673 str = gender(); 669 str = gender();
674 if ( !str.isEmpty() && str.toInt() != 0 ) { 670 if ( !str.isEmpty() && str.toInt() != 0 ) {
675 text += "<br>"; 671 text += "<br>";
676 if ( str.toInt() == 1 ) 672 if ( str.toInt() == 1 )
677 str = QObject::tr( "Male" ); 673 str = QObject::tr( "Male" );
678 else if ( str.toInt() == 2 ) 674 else if ( str.toInt() == 2 )
679 str = QObject::tr( "Female" ); 675 str = QObject::tr( "Female" );
680 text += "<b>" + QObject::tr("Gender: ") + "</b>" + str; 676 text += "<b>" + QObject::tr("Gender: ") + "</b>" + str;
681 } 677 }
682 str = spouse(); 678 str = spouse();
683 if ( !str.isEmpty() ) 679 if ( !str.isEmpty() )
684 text += "<br><b>" + QObject::tr("Spouse: ") + "</b>" 680 text += "<br><b>" + QObject::tr("Spouse: ") + "</b>"
685 + Qtopia::escapeString(str); 681 + Qtopia::escapeString(str);
686 if ( birthday().isValid() ){ 682 if ( birthday().isValid() ){
687 str = TimeString::numberDateString( birthday() ); 683 str = TimeString::numberDateString( birthday() );
688 text += "<br><b>" + QObject::tr("Birthday: ") + "</b>" 684 text += "<br><b>" + QObject::tr("Birthday: ") + "</b>"
689 + Qtopia::escapeString(str); 685 + Qtopia::escapeString(str);
690 } 686 }
691 if ( anniversary().isValid() ){ 687 if ( anniversary().isValid() ){
692 str = TimeString::numberDateString( anniversary() ); 688 str = TimeString::numberDateString( anniversary() );
693 text += "<br><b>" + QObject::tr("Anniversary: ") + "</b>" 689 text += "<br><b>" + QObject::tr("Anniversary: ") + "</b>"
694 + Qtopia::escapeString(str); 690 + Qtopia::escapeString(str);
695 } 691 }
696 str = children(); 692 str = children();
697 if ( !str.isEmpty() ) 693 if ( !str.isEmpty() )
698 text += "<br><b>" + QObject::tr("Children: ") + "</b>" 694 text += "<br><b>" + QObject::tr("Children: ") + "</b>"
699 + Qtopia::escapeString(str); 695 + Qtopia::escapeString(str);
700 696
701 str = nickname(); 697 str = nickname();
702 if ( !str.isEmpty() ) 698 if ( !str.isEmpty() )
703 text += "<br><b>" + QObject::tr("Nickname: ") + "</b>" 699 text += "<br><b>" + QObject::tr("Nickname: ") + "</b>"
704 + Qtopia::escapeString(str); 700 + Qtopia::escapeString(str);
705 701
706 // categories 702 // categories
707 if ( categoryNames("Contacts").count() ){ 703 if ( categoryNames("Contacts").count() ){
708 text += "<br><b>" + QObject::tr( "Category:") + "</b> "; 704 text += "<br><b>" + QObject::tr( "Category:") + "</b> ";
709 text += categoryNames("Contacts").join(", "); 705 text += categoryNames("Contacts").join(", ");
710 } 706 }
711 707
712 // notes last 708 // notes last
713 if ( !(value = notes()).isEmpty() ) { 709 if ( !(value = notes()).isEmpty() ) {
714 text += "<br><hr><b>" + QObject::tr( "Notes:") + "</b> "; 710 text += "<br><hr><b>" + QObject::tr( "Notes:") + "</b> ";
715 QRegExp reg("\n"); 711 QRegExp reg("\n");
716 712
717 //QString tmp = Qtopia::escapeString(value); 713 //QString tmp = Qtopia::escapeString(value);
718 QString tmp = QStyleSheet::convertFromPlainText(value); 714 QString tmp = QStyleSheet::convertFromPlainText(value);
719 //tmp.replace( reg, "<br>" ); 715 //tmp.replace( reg, "<br>" );