-rw-r--r-- | kabc/addressee.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 2f4a9af..6cfac80 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -711,769 +711,769 @@ void Addressee::setID( const QString & prof , const QString & id ) | |||
711 | //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); | 711 | //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); |
712 | } | 712 | } |
713 | void Addressee::setTempSyncStat( int id ) | 713 | void Addressee::setTempSyncStat( int id ) |
714 | { | 714 | { |
715 | if ( mData->mTempSyncStat == id ) return; | 715 | if ( mData->mTempSyncStat == id ) return; |
716 | detach(); | 716 | detach(); |
717 | mData->mTempSyncStat = id; | 717 | mData->mTempSyncStat = id; |
718 | } | 718 | } |
719 | int Addressee::tempSyncStat() const | 719 | int Addressee::tempSyncStat() const |
720 | { | 720 | { |
721 | return mData->mTempSyncStat; | 721 | return mData->mTempSyncStat; |
722 | } | 722 | } |
723 | 723 | ||
724 | const QString Addressee::getID( const QString & prof) const | 724 | const QString Addressee::getID( const QString & prof) const |
725 | { | 725 | { |
726 | return KIdManager::getId ( mData->mExternalId, prof ); | 726 | return KIdManager::getId ( mData->mExternalId, prof ); |
727 | } | 727 | } |
728 | 728 | ||
729 | void Addressee::setCsum( const QString & prof , const QString & id ) | 729 | void Addressee::setCsum( const QString & prof , const QString & id ) |
730 | { | 730 | { |
731 | detach(); | 731 | detach(); |
732 | //qDebug("setcsum1 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); | 732 | //qDebug("setcsum1 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); |
733 | mData->mExternalId = KIdManager::setCsum ( mData->mExternalId, prof, id ); | 733 | mData->mExternalId = KIdManager::setCsum ( mData->mExternalId, prof, id ); |
734 | //qDebug("setcsum2 %s ",mData->mExternalId.latin1() ); | 734 | //qDebug("setcsum2 %s ",mData->mExternalId.latin1() ); |
735 | } | 735 | } |
736 | 736 | ||
737 | const QString Addressee::getCsum( const QString & prof) const | 737 | const QString Addressee::getCsum( const QString & prof) const |
738 | { | 738 | { |
739 | return KIdManager::getCsum ( mData->mExternalId, prof ); | 739 | return KIdManager::getCsum ( mData->mExternalId, prof ); |
740 | } | 740 | } |
741 | 741 | ||
742 | void Addressee::setIDStr( const QString & s ) | 742 | void Addressee::setIDStr( const QString & s ) |
743 | { | 743 | { |
744 | detach(); | 744 | detach(); |
745 | mData->mExternalId = s; | 745 | mData->mExternalId = s; |
746 | } | 746 | } |
747 | 747 | ||
748 | const QString Addressee::IDStr() const | 748 | const QString Addressee::IDStr() const |
749 | { | 749 | { |
750 | return mData->mExternalId; | 750 | return mData->mExternalId; |
751 | } | 751 | } |
752 | 752 | ||
753 | void Addressee::setExternalUID( const QString &id ) | 753 | void Addressee::setExternalUID( const QString &id ) |
754 | { | 754 | { |
755 | if ( id == mData->externalUID ) return; | 755 | if ( id == mData->externalUID ) return; |
756 | detach(); | 756 | detach(); |
757 | mData->empty = false; | 757 | mData->empty = false; |
758 | mData->externalUID = id; | 758 | mData->externalUID = id; |
759 | } | 759 | } |
760 | 760 | ||
761 | const QString Addressee::externalUID() const | 761 | const QString Addressee::externalUID() const |
762 | { | 762 | { |
763 | return mData->externalUID; | 763 | return mData->externalUID; |
764 | } | 764 | } |
765 | void Addressee::setOriginalExternalUID( const QString &id ) | 765 | void Addressee::setOriginalExternalUID( const QString &id ) |
766 | { | 766 | { |
767 | if ( id == mData->originalExternalUID ) return; | 767 | if ( id == mData->originalExternalUID ) return; |
768 | detach(); | 768 | detach(); |
769 | mData->empty = false; | 769 | mData->empty = false; |
770 | //qDebug("*******Set orig uid %s ", id.latin1()); | 770 | //qDebug("*******Set orig uid %s ", id.latin1()); |
771 | mData->originalExternalUID = id; | 771 | mData->originalExternalUID = id; |
772 | } | 772 | } |
773 | 773 | ||
774 | QString Addressee::originalExternalUID() const | 774 | QString Addressee::originalExternalUID() const |
775 | { | 775 | { |
776 | return mData->originalExternalUID; | 776 | return mData->originalExternalUID; |
777 | } | 777 | } |
778 | 778 | ||
779 | void Addressee::setUid( const QString &id ) | 779 | void Addressee::setUid( const QString &id ) |
780 | { | 780 | { |
781 | if ( id == mData->uid ) return; | 781 | if ( id == mData->uid ) return; |
782 | detach(); | 782 | detach(); |
783 | //qDebug("****setuid %s ", id.latin1()); | 783 | //qDebug("****setuid %s ", id.latin1()); |
784 | mData->empty = false; | 784 | mData->empty = false; |
785 | mData->uid = id; | 785 | mData->uid = id; |
786 | } | 786 | } |
787 | 787 | ||
788 | const QString Addressee::uid() const | 788 | const QString Addressee::uid() const |
789 | { | 789 | { |
790 | if ( mData->uid.isEmpty() ) | 790 | if ( mData->uid.isEmpty() ) |
791 | mData->uid = KApplication::randomString( 10 ); | 791 | mData->uid = KApplication::randomString( 10 ); |
792 | 792 | ||
793 | return mData->uid; | 793 | return mData->uid; |
794 | } | 794 | } |
795 | 795 | ||
796 | QString Addressee::uidLabel() | 796 | QString Addressee::uidLabel() |
797 | { | 797 | { |
798 | return i18n("Unique Identifier"); | 798 | return i18n("Unique Identifier"); |
799 | } | 799 | } |
800 | 800 | ||
801 | void Addressee::setName( const QString &name ) | 801 | void Addressee::setName( const QString &name ) |
802 | { | 802 | { |
803 | if ( name == mData->name ) return; | 803 | if ( name == mData->name ) return; |
804 | detach(); | 804 | detach(); |
805 | mData->empty = false; | 805 | mData->empty = false; |
806 | mData->name = name; | 806 | mData->name = name; |
807 | } | 807 | } |
808 | 808 | ||
809 | QString Addressee::name() const | 809 | QString Addressee::name() const |
810 | { | 810 | { |
811 | return mData->name; | 811 | return mData->name; |
812 | } | 812 | } |
813 | 813 | ||
814 | QString Addressee::nameLabel() | 814 | QString Addressee::nameLabel() |
815 | { | 815 | { |
816 | return i18n("Name"); | 816 | return i18n("Name"); |
817 | } | 817 | } |
818 | 818 | ||
819 | 819 | ||
820 | void Addressee::setFormattedName( const QString &formattedName ) | 820 | void Addressee::setFormattedName( const QString &formattedName ) |
821 | { | 821 | { |
822 | if ( formattedName == mData->formattedName ) return; | 822 | if ( formattedName == mData->formattedName ) return; |
823 | detach(); | 823 | detach(); |
824 | mData->empty = false; | 824 | mData->empty = false; |
825 | mData->formattedName = formattedName; | 825 | mData->formattedName = formattedName; |
826 | } | 826 | } |
827 | 827 | ||
828 | QString Addressee::formattedName() const | 828 | QString Addressee::formattedName() const |
829 | { | 829 | { |
830 | return mData->formattedName; | 830 | return mData->formattedName; |
831 | } | 831 | } |
832 | 832 | ||
833 | QString Addressee::formattedNameLabel() | 833 | QString Addressee::formattedNameLabel() |
834 | { | 834 | { |
835 | return i18n("Formatted Name"); | 835 | return i18n("Formatted Name"); |
836 | } | 836 | } |
837 | 837 | ||
838 | 838 | ||
839 | void Addressee::setFamilyName( const QString &familyName ) | 839 | void Addressee::setFamilyName( const QString &familyName ) |
840 | { | 840 | { |
841 | if ( familyName == mData->familyName ) return; | 841 | if ( familyName == mData->familyName ) return; |
842 | detach(); | 842 | detach(); |
843 | mData->empty = false; | 843 | mData->empty = false; |
844 | mData->familyName = familyName; | 844 | mData->familyName = familyName; |
845 | } | 845 | } |
846 | 846 | ||
847 | QString Addressee::familyName() const | 847 | QString Addressee::familyName() const |
848 | { | 848 | { |
849 | return mData->familyName; | 849 | return mData->familyName; |
850 | } | 850 | } |
851 | 851 | ||
852 | QString Addressee::familyNameLabel() | 852 | QString Addressee::familyNameLabel() |
853 | { | 853 | { |
854 | return i18n("Family Name"); | 854 | return i18n("Family Name"); |
855 | } | 855 | } |
856 | 856 | ||
857 | 857 | ||
858 | void Addressee::setGivenName( const QString &givenName ) | 858 | void Addressee::setGivenName( const QString &givenName ) |
859 | { | 859 | { |
860 | if ( givenName == mData->givenName ) return; | 860 | if ( givenName == mData->givenName ) return; |
861 | detach(); | 861 | detach(); |
862 | mData->empty = false; | 862 | mData->empty = false; |
863 | mData->givenName = givenName; | 863 | mData->givenName = givenName; |
864 | } | 864 | } |
865 | 865 | ||
866 | QString Addressee::givenName() const | 866 | QString Addressee::givenName() const |
867 | { | 867 | { |
868 | return mData->givenName; | 868 | return mData->givenName; |
869 | } | 869 | } |
870 | 870 | ||
871 | QString Addressee::givenNameLabel() | 871 | QString Addressee::givenNameLabel() |
872 | { | 872 | { |
873 | return i18n("Given Name"); | 873 | return i18n("Given Name"); |
874 | } | 874 | } |
875 | 875 | ||
876 | 876 | ||
877 | void Addressee::setAdditionalName( const QString &additionalName ) | 877 | void Addressee::setAdditionalName( const QString &additionalName ) |
878 | { | 878 | { |
879 | if ( additionalName == mData->additionalName ) return; | 879 | if ( additionalName == mData->additionalName ) return; |
880 | detach(); | 880 | detach(); |
881 | mData->empty = false; | 881 | mData->empty = false; |
882 | mData->additionalName = additionalName; | 882 | mData->additionalName = additionalName; |
883 | } | 883 | } |
884 | 884 | ||
885 | QString Addressee::additionalName() const | 885 | QString Addressee::additionalName() const |
886 | { | 886 | { |
887 | return mData->additionalName; | 887 | return mData->additionalName; |
888 | } | 888 | } |
889 | 889 | ||
890 | QString Addressee::additionalNameLabel() | 890 | QString Addressee::additionalNameLabel() |
891 | { | 891 | { |
892 | return i18n("Additional Names"); | 892 | return i18n("Additional Names"); |
893 | } | 893 | } |
894 | 894 | ||
895 | 895 | ||
896 | void Addressee::setPrefix( const QString &prefix ) | 896 | void Addressee::setPrefix( const QString &prefix ) |
897 | { | 897 | { |
898 | if ( prefix == mData->prefix ) return; | 898 | if ( prefix == mData->prefix ) return; |
899 | detach(); | 899 | detach(); |
900 | mData->empty = false; | 900 | mData->empty = false; |
901 | mData->prefix = prefix; | 901 | mData->prefix = prefix; |
902 | } | 902 | } |
903 | 903 | ||
904 | QString Addressee::prefix() const | 904 | QString Addressee::prefix() const |
905 | { | 905 | { |
906 | return mData->prefix; | 906 | return mData->prefix; |
907 | } | 907 | } |
908 | 908 | ||
909 | QString Addressee::prefixLabel() | 909 | QString Addressee::prefixLabel() |
910 | { | 910 | { |
911 | return i18n("Honorific Prefixes"); | 911 | return i18n("Honorific Prefixes"); |
912 | } | 912 | } |
913 | 913 | ||
914 | 914 | ||
915 | void Addressee::setSuffix( const QString &suffix ) | 915 | void Addressee::setSuffix( const QString &suffix ) |
916 | { | 916 | { |
917 | if ( suffix == mData->suffix ) return; | 917 | if ( suffix == mData->suffix ) return; |
918 | detach(); | 918 | detach(); |
919 | mData->empty = false; | 919 | mData->empty = false; |
920 | mData->suffix = suffix; | 920 | mData->suffix = suffix; |
921 | } | 921 | } |
922 | 922 | ||
923 | QString Addressee::suffix() const | 923 | QString Addressee::suffix() const |
924 | { | 924 | { |
925 | return mData->suffix; | 925 | return mData->suffix; |
926 | } | 926 | } |
927 | 927 | ||
928 | QString Addressee::suffixLabel() | 928 | QString Addressee::suffixLabel() |
929 | { | 929 | { |
930 | return i18n("Honorific Suffixes"); | 930 | return i18n("Honorific Suffixes"); |
931 | } | 931 | } |
932 | 932 | ||
933 | 933 | ||
934 | void Addressee::setNickName( const QString &nickName ) | 934 | void Addressee::setNickName( const QString &nickName ) |
935 | { | 935 | { |
936 | if ( nickName == mData->nickName ) return; | 936 | if ( nickName == mData->nickName ) return; |
937 | detach(); | 937 | detach(); |
938 | mData->empty = false; | 938 | mData->empty = false; |
939 | mData->nickName = nickName; | 939 | mData->nickName = nickName; |
940 | } | 940 | } |
941 | 941 | ||
942 | QString Addressee::nickName() const | 942 | QString Addressee::nickName() const |
943 | { | 943 | { |
944 | return mData->nickName; | 944 | return mData->nickName; |
945 | } | 945 | } |
946 | 946 | ||
947 | QString Addressee::nickNameLabel() | 947 | QString Addressee::nickNameLabel() |
948 | { | 948 | { |
949 | return i18n("Nick Name"); | 949 | return i18n("Nick Name"); |
950 | } | 950 | } |
951 | 951 | ||
952 | 952 | ||
953 | void Addressee::setBirthday( const QDateTime &birthday ) | 953 | void Addressee::setBirthday( const QDateTime &birthday ) |
954 | { | 954 | { |
955 | if ( birthday == mData->birthday ) return; | 955 | if ( birthday == mData->birthday ) return; |
956 | detach(); | 956 | detach(); |
957 | mData->empty = false; | 957 | mData->empty = false; |
958 | mData->birthday = birthday; | 958 | mData->birthday = birthday; |
959 | } | 959 | } |
960 | 960 | ||
961 | QDateTime Addressee::birthday() const | 961 | QDateTime Addressee::birthday() const |
962 | { | 962 | { |
963 | return mData->birthday; | 963 | return mData->birthday; |
964 | } | 964 | } |
965 | 965 | ||
966 | QString Addressee::birthdayLabel() | 966 | QString Addressee::birthdayLabel() |
967 | { | 967 | { |
968 | return i18n("Birthday"); | 968 | return i18n("Birthday"); |
969 | } | 969 | } |
970 | 970 | ||
971 | 971 | ||
972 | QString Addressee::homeAddressStreetLabel() | 972 | QString Addressee::homeAddressStreetLabel() |
973 | { | 973 | { |
974 | return i18n("Home Address Street"); | 974 | return i18n("Home Address Street"); |
975 | } | 975 | } |
976 | 976 | ||
977 | 977 | ||
978 | QString Addressee::homeAddressLocalityLabel() | 978 | QString Addressee::homeAddressLocalityLabel() |
979 | { | 979 | { |
980 | return i18n("Home Address Locality"); | 980 | return i18n("Home Address Locality"); |
981 | } | 981 | } |
982 | 982 | ||
983 | 983 | ||
984 | QString Addressee::homeAddressRegionLabel() | 984 | QString Addressee::homeAddressRegionLabel() |
985 | { | 985 | { |
986 | return i18n("Home Address Region"); | 986 | return i18n("Home Address Region"); |
987 | } | 987 | } |
988 | 988 | ||
989 | 989 | ||
990 | QString Addressee::homeAddressPostalCodeLabel() | 990 | QString Addressee::homeAddressPostalCodeLabel() |
991 | { | 991 | { |
992 | return i18n("Home Address Postal Code"); | 992 | return i18n("Home Address Postal Code"); |
993 | } | 993 | } |
994 | 994 | ||
995 | 995 | ||
996 | QString Addressee::homeAddressCountryLabel() | 996 | QString Addressee::homeAddressCountryLabel() |
997 | { | 997 | { |
998 | return i18n("Home Address Country"); | 998 | return i18n("Home Address Country"); |
999 | } | 999 | } |
1000 | 1000 | ||
1001 | 1001 | ||
1002 | QString Addressee::homeAddressLabelLabel() | 1002 | QString Addressee::homeAddressLabelLabel() |
1003 | { | 1003 | { |
1004 | return i18n("Home Address Label"); | 1004 | return i18n("Home Address Label"); |
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | 1007 | ||
1008 | QString Addressee::businessAddressStreetLabel() | 1008 | QString Addressee::businessAddressStreetLabel() |
1009 | { | 1009 | { |
1010 | return i18n("Business Address Street"); | 1010 | return i18n("Business Address Street"); |
1011 | } | 1011 | } |
1012 | 1012 | ||
1013 | 1013 | ||
1014 | QString Addressee::businessAddressLocalityLabel() | 1014 | QString Addressee::businessAddressLocalityLabel() |
1015 | { | 1015 | { |
1016 | return i18n("Business Address Locality"); | 1016 | return i18n("Business Address Locality"); |
1017 | } | 1017 | } |
1018 | 1018 | ||
1019 | 1019 | ||
1020 | QString Addressee::businessAddressRegionLabel() | 1020 | QString Addressee::businessAddressRegionLabel() |
1021 | { | 1021 | { |
1022 | return i18n("Business Address Region"); | 1022 | return i18n("Business Address Region"); |
1023 | } | 1023 | } |
1024 | 1024 | ||
1025 | 1025 | ||
1026 | QString Addressee::businessAddressPostalCodeLabel() | 1026 | QString Addressee::businessAddressPostalCodeLabel() |
1027 | { | 1027 | { |
1028 | return i18n("Business Address Postal Code"); | 1028 | return i18n("Business Address Postal Code"); |
1029 | } | 1029 | } |
1030 | 1030 | ||
1031 | 1031 | ||
1032 | QString Addressee::businessAddressCountryLabel() | 1032 | QString Addressee::businessAddressCountryLabel() |
1033 | { | 1033 | { |
1034 | return i18n("Business Address Country"); | 1034 | return i18n("Business Address Country"); |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | 1037 | ||
1038 | QString Addressee::businessAddressLabelLabel() | 1038 | QString Addressee::businessAddressLabelLabel() |
1039 | { | 1039 | { |
1040 | return i18n("Business Address Label"); | 1040 | return i18n("Business Address Label"); |
1041 | } | 1041 | } |
1042 | 1042 | ||
1043 | 1043 | ||
1044 | QString Addressee::homePhoneLabel() | 1044 | QString Addressee::homePhoneLabel() |
1045 | { | 1045 | { |
1046 | return i18n("Home Phone"); | 1046 | return i18n("Home Phone"); |
1047 | } | 1047 | } |
1048 | 1048 | ||
1049 | 1049 | ||
1050 | QString Addressee::businessPhoneLabel() | 1050 | QString Addressee::businessPhoneLabel() |
1051 | { | 1051 | { |
1052 | return i18n("Work Phone"); | 1052 | return i18n("Work Phone"); |
1053 | } | 1053 | } |
1054 | 1054 | ||
1055 | 1055 | ||
1056 | QString Addressee::mobilePhoneLabel() | 1056 | QString Addressee::mobilePhoneLabel() |
1057 | { | 1057 | { |
1058 | return i18n("Mobile"); | 1058 | return i18n("Mobile"); |
1059 | } | 1059 | } |
1060 | QString Addressee::mobileWorkPhoneLabel() | 1060 | QString Addressee::mobileWorkPhoneLabel() |
1061 | { | 1061 | { |
1062 | return i18n("Mobile2"); | 1062 | return i18n("Mobile2"); |
1063 | } | 1063 | } |
1064 | 1064 | ||
1065 | 1065 | ||
1066 | QString Addressee::homeFaxLabel() | 1066 | QString Addressee::homeFaxLabel() |
1067 | { | 1067 | { |
1068 | return i18n("Fax (Home)"); | 1068 | return i18n("Fax (Home)"); |
1069 | } | 1069 | } |
1070 | 1070 | ||
1071 | 1071 | ||
1072 | QString Addressee::businessFaxLabel() | 1072 | QString Addressee::businessFaxLabel() |
1073 | { | 1073 | { |
1074 | return i18n("Fax (Work)"); | 1074 | return i18n("Fax (Work)"); |
1075 | } | 1075 | } |
1076 | 1076 | ||
1077 | 1077 | ||
1078 | QString Addressee::isdnLabel() | 1078 | QString Addressee::isdnLabel() |
1079 | { | 1079 | { |
1080 | return i18n("ISDN"); | 1080 | return i18n("ISDN"); |
1081 | } | 1081 | } |
1082 | 1082 | ||
1083 | 1083 | ||
1084 | QString Addressee::pagerLabel() | 1084 | QString Addressee::pagerLabel() |
1085 | { | 1085 | { |
1086 | return i18n("Pager"); | 1086 | return i18n("Pager"); |
1087 | } | 1087 | } |
1088 | QString Addressee::otherPhoneLabel() | 1088 | QString Addressee::otherPhoneLabel() |
1089 | { | 1089 | { |
1090 | return i18n("Other Phone"); | 1090 | return i18n("Other Phone"); |
1091 | } | 1091 | } |
1092 | 1092 | ||
1093 | QString Addressee::sipLabel() | 1093 | QString Addressee::sipLabel() |
1094 | { | 1094 | { |
1095 | return i18n("SIP"); | 1095 | return i18n("SiP"); |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | QString Addressee::emailLabel() | 1098 | QString Addressee::emailLabel() |
1099 | { | 1099 | { |
1100 | return i18n("Email Address"); | 1100 | return i18n("Email Address"); |
1101 | } | 1101 | } |
1102 | 1102 | ||
1103 | 1103 | ||
1104 | void Addressee::setMailer( const QString &mailer ) | 1104 | void Addressee::setMailer( const QString &mailer ) |
1105 | { | 1105 | { |
1106 | if ( mailer == mData->mailer ) return; | 1106 | if ( mailer == mData->mailer ) return; |
1107 | detach(); | 1107 | detach(); |
1108 | mData->empty = false; | 1108 | mData->empty = false; |
1109 | mData->mailer = mailer; | 1109 | mData->mailer = mailer; |
1110 | } | 1110 | } |
1111 | 1111 | ||
1112 | QString Addressee::mailer() const | 1112 | QString Addressee::mailer() const |
1113 | { | 1113 | { |
1114 | return mData->mailer; | 1114 | return mData->mailer; |
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | QString Addressee::mailerLabel() | 1117 | QString Addressee::mailerLabel() |
1118 | { | 1118 | { |
1119 | return i18n("Mail Client"); | 1119 | return i18n("Mail Client"); |
1120 | } | 1120 | } |
1121 | 1121 | ||
1122 | 1122 | ||
1123 | void Addressee::setTimeZone( const TimeZone &timeZone ) | 1123 | void Addressee::setTimeZone( const TimeZone &timeZone ) |
1124 | { | 1124 | { |
1125 | if ( timeZone == mData->timeZone ) return; | 1125 | if ( timeZone == mData->timeZone ) return; |
1126 | detach(); | 1126 | detach(); |
1127 | mData->empty = false; | 1127 | mData->empty = false; |
1128 | mData->timeZone = timeZone; | 1128 | mData->timeZone = timeZone; |
1129 | } | 1129 | } |
1130 | 1130 | ||
1131 | TimeZone Addressee::timeZone() const | 1131 | TimeZone Addressee::timeZone() const |
1132 | { | 1132 | { |
1133 | return mData->timeZone; | 1133 | return mData->timeZone; |
1134 | } | 1134 | } |
1135 | 1135 | ||
1136 | QString Addressee::timeZoneLabel() | 1136 | QString Addressee::timeZoneLabel() |
1137 | { | 1137 | { |
1138 | return i18n("Time Zone"); | 1138 | return i18n("Time Zone"); |
1139 | } | 1139 | } |
1140 | 1140 | ||
1141 | 1141 | ||
1142 | void Addressee::setGeo( const Geo &geo ) | 1142 | void Addressee::setGeo( const Geo &geo ) |
1143 | { | 1143 | { |
1144 | if ( geo == mData->geo ) return; | 1144 | if ( geo == mData->geo ) return; |
1145 | detach(); | 1145 | detach(); |
1146 | mData->empty = false; | 1146 | mData->empty = false; |
1147 | mData->geo = geo; | 1147 | mData->geo = geo; |
1148 | } | 1148 | } |
1149 | 1149 | ||
1150 | Geo Addressee::geo() const | 1150 | Geo Addressee::geo() const |
1151 | { | 1151 | { |
1152 | return mData->geo; | 1152 | return mData->geo; |
1153 | } | 1153 | } |
1154 | 1154 | ||
1155 | QString Addressee::geoLabel() | 1155 | QString Addressee::geoLabel() |
1156 | { | 1156 | { |
1157 | return i18n("Geographic Position"); | 1157 | return i18n("Geographic Position"); |
1158 | } | 1158 | } |
1159 | 1159 | ||
1160 | 1160 | ||
1161 | void Addressee::setTitle( const QString &title ) | 1161 | void Addressee::setTitle( const QString &title ) |
1162 | { | 1162 | { |
1163 | if ( title == mData->title ) return; | 1163 | if ( title == mData->title ) return; |
1164 | detach(); | 1164 | detach(); |
1165 | mData->empty = false; | 1165 | mData->empty = false; |
1166 | mData->title = title; | 1166 | mData->title = title; |
1167 | } | 1167 | } |
1168 | 1168 | ||
1169 | QString Addressee::title() const | 1169 | QString Addressee::title() const |
1170 | { | 1170 | { |
1171 | return mData->title; | 1171 | return mData->title; |
1172 | } | 1172 | } |
1173 | 1173 | ||
1174 | QString Addressee::titleLabel() | 1174 | QString Addressee::titleLabel() |
1175 | { | 1175 | { |
1176 | return i18n("Title"); | 1176 | return i18n("Title"); |
1177 | } | 1177 | } |
1178 | 1178 | ||
1179 | 1179 | ||
1180 | void Addressee::setRole( const QString &role ) | 1180 | void Addressee::setRole( const QString &role ) |
1181 | { | 1181 | { |
1182 | if ( role == mData->role ) return; | 1182 | if ( role == mData->role ) return; |
1183 | detach(); | 1183 | detach(); |
1184 | mData->empty = false; | 1184 | mData->empty = false; |
1185 | mData->role = role; | 1185 | mData->role = role; |
1186 | } | 1186 | } |
1187 | 1187 | ||
1188 | QString Addressee::role() const | 1188 | QString Addressee::role() const |
1189 | { | 1189 | { |
1190 | return mData->role; | 1190 | return mData->role; |
1191 | } | 1191 | } |
1192 | 1192 | ||
1193 | QString Addressee::roleLabel() | 1193 | QString Addressee::roleLabel() |
1194 | { | 1194 | { |
1195 | return i18n("Role"); | 1195 | return i18n("Role"); |
1196 | } | 1196 | } |
1197 | 1197 | ||
1198 | 1198 | ||
1199 | void Addressee::setOrganization( const QString &organization ) | 1199 | void Addressee::setOrganization( const QString &organization ) |
1200 | { | 1200 | { |
1201 | if ( organization == mData->organization ) return; | 1201 | if ( organization == mData->organization ) return; |
1202 | detach(); | 1202 | detach(); |
1203 | mData->empty = false; | 1203 | mData->empty = false; |
1204 | mData->organization = organization; | 1204 | mData->organization = organization; |
1205 | } | 1205 | } |
1206 | 1206 | ||
1207 | QString Addressee::organization() const | 1207 | QString Addressee::organization() const |
1208 | { | 1208 | { |
1209 | return mData->organization; | 1209 | return mData->organization; |
1210 | } | 1210 | } |
1211 | 1211 | ||
1212 | QString Addressee::organizationLabel() | 1212 | QString Addressee::organizationLabel() |
1213 | { | 1213 | { |
1214 | return i18n("Organization"); | 1214 | return i18n("Organization"); |
1215 | } | 1215 | } |
1216 | 1216 | ||
1217 | 1217 | ||
1218 | void Addressee::setNote( const QString ¬e ) | 1218 | void Addressee::setNote( const QString ¬e ) |
1219 | { | 1219 | { |
1220 | if ( note == mData->note ) return; | 1220 | if ( note == mData->note ) return; |
1221 | detach(); | 1221 | detach(); |
1222 | mData->empty = false; | 1222 | mData->empty = false; |
1223 | mData->note = note; | 1223 | mData->note = note; |
1224 | } | 1224 | } |
1225 | 1225 | ||
1226 | QString Addressee::note() const | 1226 | QString Addressee::note() const |
1227 | { | 1227 | { |
1228 | return mData->note; | 1228 | return mData->note; |
1229 | } | 1229 | } |
1230 | 1230 | ||
1231 | QString Addressee::noteLabel() | 1231 | QString Addressee::noteLabel() |
1232 | { | 1232 | { |
1233 | return i18n("Note"); | 1233 | return i18n("Note"); |
1234 | } | 1234 | } |
1235 | 1235 | ||
1236 | 1236 | ||
1237 | void Addressee::setProductId( const QString &productId ) | 1237 | void Addressee::setProductId( const QString &productId ) |
1238 | { | 1238 | { |
1239 | if ( productId == mData->productId ) return; | 1239 | if ( productId == mData->productId ) return; |
1240 | detach(); | 1240 | detach(); |
1241 | mData->empty = false; | 1241 | mData->empty = false; |
1242 | mData->productId = productId; | 1242 | mData->productId = productId; |
1243 | } | 1243 | } |
1244 | 1244 | ||
1245 | QString Addressee::productId() const | 1245 | QString Addressee::productId() const |
1246 | { | 1246 | { |
1247 | return mData->productId; | 1247 | return mData->productId; |
1248 | } | 1248 | } |
1249 | 1249 | ||
1250 | QString Addressee::productIdLabel() | 1250 | QString Addressee::productIdLabel() |
1251 | { | 1251 | { |
1252 | return i18n("Product Identifier"); | 1252 | return i18n("Product Identifier"); |
1253 | } | 1253 | } |
1254 | 1254 | ||
1255 | 1255 | ||
1256 | void Addressee::setRevision( const QDateTime &revision ) | 1256 | void Addressee::setRevision( const QDateTime &revision ) |
1257 | { | 1257 | { |
1258 | if ( revision == mData->revision ) return; | 1258 | if ( revision == mData->revision ) return; |
1259 | detach(); | 1259 | detach(); |
1260 | mData->empty = false; | 1260 | mData->empty = false; |
1261 | mData->revision = QDateTime( revision.date(), | 1261 | mData->revision = QDateTime( revision.date(), |
1262 | QTime (revision.time().hour(), | 1262 | QTime (revision.time().hour(), |
1263 | revision.time().minute(), | 1263 | revision.time().minute(), |
1264 | revision.time().second())); | 1264 | revision.time().second())); |
1265 | } | 1265 | } |
1266 | 1266 | ||
1267 | QDateTime Addressee::revision() const | 1267 | QDateTime Addressee::revision() const |
1268 | { | 1268 | { |
1269 | return mData->revision; | 1269 | return mData->revision; |
1270 | } | 1270 | } |
1271 | 1271 | ||
1272 | QString Addressee::revisionLabel() | 1272 | QString Addressee::revisionLabel() |
1273 | { | 1273 | { |
1274 | return i18n("Revision Date"); | 1274 | return i18n("Revision Date"); |
1275 | } | 1275 | } |
1276 | 1276 | ||
1277 | 1277 | ||
1278 | void Addressee::setSortString( const QString &sortString ) | 1278 | void Addressee::setSortString( const QString &sortString ) |
1279 | { | 1279 | { |
1280 | if ( sortString == mData->sortString ) return; | 1280 | if ( sortString == mData->sortString ) return; |
1281 | detach(); | 1281 | detach(); |
1282 | mData->empty = false; | 1282 | mData->empty = false; |
1283 | mData->sortString = sortString; | 1283 | mData->sortString = sortString; |
1284 | } | 1284 | } |
1285 | 1285 | ||
1286 | QString Addressee::sortString() const | 1286 | QString Addressee::sortString() const |
1287 | { | 1287 | { |
1288 | return mData->sortString; | 1288 | return mData->sortString; |
1289 | } | 1289 | } |
1290 | 1290 | ||
1291 | QString Addressee::sortStringLabel() | 1291 | QString Addressee::sortStringLabel() |
1292 | { | 1292 | { |
1293 | return i18n("Sort String"); | 1293 | return i18n("Sort String"); |
1294 | } | 1294 | } |
1295 | 1295 | ||
1296 | 1296 | ||
1297 | void Addressee::setUrl( const KURL &url ) | 1297 | void Addressee::setUrl( const KURL &url ) |
1298 | { | 1298 | { |
1299 | if ( url == mData->url ) return; | 1299 | if ( url == mData->url ) return; |
1300 | detach(); | 1300 | detach(); |
1301 | mData->empty = false; | 1301 | mData->empty = false; |
1302 | mData->url = url; | 1302 | mData->url = url; |
1303 | } | 1303 | } |
1304 | 1304 | ||
1305 | KURL Addressee::url() const | 1305 | KURL Addressee::url() const |
1306 | { | 1306 | { |
1307 | return mData->url; | 1307 | return mData->url; |
1308 | } | 1308 | } |
1309 | 1309 | ||
1310 | QString Addressee::urlLabel() | 1310 | QString Addressee::urlLabel() |
1311 | { | 1311 | { |
1312 | return i18n("URL"); | 1312 | return i18n("URL"); |
1313 | } | 1313 | } |
1314 | 1314 | ||
1315 | 1315 | ||
1316 | void Addressee::setSecrecy( const Secrecy &secrecy ) | 1316 | void Addressee::setSecrecy( const Secrecy &secrecy ) |
1317 | { | 1317 | { |
1318 | if ( secrecy == mData->secrecy ) return; | 1318 | if ( secrecy == mData->secrecy ) return; |
1319 | detach(); | 1319 | detach(); |
1320 | mData->empty = false; | 1320 | mData->empty = false; |
1321 | mData->secrecy = secrecy; | 1321 | mData->secrecy = secrecy; |
1322 | } | 1322 | } |
1323 | 1323 | ||
1324 | Secrecy Addressee::secrecy() const | 1324 | Secrecy Addressee::secrecy() const |
1325 | { | 1325 | { |
1326 | return mData->secrecy; | 1326 | return mData->secrecy; |
1327 | } | 1327 | } |
1328 | 1328 | ||
1329 | QString Addressee::secrecyLabel() | 1329 | QString Addressee::secrecyLabel() |
1330 | { | 1330 | { |
1331 | return i18n("Security Class"); | 1331 | return i18n("Security Class"); |
1332 | } | 1332 | } |
1333 | 1333 | ||
1334 | 1334 | ||
1335 | void Addressee::setLogo( const Picture &logo ) | 1335 | void Addressee::setLogo( const Picture &logo ) |
1336 | { | 1336 | { |
1337 | if ( logo == mData->logo ) return; | 1337 | if ( logo == mData->logo ) return; |
1338 | detach(); | 1338 | detach(); |
1339 | mData->empty = false; | 1339 | mData->empty = false; |
1340 | mData->logo = logo; | 1340 | mData->logo = logo; |
1341 | } | 1341 | } |
1342 | 1342 | ||
1343 | Picture Addressee::logo() const | 1343 | Picture Addressee::logo() const |
1344 | { | 1344 | { |
1345 | return mData->logo; | 1345 | return mData->logo; |
1346 | } | 1346 | } |
1347 | 1347 | ||
1348 | QString Addressee::logoLabel() | 1348 | QString Addressee::logoLabel() |
1349 | { | 1349 | { |
1350 | return i18n("Logo"); | 1350 | return i18n("Logo"); |
1351 | } | 1351 | } |
1352 | 1352 | ||
1353 | 1353 | ||
1354 | void Addressee::setPhoto( const Picture &photo ) | 1354 | void Addressee::setPhoto( const Picture &photo ) |
1355 | { | 1355 | { |
1356 | if ( photo == mData->photo ) return; | 1356 | if ( photo == mData->photo ) return; |
1357 | detach(); | 1357 | detach(); |
1358 | mData->empty = false; | 1358 | mData->empty = false; |
1359 | mData->photo = photo; | 1359 | mData->photo = photo; |
1360 | } | 1360 | } |
1361 | 1361 | ||
1362 | Picture Addressee::photo() const | 1362 | Picture Addressee::photo() const |
1363 | { | 1363 | { |
1364 | return mData->photo; | 1364 | return mData->photo; |
1365 | } | 1365 | } |
1366 | 1366 | ||
1367 | QString Addressee::photoLabel() | 1367 | QString Addressee::photoLabel() |
1368 | { | 1368 | { |
1369 | return i18n("Photo"); | 1369 | return i18n("Photo"); |
1370 | } | 1370 | } |
1371 | 1371 | ||
1372 | 1372 | ||
1373 | void Addressee::setSound( const Sound &sound ) | 1373 | void Addressee::setSound( const Sound &sound ) |
1374 | { | 1374 | { |
1375 | if ( sound == mData->sound ) return; | 1375 | if ( sound == mData->sound ) return; |
1376 | detach(); | 1376 | detach(); |
1377 | mData->empty = false; | 1377 | mData->empty = false; |
1378 | mData->sound = sound; | 1378 | mData->sound = sound; |
1379 | } | 1379 | } |
1380 | 1380 | ||
1381 | Sound Addressee::sound() const | 1381 | Sound Addressee::sound() const |
1382 | { | 1382 | { |
1383 | return mData->sound; | 1383 | return mData->sound; |
1384 | } | 1384 | } |
1385 | 1385 | ||
1386 | QString Addressee::soundLabel() | 1386 | QString Addressee::soundLabel() |
1387 | { | 1387 | { |
1388 | return i18n("Sound"); | 1388 | return i18n("Sound"); |
1389 | } | 1389 | } |
1390 | 1390 | ||
1391 | 1391 | ||
1392 | void Addressee::setAgent( const Agent &agent ) | 1392 | void Addressee::setAgent( const Agent &agent ) |
1393 | { | 1393 | { |
1394 | if ( agent == mData->agent ) return; | 1394 | if ( agent == mData->agent ) return; |
1395 | detach(); | 1395 | detach(); |
1396 | mData->empty = false; | 1396 | mData->empty = false; |
1397 | mData->agent = agent; | 1397 | mData->agent = agent; |
1398 | } | 1398 | } |
1399 | 1399 | ||
1400 | Agent Addressee::agent() const | 1400 | Agent Addressee::agent() const |
1401 | { | 1401 | { |
1402 | return mData->agent; | 1402 | return mData->agent; |
1403 | } | 1403 | } |
1404 | 1404 | ||
1405 | QString Addressee::agentLabel() | 1405 | QString Addressee::agentLabel() |
1406 | { | 1406 | { |
1407 | return i18n("Agent"); | 1407 | return i18n("Agent"); |
1408 | } | 1408 | } |
1409 | 1409 | ||
1410 | 1410 | ||
1411 | 1411 | ||
1412 | void Addressee::setNameFromString( const QString &str ) | 1412 | void Addressee::setNameFromString( const QString &str ) |
1413 | { | 1413 | { |
1414 | setFormattedName( str ); | 1414 | setFormattedName( str ); |
1415 | setName( str ); | 1415 | setName( str ); |
1416 | 1416 | ||
1417 | static bool first = true; | 1417 | static bool first = true; |
1418 | static QStringList titles; | 1418 | static QStringList titles; |
1419 | static QStringList suffixes; | 1419 | static QStringList suffixes; |
1420 | static QStringList prefixes; | 1420 | static QStringList prefixes; |
1421 | 1421 | ||
1422 | if ( first ) { | 1422 | if ( first ) { |
1423 | first = false; | 1423 | first = false; |
1424 | titles += i18n( "Dr." ); | 1424 | titles += i18n( "Dr." ); |
1425 | titles += i18n( "Miss" ); | 1425 | titles += i18n( "Miss" ); |
1426 | titles += i18n( "Mr." ); | 1426 | titles += i18n( "Mr." ); |
1427 | titles += i18n( "Mrs." ); | 1427 | titles += i18n( "Mrs." ); |
1428 | titles += i18n( "Ms." ); | 1428 | titles += i18n( "Ms." ); |
1429 | titles += i18n( "Prof." ); | 1429 | titles += i18n( "Prof." ); |
1430 | 1430 | ||
1431 | suffixes += i18n( "I" ); | 1431 | suffixes += i18n( "I" ); |
1432 | suffixes += i18n( "II" ); | 1432 | suffixes += i18n( "II" ); |
1433 | suffixes += i18n( "III" ); | 1433 | suffixes += i18n( "III" ); |
1434 | suffixes += i18n( "Jr." ); | 1434 | suffixes += i18n( "Jr." ); |
1435 | suffixes += i18n( "Sr." ); | 1435 | suffixes += i18n( "Sr." ); |
1436 | 1436 | ||
1437 | prefixes += "van"; | 1437 | prefixes += "van"; |
1438 | prefixes += "von"; | 1438 | prefixes += "von"; |
1439 | prefixes += "de"; | 1439 | prefixes += "de"; |
1440 | 1440 | ||
1441 | KConfig config( locateLocal( "config", "kabcrc") ); | 1441 | KConfig config( locateLocal( "config", "kabcrc") ); |
1442 | config.setGroup( "General" ); | 1442 | config.setGroup( "General" ); |
1443 | titles += config.readListEntry( "Prefixes" ); | 1443 | titles += config.readListEntry( "Prefixes" ); |
1444 | titles.remove( "" ); | 1444 | titles.remove( "" ); |
1445 | prefixes += config.readListEntry( "Inclusions" ); | 1445 | prefixes += config.readListEntry( "Inclusions" ); |
1446 | prefixes.remove( "" ); | 1446 | prefixes.remove( "" ); |
1447 | suffixes += config.readListEntry( "Suffixes" ); | 1447 | suffixes += config.readListEntry( "Suffixes" ); |
1448 | suffixes.remove( "" ); | 1448 | suffixes.remove( "" ); |
1449 | } | 1449 | } |
1450 | 1450 | ||
1451 | // clear all name parts | 1451 | // clear all name parts |
1452 | setPrefix( "" ); | 1452 | setPrefix( "" ); |
1453 | setGivenName( "" ); | 1453 | setGivenName( "" ); |
1454 | setAdditionalName( "" ); | 1454 | setAdditionalName( "" ); |
1455 | setFamilyName( "" ); | 1455 | setFamilyName( "" ); |
1456 | setSuffix( "" ); | 1456 | setSuffix( "" ); |
1457 | 1457 | ||
1458 | if ( str.isEmpty() ) | 1458 | if ( str.isEmpty() ) |
1459 | return; | 1459 | return; |
1460 | 1460 | ||
1461 | int i = str.find(','); | 1461 | int i = str.find(','); |
1462 | if( i < 0 ) { | 1462 | if( i < 0 ) { |
1463 | QStringList parts = QStringList::split( " ", str ); | 1463 | QStringList parts = QStringList::split( " ", str ); |
1464 | int leftOffset = 0; | 1464 | int leftOffset = 0; |
1465 | int rightOffset = parts.count() - 1; | 1465 | int rightOffset = parts.count() - 1; |
1466 | 1466 | ||
1467 | QString suffix; | 1467 | QString suffix; |
1468 | while ( rightOffset >= 0 ) { | 1468 | while ( rightOffset >= 0 ) { |
1469 | if ( suffixes.contains( parts[ rightOffset ] ) ) { | 1469 | if ( suffixes.contains( parts[ rightOffset ] ) ) { |
1470 | suffix.prepend(parts[ rightOffset ] + (suffix.isEmpty() ? "" : " ")); | 1470 | suffix.prepend(parts[ rightOffset ] + (suffix.isEmpty() ? "" : " ")); |
1471 | rightOffset--; | 1471 | rightOffset--; |
1472 | } else | 1472 | } else |
1473 | break; | 1473 | break; |
1474 | } | 1474 | } |
1475 | setSuffix( suffix ); | 1475 | setSuffix( suffix ); |
1476 | 1476 | ||
1477 | if ( rightOffset < 0 ) | 1477 | if ( rightOffset < 0 ) |
1478 | return; | 1478 | return; |
1479 | 1479 | ||