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/AdrValue.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/AdrValue.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kabc/vcard/AdrValue.cpp b/kabc/vcard/AdrValue.cpp index 7ecef33..51ca12a 100644 --- a/kabc/vcard/AdrValue.cpp +++ b/kabc/vcard/AdrValue.cpp | |||
@@ -12,76 +12,79 @@ | |||
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 <VCardRToken.h> | 24 | #include <VCardRToken.h> |
25 | #include <VCardAdrValue.h> | 25 | #include <VCardAdrValue.h> |
26 | #include <VCardValue.h> | 26 | #include <VCardValue.h> |
27 | #include <VCardDefines.h> | 27 | #include <VCardDefines.h> |
28 | //Added by qt3to4: | ||
29 | #include <Q3StrList> | ||
30 | #include <Q3CString> | ||
28 | 31 | ||
29 | using namespace VCARD; | 32 | using namespace VCARD; |
30 | 33 | ||
31 | AdrValue::AdrValue() | 34 | AdrValue::AdrValue() |
32 | :Value() | 35 | :Value() |
33 | { | 36 | { |
34 | } | 37 | } |
35 | 38 | ||
36 | AdrValue::AdrValue(const AdrValue & x) | 39 | AdrValue::AdrValue(const AdrValue & x) |
37 | :Value(x), | 40 | :Value(x), |
38 | poBox_ (x.poBox_), | 41 | poBox_ (x.poBox_), |
39 | extAddress_(x.extAddress_), | 42 | extAddress_(x.extAddress_), |
40 | street_ (x.street_), | 43 | street_ (x.street_), |
41 | locality_(x.locality_), | 44 | locality_(x.locality_), |
42 | region_ (x.region_), | 45 | region_ (x.region_), |
43 | postCode_(x.postCode_), | 46 | postCode_(x.postCode_), |
44 | countryName_(x.countryName_) | 47 | countryName_(x.countryName_) |
45 | { | 48 | { |
46 | } | 49 | } |
47 | 50 | ||
48 | AdrValue::AdrValue(const QCString & s) | 51 | AdrValue::AdrValue(const Q3CString & s) |
49 | :Value(s) | 52 | :Value(s) |
50 | { | 53 | { |
51 | } | 54 | } |
52 | 55 | ||
53 | AdrValue & | 56 | AdrValue & |
54 | AdrValue::operator = (AdrValue & x) | 57 | AdrValue::operator = (AdrValue & x) |
55 | { | 58 | { |
56 | if (*this == x) return *this; | 59 | if (*this == x) return *this; |
57 | 60 | ||
58 | poBox_ = x.poBox_; | 61 | poBox_ = x.poBox_; |
59 | extAddress_= x.extAddress_; | 62 | extAddress_= x.extAddress_; |
60 | street_ = x.street_; | 63 | street_ = x.street_; |
61 | locality_= x.locality_; | 64 | locality_= x.locality_; |
62 | region_ = x.region_; | 65 | region_ = x.region_; |
63 | postCode_= x.postCode_; | 66 | postCode_= x.postCode_; |
64 | countryName_= x.countryName_; | 67 | countryName_= x.countryName_; |
65 | 68 | ||
66 | Value::operator = (x); | 69 | Value::operator = (x); |
67 | return *this; | 70 | return *this; |
68 | } | 71 | } |
69 | 72 | ||
70 | AdrValue & | 73 | AdrValue & |
71 | AdrValue::operator = (const QCString & s) | 74 | AdrValue::operator = (const Q3CString & s) |
72 | { | 75 | { |
73 | Value::operator = (s); | 76 | Value::operator = (s); |
74 | return *this; | 77 | return *this; |
75 | } | 78 | } |
76 | 79 | ||
77 | bool | 80 | bool |
78 | AdrValue::operator == (AdrValue & x) | 81 | AdrValue::operator == (AdrValue & x) |
79 | { | 82 | { |
80 | parse(); | 83 | parse(); |
81 | x.parse(); | 84 | x.parse(); |
82 | 85 | ||
83 | return ( | 86 | return ( |
84 | poBox_ == x.poBox_ && | 87 | poBox_ == x.poBox_ && |
85 | extAddress_ == x.extAddress_&& | 88 | extAddress_ == x.extAddress_&& |
86 | street_ == x.street_ && | 89 | street_ == x.street_ && |
87 | locality_ == x.locality_ && | 90 | locality_ == x.locality_ && |
@@ -92,33 +95,33 @@ AdrValue::operator == (AdrValue & x) | |||
92 | 95 | ||
93 | AdrValue::~AdrValue() | 96 | AdrValue::~AdrValue() |
94 | { | 97 | { |
95 | } | 98 | } |
96 | 99 | ||
97 | AdrValue * | 100 | AdrValue * |
98 | AdrValue::clone() | 101 | AdrValue::clone() |
99 | { | 102 | { |
100 | return new AdrValue( *this ); | 103 | return new AdrValue( *this ); |
101 | } | 104 | } |
102 | 105 | ||
103 | void | 106 | void |
104 | AdrValue::_parse() | 107 | AdrValue::_parse() |
105 | { | 108 | { |
106 | vDebug("AdrValue::_parse()"); | 109 | vDebug("AdrValue::_parse()"); |
107 | 110 | ||
108 | QStrList l; | 111 | Q3StrList l; |
109 | RTokenise(strRep_, ";", l); | 112 | RTokenise(strRep_, ";", l); |
110 | 113 | ||
111 | for (unsigned int i = 0; i < l.count(); i++) { | 114 | for (unsigned int i = 0; i < l.count(); i++) { |
112 | 115 | ||
113 | switch (i) { | 116 | switch (i) { |
114 | 117 | ||
115 | case 0: poBox_ = l.at(0);break; | 118 | case 0: poBox_ = l.at(0);break; |
116 | case 1: extAddress_ = l.at(1);break; | 119 | case 1: extAddress_ = l.at(1);break; |
117 | case 2: street_ = l.at(2);break; | 120 | case 2: street_ = l.at(2);break; |
118 | case 3: locality_ = l.at(3);break; | 121 | case 3: locality_ = l.at(3);break; |
119 | case 4: region_ = l.at(4);break; | 122 | case 4: region_ = l.at(4);break; |
120 | case 5: postCode_ = l.at(5);break; | 123 | case 5: postCode_ = l.at(5);break; |
121 | case 6: countryName_ = l.at(6);break; | 124 | case 6: countryName_ = l.at(6);break; |
122 | default: break; | 125 | default: break; |
123 | } | 126 | } |
124 | } | 127 | } |