-rw-r--r-- | kabc/vcard/VCardv.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kabc/vcard/VCardv.cpp b/kabc/vcard/VCardv.cpp index d19a004..bc80707 100644 --- a/kabc/vcard/VCardv.cpp +++ b/kabc/vcard/VCardv.cpp | |||
@@ -149,97 +149,97 @@ VCard::_parse() | |||
149 | 149 | ||
150 | if (qstrnicmp(valuePart, "VCARD", 5) != 0) { // Not a vcard ! | 150 | if (qstrnicmp(valuePart, "VCARD", 5) != 0) { // Not a vcard ! |
151 | vDebug("No VCARD"); | 151 | vDebug("No VCARD"); |
152 | return; | 152 | return; |
153 | } | 153 | } |
154 | 154 | ||
155 | /////////////////////////////////////////////////////////////// | 155 | /////////////////////////////////////////////////////////////// |
156 | // CONTENT LINES | 156 | // CONTENT LINES |
157 | // | 157 | // |
158 | vDebug("Content lines"); | 158 | vDebug("Content lines"); |
159 | 159 | ||
160 | // Handle folded lines. | 160 | // Handle folded lines. |
161 | 161 | ||
162 | QStrList refolded; | 162 | QStrList refolded; |
163 | 163 | ||
164 | QStrListIterator it(l); | 164 | QStrListIterator it(l); |
165 | 165 | ||
166 | QCString cur; | 166 | QCString cur; |
167 | 167 | ||
168 | for (; it.current(); ++it) { | 168 | for (; it.current(); ++it) { |
169 | 169 | ||
170 | cur = it.current(); | 170 | cur = it.current(); |
171 | 171 | ||
172 | ++it; | 172 | ++it; |
173 | 173 | ||
174 | while ( | 174 | while ( |
175 | it.current() && | 175 | it.current() && |
176 | it.current()[0] == ' '&& | 176 | it.current()[0] == ' '&& |
177 | strlen(it.current()) != 1) | 177 | strlen(it.current()) != 1) |
178 | { | 178 | { |
179 | cur += it.current() + 1; | 179 | cur += it.current() + 1; |
180 | ++it; | 180 | ++it; |
181 | } | 181 | } |
182 | 182 | ||
183 | --it; | 183 | --it; |
184 | 184 | ||
185 | refolded.append(cur); | 185 | refolded.append(cur); |
186 | } | 186 | } |
187 | 187 | ||
188 | QStrListIterator it2(refolded); | 188 | QStrListIterator it2(refolded); |
189 | 189 | ||
190 | for (; it2.current(); ++it2) { | 190 | for (; it2.current(); ++it2) { |
191 | vDebug("New contentline using \"" + QCString(it2.current()) + "\""); | 191 | vDebug("New contentline using \"" + QCString(it2.current()) + "\""); |
192 | ContentLine * cl = new ContentLine(it2.current()); | 192 | ContentLine * cl = new ContentLine(it2.current()); |
193 | 193 | ||
194 | cl->parse(); | 194 | cl->parse(); |
195 | if (cl->value() == 0) | 195 | if (cl->value() == 0) |
196 | { | 196 | { |
197 | qDebug("Content line could not be parsed. Discarded: %s" + QCString(it2.current())); | 197 | qDebug("Content line could not be parsed. Discarded: %s", it2.current()); |
198 | delete cl; | 198 | delete cl; |
199 | } | 199 | } |
200 | else | 200 | else |
201 | contentLineList_.append(cl); | 201 | contentLineList_.append(cl); |
202 | } | 202 | } |
203 | 203 | ||
204 | /////////////////////////////////////////////////////////////// | 204 | /////////////////////////////////////////////////////////////// |
205 | // LAST LINE | 205 | // LAST LINE |
206 | 206 | ||
207 | split = endLine.find(':'); | 207 | split = endLine.find(':'); |
208 | 208 | ||
209 | if (split == -1) // invalid, no END | 209 | if (split == -1) // invalid, no END |
210 | return; | 210 | return; |
211 | 211 | ||
212 | firstPart = endLine.left(split); | 212 | firstPart = endLine.left(split); |
213 | valuePart = endLine.right(firstPart.length() - split - 1); | 213 | valuePart = endLine.right(firstPart.length() - split - 1); |
214 | 214 | ||
215 | split = firstPart.find('.'); | 215 | split = firstPart.find('.'); |
216 | 216 | ||
217 | if (split != -1) { | 217 | if (split != -1) { |
218 | group_ = firstPart.left(split); | 218 | group_ = firstPart.left(split); |
219 | firstPart= firstPart.right(firstPart.length() - split - 1); | 219 | firstPart= firstPart.right(firstPart.length() - split - 1); |
220 | } | 220 | } |
221 | 221 | ||
222 | if (qstricmp(firstPart, "END") != 0) // No END ! | 222 | if (qstricmp(firstPart, "END") != 0) // No END ! |
223 | return; | 223 | return; |
224 | 224 | ||
225 | if (qstricmp(valuePart, "VCARD") != 0) // Not a vcard ! | 225 | if (qstricmp(valuePart, "VCARD") != 0) // Not a vcard ! |
226 | return; | 226 | return; |
227 | } | 227 | } |
228 | 228 | ||
229 | void | 229 | void |
230 | VCard::_assemble() | 230 | VCard::_assemble() |
231 | { | 231 | { |
232 | vDebug("Assembling vcard"); | 232 | vDebug("Assembling vcard"); |
233 | strRep_ = "BEGIN:VCARD\r\n"; | 233 | strRep_ = "BEGIN:VCARD\r\n"; |
234 | strRep_ += "VERSION:3.0\r\n"; | 234 | strRep_ += "VERSION:3.0\r\n"; |
235 | 235 | ||
236 | QPtrListIterator<ContentLine> it(contentLineList_); | 236 | QPtrListIterator<ContentLine> it(contentLineList_); |
237 | 237 | ||
238 | for (; it.current(); ++it) | 238 | for (; it.current(); ++it) |
239 | strRep_ += it.current()->asString() + "\r\n"; | 239 | strRep_ += it.current()->asString() + "\r\n"; |
240 | 240 | ||
241 | strRep_ += "END:VCARD\r\n"; | 241 | strRep_ += "END:VCARD\r\n"; |
242 | } | 242 | } |
243 | 243 | ||
244 | bool | 244 | bool |
245 | VCard::has(EntityType t) | 245 | VCard::has(EntityType t) |