author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kabc/vcard/ClassValue.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | kabc/vcard/ClassValue.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kabc/vcard/ClassValue.cpp b/kabc/vcard/ClassValue.cpp index f01e5a6..c088d7c 100644 --- a/kabc/vcard/ClassValue.cpp +++ b/kabc/vcard/ClassValue.cpp | |||
@@ -1,120 +1,122 @@ | |||
1 | /* | 1 | /* |
2 | libvcard - vCard parsing library for vCard version 3.0 | 2 | libvcard - vCard parsing library for vCard version 3.0 |
3 | 3 | ||
4 | Copyright (C) 1998 Rik Hemsley rik@kde.org | 4 | Copyright (C) 1998 Rik Hemsley rik@kde.org |
5 | 5 | ||
6 | Permission is hereby granted, free of charge, to any person obtaining a copy | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy |
7 | of this software and associated documentation files (the "Software"), to | 7 | of this software and associated documentation files (the "Software"), to |
8 | deal in the Software without restriction, including without limitation the | 8 | deal in the Software without restriction, including without limitation the |
9 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | 9 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
10 | sell copies of the Software, and to permit persons to whom the Software is | 10 | sell copies of the Software, and to permit persons to whom the Software is |
11 | furnished to do so, subject to the following conditions: | 11 | furnished to do so, subject to the following conditions: |
12 | 12 | ||
13 | The above copyright notice and this permission notice shall be included in | 13 | The above copyright notice and this permission notice shall be included in |
14 | all copies or substantial portions of the Software. | 14 | all copies or substantial portions of the Software. |
15 | 15 | ||
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
19 | AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | 19 | AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
20 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | 20 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <VCardClassValue.h> | 24 | #include <VCardClassValue.h> |
25 | 25 | ||
26 | #include <VCardValue.h> | 26 | #include <VCardValue.h> |
27 | 27 | ||
28 | #include <kdebug.h> | 28 | #include <kdebug.h> |
29 | //Added by qt3to4: | ||
30 | #include <Q3CString> | ||
29 | 31 | ||
30 | using namespace VCARD; | 32 | using namespace VCARD; |
31 | 33 | ||
32 | ClassValue::ClassValue() | 34 | ClassValue::ClassValue() |
33 | :Value() | 35 | :Value() |
34 | { | 36 | { |
35 | } | 37 | } |
36 | 38 | ||
37 | ClassValue::ClassValue(const ClassValue & x) | 39 | ClassValue::ClassValue(const ClassValue & x) |
38 | :Value(x), | 40 | :Value(x), |
39 | classType_(x.classType_) | 41 | classType_(x.classType_) |
40 | { | 42 | { |
41 | } | 43 | } |
42 | 44 | ||
43 | ClassValue::ClassValue(const QCString & s) | 45 | ClassValue::ClassValue(const Q3CString & s) |
44 | :Value(s) | 46 | :Value(s) |
45 | { | 47 | { |
46 | } | 48 | } |
47 | 49 | ||
48 | ClassValue & | 50 | ClassValue & |
49 | ClassValue::operator = (ClassValue & x) | 51 | ClassValue::operator = (ClassValue & x) |
50 | { | 52 | { |
51 | if (*this == x) return *this; | 53 | if (*this == x) return *this; |
52 | x.parse(); | 54 | x.parse(); |
53 | 55 | ||
54 | classType_ = x.classType_; | 56 | classType_ = x.classType_; |
55 | 57 | ||
56 | Value::operator = (x); | 58 | Value::operator = (x); |
57 | return *this; | 59 | return *this; |
58 | } | 60 | } |
59 | 61 | ||
60 | ClassValue & | 62 | ClassValue & |
61 | ClassValue::operator = (const QCString & s) | 63 | ClassValue::operator = (const Q3CString & s) |
62 | { | 64 | { |
63 | Value::operator = (s); | 65 | Value::operator = (s); |
64 | return *this; | 66 | return *this; |
65 | } | 67 | } |
66 | 68 | ||
67 | bool | 69 | bool |
68 | ClassValue::operator == (ClassValue & x) | 70 | ClassValue::operator == (ClassValue & x) |
69 | { | 71 | { |
70 | x.parse(); | 72 | x.parse(); |
71 | return ( classType_ == x.classType_ ); | 73 | return ( classType_ == x.classType_ ); |
72 | } | 74 | } |
73 | 75 | ||
74 | ClassValue::~ClassValue() | 76 | ClassValue::~ClassValue() |
75 | { | 77 | { |
76 | } | 78 | } |
77 | 79 | ||
78 | ClassValue * | 80 | ClassValue * |
79 | ClassValue::clone() | 81 | ClassValue::clone() |
80 | { | 82 | { |
81 | return new ClassValue( *this ); | 83 | return new ClassValue( *this ); |
82 | } | 84 | } |
83 | 85 | ||
84 | void | 86 | void |
85 | ClassValue::_parse() | 87 | ClassValue::_parse() |
86 | { | 88 | { |
87 | if (qstricmp(strRep_, "PUBLIC") == 0) | 89 | if (qstricmp(strRep_, "PUBLIC") == 0) |
88 | classType_ = Public; | 90 | classType_ = Public; |
89 | 91 | ||
90 | else if (qstricmp(strRep_, "PRIVATE") == 0) | 92 | else if (qstricmp(strRep_, "PRIVATE") == 0) |
91 | classType_ = Private; | 93 | classType_ = Private; |
92 | 94 | ||
93 | else if (qstricmp(strRep_, "CONFIDENTIAL") == 0) | 95 | else if (qstricmp(strRep_, "CONFIDENTIAL") == 0) |
94 | classType_ = Confidential; | 96 | classType_ = Confidential; |
95 | 97 | ||
96 | else classType_ = Other; | 98 | else classType_ = Other; |
97 | } | 99 | } |
98 | 100 | ||
99 | void | 101 | void |
100 | ClassValue::_assemble() | 102 | ClassValue::_assemble() |
101 | { | 103 | { |
102 | switch (classType_) { | 104 | switch (classType_) { |
103 | 105 | ||
104 | case Public: | 106 | case Public: |
105 | strRep_ = "PUBLIC"; | 107 | strRep_ = "PUBLIC"; |
106 | break; | 108 | break; |
107 | 109 | ||
108 | case Private: | 110 | case Private: |
109 | strRep_ = "PRIVATE"; | 111 | strRep_ = "PRIVATE"; |
110 | break; | 112 | break; |
111 | 113 | ||
112 | case Confidential: | 114 | case Confidential: |
113 | strRep_ = "CONFIDENTIAL"; | 115 | strRep_ = "CONFIDENTIAL"; |
114 | break; | 116 | break; |
115 | 117 | ||
116 | default: | 118 | default: |
117 | break; | 119 | break; |
118 | } | 120 | } |
119 | } | 121 | } |
120 | 122 | ||