-rw-r--r-- | libopie/pim/ocontact.cpp | 5 | ||||
-rw-r--r-- | libopie2/opiepim/ocontact.cpp | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/libopie/pim/ocontact.cpp b/libopie/pim/ocontact.cpp index 38cba72..c9084ad 100644 --- a/libopie/pim/ocontact.cpp +++ b/libopie/pim/ocontact.cpp | |||
@@ -492,192 +492,197 @@ QString OContact::toRichText() const | |||
492 | if ( !(value = homeCity()).isEmpty() ) { | 492 | if ( !(value = homeCity()).isEmpty() ) { |
493 | text += Qtopia::escapeString(value); | 493 | text += Qtopia::escapeString(value); |
494 | if ( !state.isEmpty() ) | 494 | if ( !state.isEmpty() ) |
495 | text += ", " + Qtopia::escapeString(state); | 495 | text += ", " + Qtopia::escapeString(state); |
496 | text += "<br>"; | 496 | text += "<br>"; |
497 | } else if (!state.isEmpty()) | 497 | } else if (!state.isEmpty()) |
498 | text += Qtopia::escapeString(state) + "<br>"; | 498 | text += Qtopia::escapeString(state) + "<br>"; |
499 | if ( !(value = homeZip()).isEmpty() ) | 499 | if ( !(value = homeZip()).isEmpty() ) |
500 | text += Qtopia::escapeString(value) + "<br>"; | 500 | text += Qtopia::escapeString(value) + "<br>"; |
501 | if ( !(value = homeCountry()).isEmpty() ) | 501 | if ( !(value = homeCountry()).isEmpty() ) |
502 | text += Qtopia::escapeString(value) + "<br>"; | 502 | text += Qtopia::escapeString(value) + "<br>"; |
503 | 503 | ||
504 | // the others... | 504 | // the others... |
505 | QString str; | 505 | QString str; |
506 | QString defEmail = defaultEmail(); | 506 | QString defEmail = defaultEmail(); |
507 | if ( !defEmail.isEmpty() ) | 507 | if ( !defEmail.isEmpty() ) |
508 | text += "<b>" + QObject::tr("Default Email: ") + "</b>" | 508 | text += "<b>" + QObject::tr("Default Email: ") + "</b>" |
509 | + Qtopia::escapeString(defEmail) + "<br>"; | 509 | + Qtopia::escapeString(defEmail) + "<br>"; |
510 | str = emails(); | 510 | str = emails(); |
511 | if ( !str.isEmpty() && ( str != defEmail ) ) | 511 | if ( !str.isEmpty() && ( str != defEmail ) ) |
512 | text += "<b>" + QObject::tr("All Emails: ") + "</b>" | 512 | text += "<b>" + QObject::tr("All Emails: ") + "</b>" |
513 | + Qtopia::escapeString(str) + "<br>"; | 513 | + Qtopia::escapeString(str) + "<br>"; |
514 | str = homePhone(); | 514 | str = homePhone(); |
515 | if ( !str.isEmpty() ) | 515 | if ( !str.isEmpty() ) |
516 | text += "<b>" + QObject::tr("Home Phone: ") + "</b>" | 516 | text += "<b>" + QObject::tr("Home Phone: ") + "</b>" |
517 | + Qtopia::escapeString(str) + "<br>"; | 517 | + Qtopia::escapeString(str) + "<br>"; |
518 | str = homeFax(); | 518 | str = homeFax(); |
519 | if ( !str.isEmpty() ) | 519 | if ( !str.isEmpty() ) |
520 | text += "<b>" + QObject::tr("Home Fax: ") + "</b>" | 520 | text += "<b>" + QObject::tr("Home Fax: ") + "</b>" |
521 | + Qtopia::escapeString(str) + "<br>"; | 521 | + Qtopia::escapeString(str) + "<br>"; |
522 | str = homeMobile(); | 522 | str = homeMobile(); |
523 | if ( !str.isEmpty() ) | 523 | if ( !str.isEmpty() ) |
524 | text += "<b>" + QObject::tr("Home Mobile: ") + "</b>" | 524 | text += "<b>" + QObject::tr("Home Mobile: ") + "</b>" |
525 | + Qtopia::escapeString(str) + "<br>"; | 525 | + Qtopia::escapeString(str) + "<br>"; |
526 | str = homeWebpage(); | 526 | str = homeWebpage(); |
527 | if ( !str.isEmpty() ) | 527 | if ( !str.isEmpty() ) |
528 | text += "<b>" + QObject::tr("Home Web Page: ") + "</b>" | 528 | text += "<b>" + QObject::tr("Home Web Page: ") + "</b>" |
529 | + Qtopia::escapeString(str) + "<br>"; | 529 | + Qtopia::escapeString(str) + "<br>"; |
530 | str = businessWebpage(); | 530 | str = businessWebpage(); |
531 | if ( !str.isEmpty() ) | 531 | if ( !str.isEmpty() ) |
532 | text += "<b>" + QObject::tr("Business Web Page: ") + "</b>" | 532 | text += "<b>" + QObject::tr("Business Web Page: ") + "</b>" |
533 | + Qtopia::escapeString(str) + "<br>"; | 533 | + Qtopia::escapeString(str) + "<br>"; |
534 | str = office(); | 534 | str = office(); |
535 | if ( !str.isEmpty() ) | 535 | if ( !str.isEmpty() ) |
536 | text += "<b>" + QObject::tr("Office: ") + "</b>" | 536 | text += "<b>" + QObject::tr("Office: ") + "</b>" |
537 | + Qtopia::escapeString(str) + "<br>"; | 537 | + Qtopia::escapeString(str) + "<br>"; |
538 | str = businessPhone(); | 538 | str = businessPhone(); |
539 | if ( !str.isEmpty() ) | 539 | if ( !str.isEmpty() ) |
540 | text += "<b>" + QObject::tr("Business Phone: ") + "</b>" | 540 | text += "<b>" + QObject::tr("Business Phone: ") + "</b>" |
541 | + Qtopia::escapeString(str) + "<br>"; | 541 | + Qtopia::escapeString(str) + "<br>"; |
542 | str = businessFax(); | 542 | str = businessFax(); |
543 | if ( !str.isEmpty() ) | 543 | if ( !str.isEmpty() ) |
544 | text += "<b>" + QObject::tr("Business Fax: ") + "</b>" | 544 | text += "<b>" + QObject::tr("Business Fax: ") + "</b>" |
545 | + Qtopia::escapeString(str) + "<br>"; | 545 | + Qtopia::escapeString(str) + "<br>"; |
546 | str = businessMobile(); | 546 | str = businessMobile(); |
547 | if ( !str.isEmpty() ) | 547 | if ( !str.isEmpty() ) |
548 | text += "<b>" + QObject::tr("Business Mobile: ") + "</b>" | 548 | text += "<b>" + QObject::tr("Business Mobile: ") + "</b>" |
549 | + Qtopia::escapeString(str) + "<br>"; | 549 | + Qtopia::escapeString(str) + "<br>"; |
550 | str = businessPager(); | 550 | str = businessPager(); |
551 | if ( !str.isEmpty() ) | 551 | if ( !str.isEmpty() ) |
552 | text += "<b>" + QObject::tr("Business Pager: ") + "</b>" | 552 | text += "<b>" + QObject::tr("Business Pager: ") + "</b>" |
553 | + Qtopia::escapeString(str) + "<br>"; | 553 | + Qtopia::escapeString(str) + "<br>"; |
554 | str = profession(); | 554 | str = profession(); |
555 | if ( !str.isEmpty() ) | 555 | if ( !str.isEmpty() ) |
556 | text += "<b>" + QObject::tr("Profession: ") + "</b>" | 556 | text += "<b>" + QObject::tr("Profession: ") + "</b>" |
557 | + Qtopia::escapeString(str) + "<br>"; | 557 | + Qtopia::escapeString(str) + "<br>"; |
558 | str = assistant(); | 558 | str = assistant(); |
559 | if ( !str.isEmpty() ) | 559 | if ( !str.isEmpty() ) |
560 | text += "<b>" + QObject::tr("Assistant: ") + "</b>" | 560 | text += "<b>" + QObject::tr("Assistant: ") + "</b>" |
561 | + Qtopia::escapeString(str) + "<br>"; | 561 | + Qtopia::escapeString(str) + "<br>"; |
562 | str = manager(); | 562 | str = manager(); |
563 | if ( !str.isEmpty() ) | 563 | if ( !str.isEmpty() ) |
564 | text += "<b>" + QObject::tr("Manager: ") + "</b>" | 564 | text += "<b>" + QObject::tr("Manager: ") + "</b>" |
565 | + Qtopia::escapeString(str) + "<br>"; | 565 | + Qtopia::escapeString(str) + "<br>"; |
566 | str = gender(); | 566 | str = gender(); |
567 | if ( !str.isEmpty() && str.toInt() != 0 ) { | 567 | if ( !str.isEmpty() && str.toInt() != 0 ) { |
568 | if ( str.toInt() == 1 ) | 568 | if ( str.toInt() == 1 ) |
569 | str = QObject::tr( "Male" ); | 569 | str = QObject::tr( "Male" ); |
570 | else if ( str.toInt() == 2 ) | 570 | else if ( str.toInt() == 2 ) |
571 | str = QObject::tr( "Female" ); | 571 | str = QObject::tr( "Female" ); |
572 | text += "<b>" + QObject::tr("Gender: ") + "</b>" + str + "<br>"; | 572 | text += "<b>" + QObject::tr("Gender: ") + "</b>" + str + "<br>"; |
573 | } | 573 | } |
574 | str = spouse(); | 574 | str = spouse(); |
575 | if ( !str.isEmpty() ) | 575 | if ( !str.isEmpty() ) |
576 | text += "<b>" + QObject::tr("Spouse: ") + "</b>" | 576 | text += "<b>" + QObject::tr("Spouse: ") + "</b>" |
577 | + Qtopia::escapeString(str) + "<br>"; | 577 | + Qtopia::escapeString(str) + "<br>"; |
578 | if ( birthday().isValid() ){ | 578 | if ( birthday().isValid() ){ |
579 | str = TimeString::numberDateString( birthday() ); | 579 | str = TimeString::numberDateString( birthday() ); |
580 | text += "<b>" + QObject::tr("Birthday: ") + "</b>" | 580 | text += "<b>" + QObject::tr("Birthday: ") + "</b>" |
581 | + Qtopia::escapeString(str) + "<br>"; | 581 | + Qtopia::escapeString(str) + "<br>"; |
582 | } | 582 | } |
583 | if ( anniversary().isValid() ){ | 583 | if ( anniversary().isValid() ){ |
584 | str = TimeString::numberDateString( anniversary() ); | 584 | str = TimeString::numberDateString( anniversary() ); |
585 | text += "<b>" + QObject::tr("Anniversary: ") + "</b>" | 585 | text += "<b>" + QObject::tr("Anniversary: ") + "</b>" |
586 | + Qtopia::escapeString(str) + "<br>"; | 586 | + Qtopia::escapeString(str) + "<br>"; |
587 | } | 587 | } |
588 | str = children(); | ||
589 | if ( !str.isEmpty() ) | ||
590 | text += "<b>" + QObject::tr("Children: ") + "</b>" | ||
591 | + Qtopia::escapeString(str) + "<br>"; | ||
592 | |||
588 | str = nickname(); | 593 | str = nickname(); |
589 | if ( !str.isEmpty() ) | 594 | if ( !str.isEmpty() ) |
590 | text += "<b>" + QObject::tr("Nickname: ") + "</b>" | 595 | text += "<b>" + QObject::tr("Nickname: ") + "</b>" |
591 | + Qtopia::escapeString(str) + "<br>"; | 596 | + Qtopia::escapeString(str) + "<br>"; |
592 | 597 | ||
593 | if ( categoryNames().count() ){ | 598 | if ( categoryNames().count() ){ |
594 | text += "<b>" + QObject::tr( "Category:") + "</b> "; | 599 | text += "<b>" + QObject::tr( "Category:") + "</b> "; |
595 | text += categoryNames().join(", "); | 600 | text += categoryNames().join(", "); |
596 | text += "<br>"; | 601 | text += "<br>"; |
597 | } | 602 | } |
598 | 603 | ||
599 | // notes last | 604 | // notes last |
600 | if ( (value = notes()) ) { | 605 | if ( (value = notes()) ) { |
601 | QRegExp reg("\n"); | 606 | QRegExp reg("\n"); |
602 | 607 | ||
603 | //QString tmp = Qtopia::escapeString(value); | 608 | //QString tmp = Qtopia::escapeString(value); |
604 | QString tmp = QStyleSheet::convertFromPlainText(value); | 609 | QString tmp = QStyleSheet::convertFromPlainText(value); |
605 | //tmp.replace( reg, "<br>" ); | 610 | //tmp.replace( reg, "<br>" ); |
606 | text += "<br>" + tmp + "<br>"; | 611 | text += "<br>" + tmp + "<br>"; |
607 | } | 612 | } |
608 | return text; | 613 | return text; |
609 | } | 614 | } |
610 | 615 | ||
611 | /*! | 616 | /*! |
612 | \internal | 617 | \internal |
613 | */ | 618 | */ |
614 | void OContact::insert( int key, const QString &v ) | 619 | void OContact::insert( int key, const QString &v ) |
615 | { | 620 | { |
616 | QString value = v.stripWhiteSpace(); | 621 | QString value = v.stripWhiteSpace(); |
617 | if ( value.isEmpty() ) | 622 | if ( value.isEmpty() ) |
618 | mMap.remove( key ); | 623 | mMap.remove( key ); |
619 | else | 624 | else |
620 | mMap.insert( key, value ); | 625 | mMap.insert( key, value ); |
621 | } | 626 | } |
622 | 627 | ||
623 | /*! | 628 | /*! |
624 | \internal | 629 | \internal |
625 | */ | 630 | */ |
626 | void OContact::replace( int key, const QString & v ) | 631 | void OContact::replace( int key, const QString & v ) |
627 | { | 632 | { |
628 | QString value = v.stripWhiteSpace(); | 633 | QString value = v.stripWhiteSpace(); |
629 | if ( value.isEmpty() ) | 634 | if ( value.isEmpty() ) |
630 | mMap.remove( key ); | 635 | mMap.remove( key ); |
631 | else | 636 | else |
632 | mMap.replace( key, value ); | 637 | mMap.replace( key, value ); |
633 | } | 638 | } |
634 | 639 | ||
635 | /*! | 640 | /*! |
636 | \internal | 641 | \internal |
637 | */ | 642 | */ |
638 | QString OContact::find( int key ) const | 643 | QString OContact::find( int key ) const |
639 | { | 644 | { |
640 | return mMap[key]; | 645 | return mMap[key]; |
641 | } | 646 | } |
642 | 647 | ||
643 | /*! | 648 | /*! |
644 | \internal | 649 | \internal |
645 | */ | 650 | */ |
646 | QString OContact::displayAddress( const QString &street, | 651 | QString OContact::displayAddress( const QString &street, |
647 | const QString &city, | 652 | const QString &city, |
648 | const QString &state, | 653 | const QString &state, |
649 | const QString &zip, | 654 | const QString &zip, |
650 | const QString &country ) const | 655 | const QString &country ) const |
651 | { | 656 | { |
652 | QString s = street; | 657 | QString s = street; |
653 | if ( !street.isEmpty() ) | 658 | if ( !street.isEmpty() ) |
654 | s+= "\n"; | 659 | s+= "\n"; |
655 | s += city; | 660 | s += city; |
656 | if ( !city.isEmpty() && !state.isEmpty() ) | 661 | if ( !city.isEmpty() && !state.isEmpty() ) |
657 | s += ", "; | 662 | s += ", "; |
658 | s += state; | 663 | s += state; |
659 | if ( !state.isEmpty() && !zip.isEmpty() ) | 664 | if ( !state.isEmpty() && !zip.isEmpty() ) |
660 | s += " "; | 665 | s += " "; |
661 | s += zip; | 666 | s += zip; |
662 | if ( !country.isEmpty() && !s.isEmpty() ) | 667 | if ( !country.isEmpty() && !s.isEmpty() ) |
663 | s += "\n"; | 668 | s += "\n"; |
664 | s += country; | 669 | s += country; |
665 | return s; | 670 | return s; |
666 | } | 671 | } |
667 | 672 | ||
668 | /*! | 673 | /*! |
669 | \internal | 674 | \internal |
670 | */ | 675 | */ |
671 | QString OContact::displayBusinessAddress() const | 676 | QString OContact::displayBusinessAddress() const |
672 | { | 677 | { |
673 | return displayAddress( businessStreet(), businessCity(), | 678 | return displayAddress( businessStreet(), businessCity(), |
674 | businessState(), businessZip(), | 679 | businessState(), businessZip(), |
675 | businessCountry() ); | 680 | businessCountry() ); |
676 | } | 681 | } |
677 | 682 | ||
678 | /*! | 683 | /*! |
679 | \internal | 684 | \internal |
680 | */ | 685 | */ |
681 | QString OContact::displayHomeAddress() const | 686 | QString OContact::displayHomeAddress() const |
682 | { | 687 | { |
683 | return displayAddress( homeStreet(), homeCity(), | 688 | return displayAddress( homeStreet(), homeCity(), |
diff --git a/libopie2/opiepim/ocontact.cpp b/libopie2/opiepim/ocontact.cpp index 38cba72..c9084ad 100644 --- a/libopie2/opiepim/ocontact.cpp +++ b/libopie2/opiepim/ocontact.cpp | |||
@@ -492,192 +492,197 @@ QString OContact::toRichText() const | |||
492 | if ( !(value = homeCity()).isEmpty() ) { | 492 | if ( !(value = homeCity()).isEmpty() ) { |
493 | text += Qtopia::escapeString(value); | 493 | text += Qtopia::escapeString(value); |
494 | if ( !state.isEmpty() ) | 494 | if ( !state.isEmpty() ) |
495 | text += ", " + Qtopia::escapeString(state); | 495 | text += ", " + Qtopia::escapeString(state); |
496 | text += "<br>"; | 496 | text += "<br>"; |
497 | } else if (!state.isEmpty()) | 497 | } else if (!state.isEmpty()) |
498 | text += Qtopia::escapeString(state) + "<br>"; | 498 | text += Qtopia::escapeString(state) + "<br>"; |
499 | if ( !(value = homeZip()).isEmpty() ) | 499 | if ( !(value = homeZip()).isEmpty() ) |
500 | text += Qtopia::escapeString(value) + "<br>"; | 500 | text += Qtopia::escapeString(value) + "<br>"; |
501 | if ( !(value = homeCountry()).isEmpty() ) | 501 | if ( !(value = homeCountry()).isEmpty() ) |
502 | text += Qtopia::escapeString(value) + "<br>"; | 502 | text += Qtopia::escapeString(value) + "<br>"; |
503 | 503 | ||
504 | // the others... | 504 | // the others... |
505 | QString str; | 505 | QString str; |
506 | QString defEmail = defaultEmail(); | 506 | QString defEmail = defaultEmail(); |
507 | if ( !defEmail.isEmpty() ) | 507 | if ( !defEmail.isEmpty() ) |
508 | text += "<b>" + QObject::tr("Default Email: ") + "</b>" | 508 | text += "<b>" + QObject::tr("Default Email: ") + "</b>" |
509 | + Qtopia::escapeString(defEmail) + "<br>"; | 509 | + Qtopia::escapeString(defEmail) + "<br>"; |
510 | str = emails(); | 510 | str = emails(); |
511 | if ( !str.isEmpty() && ( str != defEmail ) ) | 511 | if ( !str.isEmpty() && ( str != defEmail ) ) |
512 | text += "<b>" + QObject::tr("All Emails: ") + "</b>" | 512 | text += "<b>" + QObject::tr("All Emails: ") + "</b>" |
513 | + Qtopia::escapeString(str) + "<br>"; | 513 | + Qtopia::escapeString(str) + "<br>"; |
514 | str = homePhone(); | 514 | str = homePhone(); |
515 | if ( !str.isEmpty() ) | 515 | if ( !str.isEmpty() ) |
516 | text += "<b>" + QObject::tr("Home Phone: ") + "</b>" | 516 | text += "<b>" + QObject::tr("Home Phone: ") + "</b>" |
517 | + Qtopia::escapeString(str) + "<br>"; | 517 | + Qtopia::escapeString(str) + "<br>"; |
518 | str = homeFax(); | 518 | str = homeFax(); |
519 | if ( !str.isEmpty() ) | 519 | if ( !str.isEmpty() ) |
520 | text += "<b>" + QObject::tr("Home Fax: ") + "</b>" | 520 | text += "<b>" + QObject::tr("Home Fax: ") + "</b>" |
521 | + Qtopia::escapeString(str) + "<br>"; | 521 | + Qtopia::escapeString(str) + "<br>"; |
522 | str = homeMobile(); | 522 | str = homeMobile(); |
523 | if ( !str.isEmpty() ) | 523 | if ( !str.isEmpty() ) |
524 | text += "<b>" + QObject::tr("Home Mobile: ") + "</b>" | 524 | text += "<b>" + QObject::tr("Home Mobile: ") + "</b>" |
525 | + Qtopia::escapeString(str) + "<br>"; | 525 | + Qtopia::escapeString(str) + "<br>"; |
526 | str = homeWebpage(); | 526 | str = homeWebpage(); |
527 | if ( !str.isEmpty() ) | 527 | if ( !str.isEmpty() ) |
528 | text += "<b>" + QObject::tr("Home Web Page: ") + "</b>" | 528 | text += "<b>" + QObject::tr("Home Web Page: ") + "</b>" |
529 | + Qtopia::escapeString(str) + "<br>"; | 529 | + Qtopia::escapeString(str) + "<br>"; |
530 | str = businessWebpage(); | 530 | str = businessWebpage(); |
531 | if ( !str.isEmpty() ) | 531 | if ( !str.isEmpty() ) |
532 | text += "<b>" + QObject::tr("Business Web Page: ") + "</b>" | 532 | text += "<b>" + QObject::tr("Business Web Page: ") + "</b>" |
533 | + Qtopia::escapeString(str) + "<br>"; | 533 | + Qtopia::escapeString(str) + "<br>"; |
534 | str = office(); | 534 | str = office(); |
535 | if ( !str.isEmpty() ) | 535 | if ( !str.isEmpty() ) |
536 | text += "<b>" + QObject::tr("Office: ") + "</b>" | 536 | text += "<b>" + QObject::tr("Office: ") + "</b>" |
537 | + Qtopia::escapeString(str) + "<br>"; | 537 | + Qtopia::escapeString(str) + "<br>"; |
538 | str = businessPhone(); | 538 | str = businessPhone(); |
539 | if ( !str.isEmpty() ) | 539 | if ( !str.isEmpty() ) |
540 | text += "<b>" + QObject::tr("Business Phone: ") + "</b>" | 540 | text += "<b>" + QObject::tr("Business Phone: ") + "</b>" |
541 | + Qtopia::escapeString(str) + "<br>"; | 541 | + Qtopia::escapeString(str) + "<br>"; |
542 | str = businessFax(); | 542 | str = businessFax(); |
543 | if ( !str.isEmpty() ) | 543 | if ( !str.isEmpty() ) |
544 | text += "<b>" + QObject::tr("Business Fax: ") + "</b>" | 544 | text += "<b>" + QObject::tr("Business Fax: ") + "</b>" |
545 | + Qtopia::escapeString(str) + "<br>"; | 545 | + Qtopia::escapeString(str) + "<br>"; |
546 | str = businessMobile(); | 546 | str = businessMobile(); |
547 | if ( !str.isEmpty() ) | 547 | if ( !str.isEmpty() ) |
548 | text += "<b>" + QObject::tr("Business Mobile: ") + "</b>" | 548 | text += "<b>" + QObject::tr("Business Mobile: ") + "</b>" |
549 | + Qtopia::escapeString(str) + "<br>"; | 549 | + Qtopia::escapeString(str) + "<br>"; |
550 | str = businessPager(); | 550 | str = businessPager(); |
551 | if ( !str.isEmpty() ) | 551 | if ( !str.isEmpty() ) |
552 | text += "<b>" + QObject::tr("Business Pager: ") + "</b>" | 552 | text += "<b>" + QObject::tr("Business Pager: ") + "</b>" |
553 | + Qtopia::escapeString(str) + "<br>"; | 553 | + Qtopia::escapeString(str) + "<br>"; |
554 | str = profession(); | 554 | str = profession(); |
555 | if ( !str.isEmpty() ) | 555 | if ( !str.isEmpty() ) |
556 | text += "<b>" + QObject::tr("Profession: ") + "</b>" | 556 | text += "<b>" + QObject::tr("Profession: ") + "</b>" |
557 | + Qtopia::escapeString(str) + "<br>"; | 557 | + Qtopia::escapeString(str) + "<br>"; |
558 | str = assistant(); | 558 | str = assistant(); |
559 | if ( !str.isEmpty() ) | 559 | if ( !str.isEmpty() ) |
560 | text += "<b>" + QObject::tr("Assistant: ") + "</b>" | 560 | text += "<b>" + QObject::tr("Assistant: ") + "</b>" |
561 | + Qtopia::escapeString(str) + "<br>"; | 561 | + Qtopia::escapeString(str) + "<br>"; |
562 | str = manager(); | 562 | str = manager(); |
563 | if ( !str.isEmpty() ) | 563 | if ( !str.isEmpty() ) |
564 | text += "<b>" + QObject::tr("Manager: ") + "</b>" | 564 | text += "<b>" + QObject::tr("Manager: ") + "</b>" |
565 | + Qtopia::escapeString(str) + "<br>"; | 565 | + Qtopia::escapeString(str) + "<br>"; |
566 | str = gender(); | 566 | str = gender(); |
567 | if ( !str.isEmpty() && str.toInt() != 0 ) { | 567 | if ( !str.isEmpty() && str.toInt() != 0 ) { |
568 | if ( str.toInt() == 1 ) | 568 | if ( str.toInt() == 1 ) |
569 | str = QObject::tr( "Male" ); | 569 | str = QObject::tr( "Male" ); |
570 | else if ( str.toInt() == 2 ) | 570 | else if ( str.toInt() == 2 ) |
571 | str = QObject::tr( "Female" ); | 571 | str = QObject::tr( "Female" ); |
572 | text += "<b>" + QObject::tr("Gender: ") + "</b>" + str + "<br>"; | 572 | text += "<b>" + QObject::tr("Gender: ") + "</b>" + str + "<br>"; |
573 | } | 573 | } |
574 | str = spouse(); | 574 | str = spouse(); |
575 | if ( !str.isEmpty() ) | 575 | if ( !str.isEmpty() ) |
576 | text += "<b>" + QObject::tr("Spouse: ") + "</b>" | 576 | text += "<b>" + QObject::tr("Spouse: ") + "</b>" |
577 | + Qtopia::escapeString(str) + "<br>"; | 577 | + Qtopia::escapeString(str) + "<br>"; |
578 | if ( birthday().isValid() ){ | 578 | if ( birthday().isValid() ){ |
579 | str = TimeString::numberDateString( birthday() ); | 579 | str = TimeString::numberDateString( birthday() ); |
580 | text += "<b>" + QObject::tr("Birthday: ") + "</b>" | 580 | text += "<b>" + QObject::tr("Birthday: ") + "</b>" |
581 | + Qtopia::escapeString(str) + "<br>"; | 581 | + Qtopia::escapeString(str) + "<br>"; |
582 | } | 582 | } |
583 | if ( anniversary().isValid() ){ | 583 | if ( anniversary().isValid() ){ |
584 | str = TimeString::numberDateString( anniversary() ); | 584 | str = TimeString::numberDateString( anniversary() ); |
585 | text += "<b>" + QObject::tr("Anniversary: ") + "</b>" | 585 | text += "<b>" + QObject::tr("Anniversary: ") + "</b>" |
586 | + Qtopia::escapeString(str) + "<br>"; | 586 | + Qtopia::escapeString(str) + "<br>"; |
587 | } | 587 | } |
588 | str = children(); | ||
589 | if ( !str.isEmpty() ) | ||
590 | text += "<b>" + QObject::tr("Children: ") + "</b>" | ||
591 | + Qtopia::escapeString(str) + "<br>"; | ||
592 | |||
588 | str = nickname(); | 593 | str = nickname(); |
589 | if ( !str.isEmpty() ) | 594 | if ( !str.isEmpty() ) |
590 | text += "<b>" + QObject::tr("Nickname: ") + "</b>" | 595 | text += "<b>" + QObject::tr("Nickname: ") + "</b>" |
591 | + Qtopia::escapeString(str) + "<br>"; | 596 | + Qtopia::escapeString(str) + "<br>"; |
592 | 597 | ||
593 | if ( categoryNames().count() ){ | 598 | if ( categoryNames().count() ){ |
594 | text += "<b>" + QObject::tr( "Category:") + "</b> "; | 599 | text += "<b>" + QObject::tr( "Category:") + "</b> "; |
595 | text += categoryNames().join(", "); | 600 | text += categoryNames().join(", "); |
596 | text += "<br>"; | 601 | text += "<br>"; |
597 | } | 602 | } |
598 | 603 | ||
599 | // notes last | 604 | // notes last |
600 | if ( (value = notes()) ) { | 605 | if ( (value = notes()) ) { |
601 | QRegExp reg("\n"); | 606 | QRegExp reg("\n"); |
602 | 607 | ||
603 | //QString tmp = Qtopia::escapeString(value); | 608 | //QString tmp = Qtopia::escapeString(value); |
604 | QString tmp = QStyleSheet::convertFromPlainText(value); | 609 | QString tmp = QStyleSheet::convertFromPlainText(value); |
605 | //tmp.replace( reg, "<br>" ); | 610 | //tmp.replace( reg, "<br>" ); |
606 | text += "<br>" + tmp + "<br>"; | 611 | text += "<br>" + tmp + "<br>"; |
607 | } | 612 | } |
608 | return text; | 613 | return text; |
609 | } | 614 | } |
610 | 615 | ||
611 | /*! | 616 | /*! |
612 | \internal | 617 | \internal |
613 | */ | 618 | */ |
614 | void OContact::insert( int key, const QString &v ) | 619 | void OContact::insert( int key, const QString &v ) |
615 | { | 620 | { |
616 | QString value = v.stripWhiteSpace(); | 621 | QString value = v.stripWhiteSpace(); |
617 | if ( value.isEmpty() ) | 622 | if ( value.isEmpty() ) |
618 | mMap.remove( key ); | 623 | mMap.remove( key ); |
619 | else | 624 | else |
620 | mMap.insert( key, value ); | 625 | mMap.insert( key, value ); |
621 | } | 626 | } |
622 | 627 | ||
623 | /*! | 628 | /*! |
624 | \internal | 629 | \internal |
625 | */ | 630 | */ |
626 | void OContact::replace( int key, const QString & v ) | 631 | void OContact::replace( int key, const QString & v ) |
627 | { | 632 | { |
628 | QString value = v.stripWhiteSpace(); | 633 | QString value = v.stripWhiteSpace(); |
629 | if ( value.isEmpty() ) | 634 | if ( value.isEmpty() ) |
630 | mMap.remove( key ); | 635 | mMap.remove( key ); |
631 | else | 636 | else |
632 | mMap.replace( key, value ); | 637 | mMap.replace( key, value ); |
633 | } | 638 | } |
634 | 639 | ||
635 | /*! | 640 | /*! |
636 | \internal | 641 | \internal |
637 | */ | 642 | */ |
638 | QString OContact::find( int key ) const | 643 | QString OContact::find( int key ) const |
639 | { | 644 | { |
640 | return mMap[key]; | 645 | return mMap[key]; |
641 | } | 646 | } |
642 | 647 | ||
643 | /*! | 648 | /*! |
644 | \internal | 649 | \internal |
645 | */ | 650 | */ |
646 | QString OContact::displayAddress( const QString &street, | 651 | QString OContact::displayAddress( const QString &street, |
647 | const QString &city, | 652 | const QString &city, |
648 | const QString &state, | 653 | const QString &state, |
649 | const QString &zip, | 654 | const QString &zip, |
650 | const QString &country ) const | 655 | const QString &country ) const |
651 | { | 656 | { |
652 | QString s = street; | 657 | QString s = street; |
653 | if ( !street.isEmpty() ) | 658 | if ( !street.isEmpty() ) |
654 | s+= "\n"; | 659 | s+= "\n"; |
655 | s += city; | 660 | s += city; |
656 | if ( !city.isEmpty() && !state.isEmpty() ) | 661 | if ( !city.isEmpty() && !state.isEmpty() ) |
657 | s += ", "; | 662 | s += ", "; |
658 | s += state; | 663 | s += state; |
659 | if ( !state.isEmpty() && !zip.isEmpty() ) | 664 | if ( !state.isEmpty() && !zip.isEmpty() ) |
660 | s += " "; | 665 | s += " "; |
661 | s += zip; | 666 | s += zip; |
662 | if ( !country.isEmpty() && !s.isEmpty() ) | 667 | if ( !country.isEmpty() && !s.isEmpty() ) |
663 | s += "\n"; | 668 | s += "\n"; |
664 | s += country; | 669 | s += country; |
665 | return s; | 670 | return s; |
666 | } | 671 | } |
667 | 672 | ||
668 | /*! | 673 | /*! |
669 | \internal | 674 | \internal |
670 | */ | 675 | */ |
671 | QString OContact::displayBusinessAddress() const | 676 | QString OContact::displayBusinessAddress() const |
672 | { | 677 | { |
673 | return displayAddress( businessStreet(), businessCity(), | 678 | return displayAddress( businessStreet(), businessCity(), |
674 | businessState(), businessZip(), | 679 | businessState(), businessZip(), |
675 | businessCountry() ); | 680 | businessCountry() ); |
676 | } | 681 | } |
677 | 682 | ||
678 | /*! | 683 | /*! |
679 | \internal | 684 | \internal |
680 | */ | 685 | */ |
681 | QString OContact::displayHomeAddress() const | 686 | QString OContact::displayHomeAddress() const |
682 | { | 687 | { |
683 | return displayAddress( homeStreet(), homeCity(), | 688 | return displayAddress( homeStreet(), homeCity(), |