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/VCardv.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/VCardv.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/kabc/vcard/VCardv.cpp b/kabc/vcard/VCardv.cpp index bad2ef1..5dd675d 100644 --- a/kabc/vcard/VCardv.cpp +++ b/kabc/vcard/VCardv.cpp | |||
@@ -21,11 +21,11 @@ | |||
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 <qcstring.h> | 24 | #include <q3cstring.h> |
25 | #include <qstrlist.h> | 25 | #include <q3strlist.h> |
26 | #include <qstringlist.h> | 26 | #include <qstringlist.h> |
27 | #include <qstring.h> | 27 | #include <qstring.h> |
28 | #include <qvaluelist.h> | 28 | #include <q3valuelist.h> |
29 | 29 | ||
30 | #include <VCardEntity.h> | 30 | #include <VCardEntity.h> |
31 | #include <VCardVCard.h> | 31 | #include <VCardVCard.h> |
@@ -48,7 +48,7 @@ VCard::VCard(const VCard & x) | |||
48 | { | 48 | { |
49 | contentLineList_.setAutoDelete( TRUE ); | 49 | contentLineList_.setAutoDelete( TRUE ); |
50 | 50 | ||
51 | QPtrListIterator<ContentLine> it(x.contentLineList_); | 51 | Q3PtrListIterator<ContentLine> it(x.contentLineList_); |
52 | for (; it.current(); ++it) { | 52 | for (; it.current(); ++it) { |
53 | ContentLine * c = new ContentLine(*it.current()); | 53 | ContentLine * c = new ContentLine(*it.current()); |
54 | contentLineList_.append(c); | 54 | contentLineList_.append(c); |
@@ -56,7 +56,7 @@ VCard::VCard(const VCard & x) | |||
56 | 56 | ||
57 | } | 57 | } |
58 | 58 | ||
59 | VCard::VCard(const QCString & s) | 59 | VCard::VCard(const Q3CString & s) |
60 | :Entity(s) | 60 | :Entity(s) |
61 | { | 61 | { |
62 | contentLineList_.setAutoDelete( TRUE ); | 62 | contentLineList_.setAutoDelete( TRUE ); |
@@ -68,7 +68,7 @@ VCard::operator = (VCard & x) | |||
68 | if (*this == x) return *this; | 68 | if (*this == x) return *this; |
69 | 69 | ||
70 | group_ = x.group(); | 70 | group_ = x.group(); |
71 | QPtrListIterator<ContentLine> it(x.contentLineList_); | 71 | Q3PtrListIterator<ContentLine> it(x.contentLineList_); |
72 | for (; it.current(); ++it) { | 72 | for (; it.current(); ++it) { |
73 | ContentLine * c = new ContentLine(*it.current()); | 73 | ContentLine * c = new ContentLine(*it.current()); |
74 | contentLineList_.append(c); | 74 | contentLineList_.append(c); |
@@ -79,7 +79,7 @@ VCard::operator = (VCard & x) | |||
79 | } | 79 | } |
80 | 80 | ||
81 | VCard & | 81 | VCard & |
82 | VCard::operator = (const QCString & s) | 82 | VCard::operator = (const Q3CString & s) |
83 | { | 83 | { |
84 | Entity::operator = (s); | 84 | Entity::operator = (s); |
85 | return *this; | 85 | return *this; |
@@ -101,7 +101,7 @@ VCard::_parse() | |||
101 | { | 101 | { |
102 | 102 | ||
103 | QStringList l; | 103 | QStringList l; |
104 | QStrList sl; | 104 | Q3StrList sl; |
105 | 105 | ||
106 | RTokenise(strRep_, "\r\n", sl); | 106 | RTokenise(strRep_, "\r\n", sl); |
107 | 107 | ||
@@ -109,7 +109,8 @@ VCard::_parse() | |||
109 | //qDebug("invalid vcard "); | 109 | //qDebug("invalid vcard "); |
110 | return; | 110 | return; |
111 | } | 111 | } |
112 | l = QStringList::fromStrList( sl ); | 112 | for(Q3StrList::iterator i=sl.begin();i!=sl.end();++i) |
113 | l.push_back(*i); | ||
113 | // Get the first line | 114 | // Get the first line |
114 | QString beginLine = l[0].stripWhiteSpace(); | 115 | QString beginLine = l[0].stripWhiteSpace(); |
115 | 116 | ||
@@ -180,7 +181,7 @@ VCard::_parse() | |||
180 | } | 181 | } |
181 | QStringList::Iterator it2 = refolded.begin(); | 182 | QStringList::Iterator it2 = refolded.begin(); |
182 | for (; it2 != refolded.end(); ++it2) { | 183 | for (; it2 != refolded.end(); ++it2) { |
183 | ContentLine * cl = new ContentLine(QCString((*it2).latin1())); | 184 | ContentLine * cl = new ContentLine(Q3CString((*it2).latin1())); |
184 | cl->parse(); | 185 | cl->parse(); |
185 | if (cl->value() == 0) | 186 | if (cl->value() == 0) |
186 | { | 187 | { |
@@ -228,7 +229,7 @@ VCard::_assemble() | |||
228 | strRep_ = "BEGIN:VCARD\r\n"; | 229 | strRep_ = "BEGIN:VCARD\r\n"; |
229 | strRep_ += "VERSION:3.0\r\n"; | 230 | strRep_ += "VERSION:3.0\r\n"; |
230 | 231 | ||
231 | QPtrListIterator<ContentLine> it(contentLineList_); | 232 | Q3PtrListIterator<ContentLine> it(contentLineList_); |
232 | 233 | ||
233 | for (; it.current(); ++it) | 234 | for (; it.current(); ++it) |
234 | strRep_ += it.current()->asString() + "\r\n"; | 235 | strRep_ += it.current()->asString() + "\r\n"; |
@@ -244,7 +245,7 @@ VCard::has(EntityType t) | |||
244 | } | 245 | } |
245 | 246 | ||
246 | bool | 247 | bool |
247 | VCard::has(const QCString & s) | 248 | VCard::has(const Q3CString & s) |
248 | { | 249 | { |
249 | parse(); | 250 | parse(); |
250 | return contentLine(s) == 0 ? false : true; | 251 | return contentLine(s) == 0 ? false : true; |
@@ -259,7 +260,7 @@ VCard::add(const ContentLine & cl) | |||
259 | } | 260 | } |
260 | 261 | ||
261 | void | 262 | void |
262 | VCard::add(const QCString & s) | 263 | VCard::add(const Q3CString & s) |
263 | { | 264 | { |
264 | parse(); | 265 | parse(); |
265 | ContentLine * c = new ContentLine(s); | 266 | ContentLine * c = new ContentLine(s); |
@@ -270,7 +271,7 @@ VCard::add(const QCString & s) | |||
270 | VCard::contentLine(EntityType t) | 271 | VCard::contentLine(EntityType t) |
271 | { | 272 | { |
272 | parse(); | 273 | parse(); |
273 | QPtrListIterator<ContentLine> it(contentLineList_); | 274 | Q3PtrListIterator<ContentLine> it(contentLineList_); |
274 | 275 | ||
275 | for (; it.current(); ++it) | 276 | for (; it.current(); ++it) |
276 | if (it.current()->entityType() == t) | 277 | if (it.current()->entityType() == t) |
@@ -280,10 +281,10 @@ VCard::contentLine(EntityType t) | |||
280 | } | 281 | } |
281 | 282 | ||
282 | ContentLine * | 283 | ContentLine * |
283 | VCard::contentLine(const QCString & s) | 284 | VCard::contentLine(const Q3CString & s) |
284 | { | 285 | { |
285 | parse(); | 286 | parse(); |
286 | QPtrListIterator<ContentLine> it(contentLineList_); | 287 | Q3PtrListIterator<ContentLine> it(contentLineList_); |
287 | 288 | ||
288 | for (; it.current(); ++it) | 289 | for (; it.current(); ++it) |
289 | if (it.current()->entityType() == EntityNameToEntityType(s)) | 290 | if (it.current()->entityType() == EntityNameToEntityType(s)) |