author | zautrix <zautrix> | 2005-03-16 23:10:29 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-16 23:10:29 (UTC) |
commit | d2be5ea1cd22f5222aecb0f70a2fe8657fae9698 (patch) (unidiff) | |
tree | 5de4c2b05428d837e2451df06b3ea313bd02c1b8 | |
parent | b7184073d5e552e0f04b14c5fc0c20a7bfd26d3d (diff) | |
download | kdepimpi-d2be5ea1cd22f5222aecb0f70a2fe8657fae9698.zip kdepimpi-d2be5ea1cd22f5222aecb0f70a2fe8657fae9698.tar.gz kdepimpi-d2be5ea1cd22f5222aecb0f70a2fe8657fae9698.tar.bz2 |
fixes
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 3 | ||||
-rw-r--r-- | libkcal/vcalformat.cpp | 50 |
2 files changed, 10 insertions, 43 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 55b120f..81efb6c 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,56 +1,59 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.0.17 ************ | 3 | ********** VERSION 2.0.17 ************ |
4 | 4 | ||
5 | KO/Pi: | 5 | KO/Pi: |
6 | Tooltips in month view were not sorted. Fixed. | 6 | Tooltips in month view were not sorted. Fixed. |
7 | Daylabel in agenda view ( for display of one day ) was too short. Fixed. | 7 | Daylabel in agenda view ( for display of one day ) was too short. Fixed. |
8 | Conflict display dialog for syncing was not on top of other windows. Fixed. | 8 | Conflict display dialog for syncing was not on top of other windows. Fixed. |
9 | Fixed some minor problems. | ||
10 | |||
11 | Fixed an endless loop when importing vcs file with RESOURCES entry. | ||
9 | 12 | ||
10 | ********** VERSION 2.0.16 ************ | 13 | ********** VERSION 2.0.16 ************ |
11 | OM/Pi: | 14 | OM/Pi: |
12 | Fixed the SMTP account setting the option. | 15 | Fixed the SMTP account setting the option. |
13 | Fixed something in mail sending. | 16 | Fixed something in mail sending. |
14 | 17 | ||
15 | KO/Pi: | 18 | KO/Pi: |
16 | Added possibility to export selected events/todos as vcal file. | 19 | Added possibility to export selected events/todos as vcal file. |
17 | 20 | ||
18 | ********** VERSION 2.0.15 ************ | 21 | ********** VERSION 2.0.15 ************ |
19 | 22 | ||
20 | PwM/Pi: | 23 | PwM/Pi: |
21 | Added keyboard shorcuts for | 24 | Added keyboard shorcuts for |
22 | - toggling summary view (space bar) | 25 | - toggling summary view (space bar) |
23 | - delete item (delete + backspace key) | 26 | - delete item (delete + backspace key) |
24 | - add new item ( i + n key) | 27 | - add new item ( i + n key) |
25 | Fixed length of info in the title. | 28 | Fixed length of info in the title. |
26 | 29 | ||
27 | KO/Pi-KA/Pi: | 30 | KO/Pi-KA/Pi: |
28 | Changed "ME" menu bar entry to an icon. | 31 | Changed "ME" menu bar entry to an icon. |
29 | 32 | ||
30 | KO/Pi: | 33 | KO/Pi: |
31 | Fixed two minor bugs in displaying todos. | 34 | Fixed two minor bugs in displaying todos. |
32 | If in month view a cell is selected, the key shortcut "d" shows now that date. | 35 | If in month view a cell is selected, the key shortcut "d" shows now that date. |
33 | Added complete info for a todo in month view as an icon left of the text. | 36 | Added complete info for a todo in month view as an icon left of the text. |
34 | Fixed problems of displaying data when "<" or ">" are used in summary/location/description. | 37 | Fixed problems of displaying data when "<" or ">" are used in summary/location/description. |
35 | Fixed problem of search dialog size when switching displays. | 38 | Fixed problem of search dialog size when switching displays. |
36 | Cancel key now closes date picker. | 39 | Cancel key now closes date picker. |
37 | Rearranged KO/Pi file menu structure. | 40 | Rearranged KO/Pi file menu structure. |
38 | 41 | ||
39 | OM/Pi: | 42 | OM/Pi: |
40 | Added to the SMTP account setting the option | 43 | Added to the SMTP account setting the option |
41 | "No secure connection". | 44 | "No secure connection". |
42 | You have to configure your SMTP accounts again, sorry. | 45 | You have to configure your SMTP accounts again, sorry. |
43 | 46 | ||
44 | KA/Pi: | 47 | KA/Pi: |
45 | Added support for importing quoted-printable. | 48 | Added support for importing quoted-printable. |
46 | Support was added by Peter P.. Thanks, Peter! | 49 | Support was added by Peter P.. Thanks, Peter! |
47 | 50 | ||
48 | 51 | ||
49 | ********** VERSION 2.0.14 ************ | 52 | ********** VERSION 2.0.14 ************ |
50 | 53 | ||
51 | Made Passwordmanager PwM/Pi more userfriendly: | 54 | Made Passwordmanager PwM/Pi more userfriendly: |
52 | Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. | 55 | Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. |
53 | Fixed bug in KO/Pi todo printing. | 56 | Fixed bug in KO/Pi todo printing. |
54 | Made Qtopia calendar import possible on desktop . | 57 | Made Qtopia calendar import possible on desktop . |
55 | 58 | ||
56 | ********** VERSION 2.0.13 ************ | 59 | ********** VERSION 2.0.13 ************ |
diff --git a/libkcal/vcalformat.cpp b/libkcal/vcalformat.cpp index 223aa5a..62a31ae 100644 --- a/libkcal/vcalformat.cpp +++ b/libkcal/vcalformat.cpp | |||
@@ -186,97 +186,97 @@ QString VCalFormat::eventToString( Event * event, Calendar *calendar, bool useLo | |||
186 | QString VCalFormat::todoToString( Todo * todo, Calendar *calendar, bool useLocal ) | 186 | QString VCalFormat::todoToString( Todo * todo, Calendar *calendar, bool useLocal ) |
187 | { | 187 | { |
188 | 188 | ||
189 | if ( !todo ) return QString::null; | 189 | if ( !todo ) return QString::null; |
190 | bool useL = useLocalTime; | 190 | bool useL = useLocalTime; |
191 | useLocalTime = useLocal; | 191 | useLocalTime = useLocal; |
192 | mCalendar = calendar; | 192 | mCalendar = calendar; |
193 | VObject *vevent = eventToVTodo( todo ); | 193 | VObject *vevent = eventToVTodo( todo ); |
194 | char *buf = writeMemVObject( 0, 0, vevent ); | 194 | char *buf = writeMemVObject( 0, 0, vevent ); |
195 | QString result( buf ); | 195 | QString result( buf ); |
196 | cleanVObject( vevent ); | 196 | cleanVObject( vevent ); |
197 | useLocalTime = useL; | 197 | useLocalTime = useL; |
198 | return result; | 198 | return result; |
199 | } | 199 | } |
200 | 200 | ||
201 | QString VCalFormat::toString( Calendar *calendar ) | 201 | QString VCalFormat::toString( Calendar *calendar ) |
202 | { | 202 | { |
203 | // TODO: Factor out VCalFormat::asString() | 203 | // TODO: Factor out VCalFormat::asString() |
204 | 204 | ||
205 | VObject *vcal = newVObject(VCCalProp); | 205 | VObject *vcal = newVObject(VCCalProp); |
206 | 206 | ||
207 | addPropValue( vcal, VCProdIdProp, CalFormat::productId() ); | 207 | addPropValue( vcal, VCProdIdProp, CalFormat::productId() ); |
208 | QString tmpStr = mCalendar->getTimeZoneStr(); | 208 | QString tmpStr = mCalendar->getTimeZoneStr(); |
209 | addPropValue( vcal, VCTimeZoneProp, tmpStr.local8Bit() ); | 209 | addPropValue( vcal, VCTimeZoneProp, tmpStr.local8Bit() ); |
210 | addPropValue( vcal, VCVersionProp, _VCAL_VERSION ); | 210 | addPropValue( vcal, VCVersionProp, _VCAL_VERSION ); |
211 | 211 | ||
212 | // TODO: Use all data. | 212 | // TODO: Use all data. |
213 | QPtrList<Event> events = calendar->events(); | 213 | QPtrList<Event> events = calendar->events(); |
214 | Event *event = events.first(); | 214 | Event *event = events.first(); |
215 | if ( !event ) return QString::null; | 215 | if ( !event ) return QString::null; |
216 | 216 | ||
217 | VObject *vevent = eventToVEvent( event ); | 217 | VObject *vevent = eventToVEvent( event ); |
218 | 218 | ||
219 | addVObjectProp( vcal, vevent ); | 219 | addVObjectProp( vcal, vevent ); |
220 | 220 | ||
221 | char *buf = writeMemVObject( 0, 0, vcal ); | 221 | char *buf = writeMemVObject( 0, 0, vcal ); |
222 | 222 | ||
223 | QString result( buf ); | 223 | QString result( buf ); |
224 | 224 | ||
225 | cleanVObject( vcal ); | 225 | cleanVObject( vcal ); |
226 | 226 | ||
227 | return result; | 227 | return result; |
228 | } | 228 | } |
229 | 229 | ||
230 | VObject *VCalFormat::eventToVTodo(const Todo *anEvent) | 230 | VObject *VCalFormat::eventToVTodo(const Todo *anEvent) |
231 | { | 231 | { |
232 | VObject *vtodo; | 232 | VObject *vtodo; |
233 | QString tmpStr; | 233 | QString tmpStr; |
234 | QStringList tmpStrList; | 234 | |
235 | 235 | ||
236 | vtodo = newVObject(VCTodoProp); | 236 | vtodo = newVObject(VCTodoProp); |
237 | 237 | ||
238 | // due date | 238 | // due date |
239 | if (anEvent->hasDueDate()) { | 239 | if (anEvent->hasDueDate()) { |
240 | tmpStr = qDateTimeToISO(anEvent->dtDue(), | 240 | tmpStr = qDateTimeToISO(anEvent->dtDue(), |
241 | !anEvent->doesFloat()); | 241 | !anEvent->doesFloat()); |
242 | addPropValue(vtodo, VCDueProp, tmpStr.local8Bit()); | 242 | addPropValue(vtodo, VCDueProp, tmpStr.local8Bit()); |
243 | } | 243 | } |
244 | 244 | ||
245 | // start date | 245 | // start date |
246 | if (anEvent->hasStartDate()) { | 246 | if (anEvent->hasStartDate()) { |
247 | tmpStr = qDateTimeToISO(anEvent->dtStart(), | 247 | tmpStr = qDateTimeToISO(anEvent->dtStart(), |
248 | !anEvent->doesFloat()); | 248 | !anEvent->doesFloat()); |
249 | addPropValue(vtodo, VCDTstartProp, tmpStr.local8Bit()); | 249 | addPropValue(vtodo, VCDTstartProp, tmpStr.local8Bit()); |
250 | } | 250 | } |
251 | 251 | ||
252 | // creation date | 252 | // creation date |
253 | tmpStr = qDateTimeToISO(anEvent->created()); | 253 | tmpStr = qDateTimeToISO(anEvent->created()); |
254 | addPropValue(vtodo, VCDCreatedProp, tmpStr.local8Bit()); | 254 | addPropValue(vtodo, VCDCreatedProp, tmpStr.local8Bit()); |
255 | 255 | ||
256 | // unique id | 256 | // unique id |
257 | addPropValue(vtodo, VCUniqueStringProp, | 257 | addPropValue(vtodo, VCUniqueStringProp, |
258 | anEvent->uid().local8Bit()); | 258 | anEvent->uid().local8Bit()); |
259 | 259 | ||
260 | // revision | 260 | // revision |
261 | tmpStr.sprintf("%i", anEvent->revision()); | 261 | tmpStr.sprintf("%i", anEvent->revision()); |
262 | addPropValue(vtodo, VCSequenceProp, tmpStr.local8Bit()); | 262 | addPropValue(vtodo, VCSequenceProp, tmpStr.local8Bit()); |
263 | 263 | ||
264 | // last modification date | 264 | // last modification date |
265 | tmpStr = qDateTimeToISO(anEvent->lastModified()); | 265 | tmpStr = qDateTimeToISO(anEvent->lastModified()); |
266 | addPropValue(vtodo, VCLastModifiedProp, tmpStr.local8Bit()); | 266 | addPropValue(vtodo, VCLastModifiedProp, tmpStr.local8Bit()); |
267 | 267 | ||
268 | // organizer stuff | 268 | // organizer stuff |
269 | tmpStr = "MAILTO:" + anEvent->organizer(); | 269 | tmpStr = "MAILTO:" + anEvent->organizer(); |
270 | addPropValue(vtodo, ICOrganizerProp, tmpStr.local8Bit()); | 270 | addPropValue(vtodo, ICOrganizerProp, tmpStr.local8Bit()); |
271 | 271 | ||
272 | // attendees | 272 | // attendees |
273 | if (anEvent->attendeeCount() != 0) { | 273 | if (anEvent->attendeeCount() != 0) { |
274 | QPtrList<Attendee> al = anEvent->attendees(); | 274 | QPtrList<Attendee> al = anEvent->attendees(); |
275 | QPtrListIterator<Attendee> ai(al); | 275 | QPtrListIterator<Attendee> ai(al); |
276 | Attendee *curAttendee; | 276 | Attendee *curAttendee; |
277 | 277 | ||
278 | for (; ai.current(); ++ai) { | 278 | for (; ai.current(); ++ai) { |
279 | curAttendee = ai.current(); | 279 | curAttendee = ai.current(); |
280 | if (!curAttendee->email().isEmpty() && | 280 | if (!curAttendee->email().isEmpty() && |
281 | !curAttendee->name().isEmpty()) | 281 | !curAttendee->name().isEmpty()) |
282 | tmpStr = "MAILTO:" + curAttendee->name() + " <" + | 282 | tmpStr = "MAILTO:" + curAttendee->name() + " <" + |
@@ -287,162 +287,161 @@ VObject *VCalFormat::eventToVTodo(const Todo *anEvent) | |||
287 | tmpStr = "MAILTO: " + curAttendee->name(); | 287 | tmpStr = "MAILTO: " + curAttendee->name(); |
288 | else if (curAttendee->name().isEmpty() && | 288 | else if (curAttendee->name().isEmpty() && |
289 | curAttendee->email().isEmpty()) | 289 | curAttendee->email().isEmpty()) |
290 | kdDebug(5800) << "warning! this Event has an attendee w/o name or email!" << endl; | 290 | kdDebug(5800) << "warning! this Event has an attendee w/o name or email!" << endl; |
291 | VObject *aProp = addPropValue(vtodo, VCAttendeeProp, tmpStr.local8Bit()); | 291 | VObject *aProp = addPropValue(vtodo, VCAttendeeProp, tmpStr.local8Bit()); |
292 | addPropValue(aProp, VCRoleProp, writeRole(curAttendee->role())); | 292 | addPropValue(aProp, VCRoleProp, writeRole(curAttendee->role())); |
293 | addPropValue(aProp, VCRSVPProp, curAttendee->RSVP() ? "TRUE" : "FALSE"); | 293 | addPropValue(aProp, VCRSVPProp, curAttendee->RSVP() ? "TRUE" : "FALSE"); |
294 | addPropValue(aProp, VCStatusProp, writeStatus(curAttendee->status())); | 294 | addPropValue(aProp, VCStatusProp, writeStatus(curAttendee->status())); |
295 | } | 295 | } |
296 | } | 296 | } |
297 | 297 | ||
298 | // description BL: | 298 | // description BL: |
299 | if (!anEvent->description().isEmpty()) { | 299 | if (!anEvent->description().isEmpty()) { |
300 | VObject *d = addPropValue(vtodo, VCDescriptionProp, | 300 | VObject *d = addPropValue(vtodo, VCDescriptionProp, |
301 | anEvent->description().local8Bit()); | 301 | anEvent->description().local8Bit()); |
302 | if (anEvent->description().find('\n') != -1) | 302 | if (anEvent->description().find('\n') != -1) |
303 | addProp(d, VCQuotedPrintableProp); | 303 | addProp(d, VCQuotedPrintableProp); |
304 | } | 304 | } |
305 | 305 | ||
306 | // summary | 306 | // summary |
307 | if (!anEvent->summary().isEmpty()) | 307 | if (!anEvent->summary().isEmpty()) |
308 | addPropValue(vtodo, VCSummaryProp, anEvent->summary().local8Bit()); | 308 | addPropValue(vtodo, VCSummaryProp, anEvent->summary().local8Bit()); |
309 | 309 | ||
310 | if (!anEvent->location().isEmpty()) | 310 | if (!anEvent->location().isEmpty()) |
311 | addPropValue(vtodo, VCLocationProp, anEvent->location().local8Bit()); | 311 | addPropValue(vtodo, VCLocationProp, anEvent->location().local8Bit()); |
312 | 312 | ||
313 | // completed | 313 | // completed |
314 | // status | 314 | // status |
315 | // backward compatibility, KOrganizer used to interpret only these two values | 315 | // backward compatibility, KOrganizer used to interpret only these two values |
316 | addPropValue(vtodo, VCStatusProp, anEvent->isCompleted() ? "COMPLETED" : | 316 | addPropValue(vtodo, VCStatusProp, anEvent->isCompleted() ? "COMPLETED" : |
317 | "NEEDS_ACTION"); | 317 | "NEEDS_ACTION"); |
318 | // completion date | 318 | // completion date |
319 | if (anEvent->hasCompletedDate()) { | 319 | if (anEvent->hasCompletedDate()) { |
320 | tmpStr = qDateTimeToISO(anEvent->completed()); | 320 | tmpStr = qDateTimeToISO(anEvent->completed()); |
321 | addPropValue(vtodo, VCCompletedProp, tmpStr.local8Bit()); | 321 | addPropValue(vtodo, VCCompletedProp, tmpStr.local8Bit()); |
322 | } | 322 | } |
323 | 323 | ||
324 | // priority | 324 | // priority |
325 | tmpStr.sprintf("%i",anEvent->priority()); | 325 | tmpStr.sprintf("%i",anEvent->priority()); |
326 | addPropValue(vtodo, VCPriorityProp, tmpStr.local8Bit()); | 326 | addPropValue(vtodo, VCPriorityProp, tmpStr.local8Bit()); |
327 | 327 | ||
328 | // related event | 328 | // related event |
329 | if (anEvent->relatedTo()) { | 329 | if (anEvent->relatedTo()) { |
330 | addPropValue(vtodo, VCRelatedToProp, | 330 | addPropValue(vtodo, VCRelatedToProp, |
331 | anEvent->relatedTo()->uid().local8Bit()); | 331 | anEvent->relatedTo()->uid().local8Bit()); |
332 | } | 332 | } |
333 | 333 | ||
334 | // categories | 334 | // categories |
335 | tmpStrList = anEvent->categories(); | 335 | QStringList tmpStrList = anEvent->categories(); |
336 | tmpStr = ""; | 336 | tmpStr = ""; |
337 | QString catStr; | 337 | QString catStr; |
338 | for ( QStringList::Iterator it = tmpStrList.begin(); | 338 | for ( QStringList::Iterator it = tmpStrList.begin(); |
339 | it != tmpStrList.end(); | 339 | it != tmpStrList.end(); |
340 | ++it ) { | 340 | ++it ) { |
341 | catStr = *it; | 341 | catStr = *it; |
342 | if (catStr[0] == ' ') | 342 | if (catStr[0] == ' ') |
343 | tmpStr += catStr.mid(1); | 343 | tmpStr += catStr.mid(1); |
344 | else | 344 | else |
345 | tmpStr += catStr; | 345 | tmpStr += catStr; |
346 | // this must be a ';' character as the vCalendar specification requires! | 346 | // this must be a ';' character as the vCalendar specification requires! |
347 | // vcc.y has been hacked to translate the ';' to a ',' when the vcal is | 347 | // vcc.y has been hacked to translate the ';' to a ',' when the vcal is |
348 | // read in. | 348 | // read in. |
349 | tmpStr += ";"; | 349 | tmpStr += ";"; |
350 | } | 350 | } |
351 | if (!tmpStr.isEmpty()) { | 351 | if (!tmpStr.isEmpty()) { |
352 | tmpStr.truncate(tmpStr.length()-1); | 352 | tmpStr.truncate(tmpStr.length()-1); |
353 | addPropValue(vtodo, VCCategoriesProp, tmpStr.local8Bit()); | 353 | addPropValue(vtodo, VCCategoriesProp, tmpStr.local8Bit()); |
354 | } | 354 | } |
355 | 355 | ||
356 | // alarm stuff | 356 | // alarm stuff |
357 | kdDebug(5800) << "vcalformat::eventToVTodo was called" << endl; | 357 | kdDebug(5800) << "vcalformat::eventToVTodo was called" << endl; |
358 | QPtrList<Alarm> alarms = anEvent->alarms(); | 358 | QPtrList<Alarm> alarms = anEvent->alarms(); |
359 | Alarm* alarm; | 359 | Alarm* alarm; |
360 | for (alarm = alarms.first(); alarm; alarm = alarms.next()) { | 360 | for (alarm = alarms.first(); alarm; alarm = alarms.next()) { |
361 | if (alarm->enabled()) { | 361 | if (alarm->enabled()) { |
362 | VObject *a; | 362 | VObject *a; |
363 | tmpStr = qDateTimeToISO(alarm->time()); | 363 | tmpStr = qDateTimeToISO(alarm->time()); |
364 | if (alarm->type() == Alarm::Audio) { | 364 | if (alarm->type() == Alarm::Audio) { |
365 | a = addProp(vtodo, VCAAlarmProp); | 365 | a = addProp(vtodo, VCAAlarmProp); |
366 | addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); | 366 | addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); |
367 | addPropValue(a, VCRepeatCountProp, "1"); | 367 | addPropValue(a, VCRepeatCountProp, "1"); |
368 | addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile())); | 368 | addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile())); |
369 | } | 369 | } |
370 | else if (alarm->type() == Alarm::Procedure) { | 370 | else if (alarm->type() == Alarm::Procedure) { |
371 | a = addProp(vtodo, VCPAlarmProp); | 371 | a = addProp(vtodo, VCPAlarmProp); |
372 | addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); | 372 | addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); |
373 | addPropValue(a, VCRepeatCountProp, "1"); | 373 | addPropValue(a, VCRepeatCountProp, "1"); |
374 | addPropValue(a, VCProcedureNameProp, QFile::encodeName(alarm->programFile())); | 374 | addPropValue(a, VCProcedureNameProp, QFile::encodeName(alarm->programFile())); |
375 | } else { | 375 | } else { |
376 | a = addProp(vtodo, VCDAlarmProp); | 376 | a = addProp(vtodo, VCDAlarmProp); |
377 | addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); | 377 | addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); |
378 | addPropValue(a, VCRepeatCountProp, "1"); | 378 | addPropValue(a, VCRepeatCountProp, "1"); |
379 | addPropValue(a, VCDisplayStringProp, "beep!"); | 379 | addPropValue(a, VCDisplayStringProp, "beep!"); |
380 | } | 380 | } |
381 | } | 381 | } |
382 | } | 382 | } |
383 | 383 | ||
384 | if (anEvent->pilotId()) { | 384 | if (anEvent->pilotId()) { |
385 | // pilot sync stuff | 385 | // pilot sync stuff |
386 | tmpStr.sprintf("%i",anEvent->pilotId()); | 386 | tmpStr.sprintf("%i",anEvent->pilotId()); |
387 | addPropValue(vtodo, XPilotIdProp, tmpStr.local8Bit()); | 387 | addPropValue(vtodo, XPilotIdProp, tmpStr.local8Bit()); |
388 | tmpStr.sprintf("%i",anEvent->syncStatus()); | 388 | tmpStr.sprintf("%i",anEvent->syncStatus()); |
389 | addPropValue(vtodo, XPilotStatusProp, tmpStr.local8Bit()); | 389 | addPropValue(vtodo, XPilotStatusProp, tmpStr.local8Bit()); |
390 | } | 390 | } |
391 | 391 | ||
392 | return vtodo; | 392 | return vtodo; |
393 | } | 393 | } |
394 | 394 | ||
395 | VObject* VCalFormat::eventToVEvent(const Event *anEvent) | 395 | VObject* VCalFormat::eventToVEvent(const Event *anEvent) |
396 | { | 396 | { |
397 | VObject *vevent; | 397 | VObject *vevent; |
398 | QString tmpStr; | 398 | QString tmpStr; |
399 | QStringList tmpStrList; | 399 | |
400 | |||
401 | vevent = newVObject(VCEventProp); | 400 | vevent = newVObject(VCEventProp); |
402 | 401 | ||
403 | // start and end time | 402 | // start and end time |
404 | tmpStr = qDateTimeToISO(anEvent->dtStart(), | 403 | tmpStr = qDateTimeToISO(anEvent->dtStart(), |
405 | !anEvent->doesFloat()); | 404 | !anEvent->doesFloat()); |
406 | addPropValue(vevent, VCDTstartProp, tmpStr.local8Bit()); | 405 | addPropValue(vevent, VCDTstartProp, tmpStr.local8Bit()); |
407 | 406 | ||
408 | // events that have time associated but take up no time should | 407 | // events that have time associated but take up no time should |
409 | // not have both DTSTART and DTEND. | 408 | // not have both DTSTART and DTEND. |
410 | if (anEvent->dtStart() != anEvent->dtEnd()) { | 409 | if (anEvent->dtStart() != anEvent->dtEnd()) { |
411 | tmpStr = qDateTimeToISO(anEvent->dtEnd(), | 410 | tmpStr = qDateTimeToISO(anEvent->dtEnd(), |
412 | !anEvent->doesFloat()); | 411 | !anEvent->doesFloat()); |
413 | addPropValue(vevent, VCDTendProp, tmpStr.local8Bit()); | 412 | addPropValue(vevent, VCDTendProp, tmpStr.local8Bit()); |
414 | } | 413 | } |
415 | 414 | ||
416 | // creation date | 415 | // creation date |
417 | tmpStr = qDateTimeToISO(anEvent->created()); | 416 | tmpStr = qDateTimeToISO(anEvent->created()); |
418 | addPropValue(vevent, VCDCreatedProp, tmpStr.local8Bit()); | 417 | addPropValue(vevent, VCDCreatedProp, tmpStr.local8Bit()); |
419 | 418 | ||
420 | // unique id | 419 | // unique id |
421 | addPropValue(vevent, VCUniqueStringProp, | 420 | addPropValue(vevent, VCUniqueStringProp, |
422 | anEvent->uid().local8Bit()); | 421 | anEvent->uid().local8Bit()); |
423 | 422 | ||
424 | // revision | 423 | // revision |
425 | tmpStr.sprintf("%i", anEvent->revision()); | 424 | tmpStr.sprintf("%i", anEvent->revision()); |
426 | addPropValue(vevent, VCSequenceProp, tmpStr.local8Bit()); | 425 | addPropValue(vevent, VCSequenceProp, tmpStr.local8Bit()); |
427 | 426 | ||
428 | // last modification date | 427 | // last modification date |
429 | tmpStr = qDateTimeToISO(anEvent->lastModified()); | 428 | tmpStr = qDateTimeToISO(anEvent->lastModified()); |
430 | addPropValue(vevent, VCLastModifiedProp, tmpStr.local8Bit()); | 429 | addPropValue(vevent, VCLastModifiedProp, tmpStr.local8Bit()); |
431 | 430 | ||
432 | // attendee and organizer stuff | 431 | // attendee and organizer stuff |
433 | tmpStr = "MAILTO:" + anEvent->organizer(); | 432 | tmpStr = "MAILTO:" + anEvent->organizer(); |
434 | addPropValue(vevent, ICOrganizerProp, tmpStr.local8Bit()); | 433 | addPropValue(vevent, ICOrganizerProp, tmpStr.local8Bit()); |
435 | 434 | ||
436 | if (anEvent->attendeeCount() != 0) { | 435 | if (anEvent->attendeeCount() != 0) { |
437 | QPtrList<Attendee> al = anEvent->attendees(); | 436 | QPtrList<Attendee> al = anEvent->attendees(); |
438 | QPtrListIterator<Attendee> ai(al); | 437 | QPtrListIterator<Attendee> ai(al); |
439 | Attendee *curAttendee; | 438 | Attendee *curAttendee; |
440 | 439 | ||
441 | // TODO: Put this functionality into Attendee class | 440 | // TODO: Put this functionality into Attendee class |
442 | for (; ai.current(); ++ai) { | 441 | for (; ai.current(); ++ai) { |
443 | curAttendee = ai.current(); | 442 | curAttendee = ai.current(); |
444 | if (!curAttendee->email().isEmpty() && | 443 | if (!curAttendee->email().isEmpty() && |
445 | !curAttendee->name().isEmpty()) | 444 | !curAttendee->name().isEmpty()) |
446 | tmpStr = "MAILTO:" + curAttendee->name() + " <" + | 445 | tmpStr = "MAILTO:" + curAttendee->name() + " <" + |
447 | curAttendee->email() + ">"; | 446 | curAttendee->email() + ">"; |
448 | else if (curAttendee->name().isEmpty()) | 447 | else if (curAttendee->name().isEmpty()) |
@@ -558,97 +557,97 @@ VObject* VCalFormat::eventToVEvent(const Event *anEvent) | |||
558 | QString tmpStr2; | 557 | QString tmpStr2; |
559 | 558 | ||
560 | for (it = dateList.begin(); it != dateList.end(); ++it) { | 559 | for (it = dateList.begin(); it != dateList.end(); ++it) { |
561 | tmpStr = qDateToISO(*it) + ";"; | 560 | tmpStr = qDateToISO(*it) + ";"; |
562 | tmpStr2 += tmpStr; | 561 | tmpStr2 += tmpStr; |
563 | } | 562 | } |
564 | if (!tmpStr2.isEmpty()) { | 563 | if (!tmpStr2.isEmpty()) { |
565 | tmpStr2.truncate(tmpStr2.length()-1); | 564 | tmpStr2.truncate(tmpStr2.length()-1); |
566 | addPropValue(vevent, VCExpDateProp, tmpStr2.local8Bit()); | 565 | addPropValue(vevent, VCExpDateProp, tmpStr2.local8Bit()); |
567 | } | 566 | } |
568 | 567 | ||
569 | // description | 568 | // description |
570 | if (!anEvent->description().isEmpty()) { | 569 | if (!anEvent->description().isEmpty()) { |
571 | VObject *d = addPropValue(vevent, VCDescriptionProp, | 570 | VObject *d = addPropValue(vevent, VCDescriptionProp, |
572 | anEvent->description().local8Bit()); | 571 | anEvent->description().local8Bit()); |
573 | if (anEvent->description().find('\n') != -1) | 572 | if (anEvent->description().find('\n') != -1) |
574 | addProp(d, VCQuotedPrintableProp); | 573 | addProp(d, VCQuotedPrintableProp); |
575 | } | 574 | } |
576 | 575 | ||
577 | // summary | 576 | // summary |
578 | if (!anEvent->summary().isEmpty()) | 577 | if (!anEvent->summary().isEmpty()) |
579 | addPropValue(vevent, VCSummaryProp, anEvent->summary().local8Bit()); | 578 | addPropValue(vevent, VCSummaryProp, anEvent->summary().local8Bit()); |
580 | 579 | ||
581 | if (!anEvent->location().isEmpty()) | 580 | if (!anEvent->location().isEmpty()) |
582 | addPropValue(vevent, VCLocationProp, anEvent->location().local8Bit()); | 581 | addPropValue(vevent, VCLocationProp, anEvent->location().local8Bit()); |
583 | 582 | ||
584 | // status | 583 | // status |
585 | // TODO: define Event status | 584 | // TODO: define Event status |
586 | // addPropValue(vevent, VCStatusProp, anEvent->statusStr().local8Bit()); | 585 | // addPropValue(vevent, VCStatusProp, anEvent->statusStr().local8Bit()); |
587 | 586 | ||
588 | // secrecy | 587 | // secrecy |
589 | const char *text = 0; | 588 | const char *text = 0; |
590 | switch (anEvent->secrecy()) { | 589 | switch (anEvent->secrecy()) { |
591 | case Incidence::SecrecyPublic: | 590 | case Incidence::SecrecyPublic: |
592 | text = "PUBLIC"; | 591 | text = "PUBLIC"; |
593 | break; | 592 | break; |
594 | case Incidence::SecrecyPrivate: | 593 | case Incidence::SecrecyPrivate: |
595 | text = "PRIVATE"; | 594 | text = "PRIVATE"; |
596 | break; | 595 | break; |
597 | case Incidence::SecrecyConfidential: | 596 | case Incidence::SecrecyConfidential: |
598 | text = "CONFIDENTIAL"; | 597 | text = "CONFIDENTIAL"; |
599 | break; | 598 | break; |
600 | } | 599 | } |
601 | if (text) { | 600 | if (text) { |
602 | addPropValue(vevent, VCClassProp, text); | 601 | addPropValue(vevent, VCClassProp, text); |
603 | } | 602 | } |
604 | 603 | ||
605 | // categories | 604 | // categories |
606 | tmpStrList = anEvent->categories(); | 605 | QStringList tmpStrList = anEvent->categories(); |
607 | tmpStr = ""; | 606 | tmpStr = ""; |
608 | QString catStr; | 607 | QString catStr; |
609 | for ( QStringList::Iterator it = tmpStrList.begin(); | 608 | for ( QStringList::Iterator it = tmpStrList.begin(); |
610 | it != tmpStrList.end(); | 609 | it != tmpStrList.end(); |
611 | ++it ) { | 610 | ++it ) { |
612 | catStr = *it; | 611 | catStr = *it; |
613 | if (catStr[0] == ' ') | 612 | if (catStr[0] == ' ') |
614 | tmpStr += catStr.mid(1); | 613 | tmpStr += catStr.mid(1); |
615 | else | 614 | else |
616 | tmpStr += catStr; | 615 | tmpStr += catStr; |
617 | // this must be a ';' character as the vCalendar specification requires! | 616 | // this must be a ';' character as the vCalendar specification requires! |
618 | // vcc.y has been hacked to translate the ';' to a ',' when the vcal is | 617 | // vcc.y has been hacked to translate the ';' to a ',' when the vcal is |
619 | // read in. | 618 | // read in. |
620 | tmpStr += ";"; | 619 | tmpStr += ";"; |
621 | } | 620 | } |
622 | if (!tmpStr.isEmpty()) { | 621 | if (!tmpStr.isEmpty()) { |
623 | tmpStr.truncate(tmpStr.length()-1); | 622 | tmpStr.truncate(tmpStr.length()-1); |
624 | addPropValue(vevent, VCCategoriesProp, tmpStr.local8Bit()); | 623 | addPropValue(vevent, VCCategoriesProp, tmpStr.local8Bit()); |
625 | } | 624 | } |
626 | 625 | ||
627 | // attachments | 626 | // attachments |
628 | // TODO: handle binary attachments! | 627 | // TODO: handle binary attachments! |
629 | QPtrList<Attachment> attachments = anEvent->attachments(); | 628 | QPtrList<Attachment> attachments = anEvent->attachments(); |
630 | for ( Attachment *at = attachments.first(); at; at = attachments.next() ) | 629 | for ( Attachment *at = attachments.first(); at; at = attachments.next() ) |
631 | addPropValue(vevent, VCAttachProp, at->uri().local8Bit()); | 630 | addPropValue(vevent, VCAttachProp, at->uri().local8Bit()); |
632 | 631 | ||
633 | // resources | 632 | // resources |
634 | tmpStrList = anEvent->resources(); | 633 | tmpStrList = anEvent->resources(); |
635 | tmpStr = tmpStrList.join(";"); | 634 | tmpStr = tmpStrList.join(";"); |
636 | if (!tmpStr.isEmpty()) | 635 | if (!tmpStr.isEmpty()) |
637 | addPropValue(vevent, VCResourcesProp, tmpStr.local8Bit()); | 636 | addPropValue(vevent, VCResourcesProp, tmpStr.local8Bit()); |
638 | 637 | ||
639 | // alarm stuff | 638 | // alarm stuff |
640 | QPtrList<Alarm> alarms = anEvent->alarms(); | 639 | QPtrList<Alarm> alarms = anEvent->alarms(); |
641 | Alarm* alarm; | 640 | Alarm* alarm; |
642 | for (alarm = alarms.first(); alarm; alarm = alarms.next()) { | 641 | for (alarm = alarms.first(); alarm; alarm = alarms.next()) { |
643 | if (alarm->enabled()) { | 642 | if (alarm->enabled()) { |
644 | VObject *a ; | 643 | VObject *a ; |
645 | tmpStr = qDateTimeToISO(alarm->time()); | 644 | tmpStr = qDateTimeToISO(alarm->time()); |
646 | if (alarm->type() == Alarm::Audio) { | 645 | if (alarm->type() == Alarm::Audio) { |
647 | a = addProp(vevent, VCAAlarmProp); | 646 | a = addProp(vevent, VCAAlarmProp); |
648 | addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); | 647 | addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); |
649 | addPropValue(a, VCRepeatCountProp, "1"); | 648 | addPropValue(a, VCRepeatCountProp, "1"); |
650 | addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile())); | 649 | addPropValue(a, VCAudioContentProp, QFile::encodeName(alarm->audioFile())); |
651 | } | 650 | } |
652 | if (alarm->type() == Alarm::Procedure) { | 651 | if (alarm->type() == Alarm::Procedure) { |
653 | a = addProp(vevent, VCPAlarmProp); | 652 | a = addProp(vevent, VCPAlarmProp); |
654 | addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); | 653 | addPropValue(a, VCRunTimeProp, tmpStr.local8Bit()); |
@@ -824,114 +823,101 @@ Todo *VCalFormat::VTodoToEvent(VObject *vtodo) | |||
824 | } else { | 823 | } else { |
825 | anEvent->setHasDueDate(false); | 824 | anEvent->setHasDueDate(false); |
826 | } | 825 | } |
827 | 826 | ||
828 | // start time | 827 | // start time |
829 | if ((vo = isAPropertyOf(vtodo, VCDTstartProp)) != 0) { | 828 | if ((vo = isAPropertyOf(vtodo, VCDTstartProp)) != 0) { |
830 | anEvent->setDtStart(ISOToQDateTime(s = fakeCString(vObjectUStringZValue(vo)))); | 829 | anEvent->setDtStart(ISOToQDateTime(s = fakeCString(vObjectUStringZValue(vo)))); |
831 | // kdDebug(5800) << "s is " << // s << ", ISO is " << ISOToQDateTime(s = fakeCString(vObjectUStringZValue(vo))).toString() << endl; | 830 | // kdDebug(5800) << "s is " << // s << ", ISO is " << ISOToQDateTime(s = fakeCString(vObjectUStringZValue(vo))).toString() << endl; |
832 | deleteStr(s); | 831 | deleteStr(s); |
833 | anEvent->setHasStartDate(true); | 832 | anEvent->setHasStartDate(true); |
834 | } else { | 833 | } else { |
835 | anEvent->setHasStartDate(false); | 834 | anEvent->setHasStartDate(false); |
836 | } | 835 | } |
837 | 836 | ||
838 | /* alarm stuff */ | 837 | /* alarm stuff */ |
839 | //kdDebug(5800) << "vcalformat::VTodoToEvent called" << endl; | 838 | //kdDebug(5800) << "vcalformat::VTodoToEvent called" << endl; |
840 | if ((vo = isAPropertyOf(vtodo, VCDAlarmProp))) { | 839 | if ((vo = isAPropertyOf(vtodo, VCDAlarmProp))) { |
841 | Alarm* alarm = anEvent->newAlarm(); | 840 | Alarm* alarm = anEvent->newAlarm(); |
842 | VObject *a; | 841 | VObject *a; |
843 | if ((a = isAPropertyOf(vo, VCRunTimeProp))) { | 842 | if ((a = isAPropertyOf(vo, VCRunTimeProp))) { |
844 | alarm->setTime(ISOToQDateTime(s = fakeCString(vObjectUStringZValue(a)))); | 843 | alarm->setTime(ISOToQDateTime(s = fakeCString(vObjectUStringZValue(a)))); |
845 | deleteStr(s); | 844 | deleteStr(s); |
846 | } | 845 | } |
847 | alarm->setEnabled(true); | 846 | alarm->setEnabled(true); |
848 | if ((vo = isAPropertyOf(vtodo, VCPAlarmProp))) { | 847 | if ((vo = isAPropertyOf(vtodo, VCPAlarmProp))) { |
849 | if ((a = isAPropertyOf(vo, VCProcedureNameProp))) { | 848 | if ((a = isAPropertyOf(vo, VCProcedureNameProp))) { |
850 | s = fakeCString(vObjectUStringZValue(a)); | 849 | s = fakeCString(vObjectUStringZValue(a)); |
851 | alarm->setProcedureAlarm(QFile::decodeName(s)); | 850 | alarm->setProcedureAlarm(QFile::decodeName(s)); |
852 | deleteStr(s); | 851 | deleteStr(s); |
853 | } | 852 | } |
854 | } | 853 | } |
855 | if ((vo = isAPropertyOf(vtodo, VCAAlarmProp))) { | 854 | if ((vo = isAPropertyOf(vtodo, VCAAlarmProp))) { |
856 | if ((a = isAPropertyOf(vo, VCAudioContentProp))) { | 855 | if ((a = isAPropertyOf(vo, VCAudioContentProp))) { |
857 | s = fakeCString(vObjectUStringZValue(a)); | 856 | s = fakeCString(vObjectUStringZValue(a)); |
858 | alarm->setAudioAlarm(QFile::decodeName(s)); | 857 | alarm->setAudioAlarm(QFile::decodeName(s)); |
859 | deleteStr(s); | 858 | deleteStr(s); |
860 | } | 859 | } |
861 | } | 860 | } |
862 | } | 861 | } |
863 | 862 | ||
864 | // related todo | 863 | // related todo |
865 | if ((vo = isAPropertyOf(vtodo, VCRelatedToProp)) != 0) { | 864 | if ((vo = isAPropertyOf(vtodo, VCRelatedToProp)) != 0) { |
866 | anEvent->setRelatedToUid(s = fakeCString(vObjectUStringZValue(vo))); | 865 | anEvent->setRelatedToUid(s = fakeCString(vObjectUStringZValue(vo))); |
867 | deleteStr(s); | 866 | deleteStr(s); |
868 | mTodosRelate.append(anEvent); | 867 | mTodosRelate.append(anEvent); |
869 | } | 868 | } |
870 | 869 | ||
871 | // categories | 870 | // categories |
872 | QStringList tmpStrList; | ||
873 | int index1 = 0; | ||
874 | int index2 = 0; | ||
875 | if ((vo = isAPropertyOf(vtodo, VCCategoriesProp)) != 0) { | 871 | if ((vo = isAPropertyOf(vtodo, VCCategoriesProp)) != 0) { |
876 | s = fakeCString(vObjectUStringZValue(vo)); | 872 | s = fakeCString(vObjectUStringZValue(vo)); |
877 | QString categories = QString::fromLocal8Bit(s); | 873 | QString categories = QString::fromLocal8Bit(s); |
878 | deleteStr(s); | 874 | deleteStr(s); |
879 | //const char* category; | 875 | QStringList tmpStrList = QStringList::split( ';', categories ); |
880 | QString category; | ||
881 | while ((index2 = categories.find(',', index1)) != -1) { | ||
882 | //category = (const char *) categories.mid(index1, (index2 - index1)); | ||
883 | category = categories.mid(index1, (index2 - index1)); | ||
884 | tmpStrList.append(category); | ||
885 | index1 = index2+1; | ||
886 | } | ||
887 | // get last category | ||
888 | category = categories.mid(index1, (categories.length()-index1)); | ||
889 | tmpStrList.append(category); | ||
890 | anEvent->setCategories(tmpStrList); | 876 | anEvent->setCategories(tmpStrList); |
891 | } | 877 | } |
892 | 878 | ||
893 | /* PILOT SYNC STUFF */ | 879 | /* PILOT SYNC STUFF */ |
894 | if ((vo = isAPropertyOf(vtodo, XPilotIdProp))) { | 880 | if ((vo = isAPropertyOf(vtodo, XPilotIdProp))) { |
895 | anEvent->setPilotId(atoi(s = fakeCString(vObjectUStringZValue(vo)))); | 881 | anEvent->setPilotId(atoi(s = fakeCString(vObjectUStringZValue(vo)))); |
896 | deleteStr(s); | 882 | deleteStr(s); |
897 | } | 883 | } |
898 | else | 884 | else |
899 | anEvent->setPilotId(0); | 885 | anEvent->setPilotId(0); |
900 | 886 | ||
901 | if ((vo = isAPropertyOf(vtodo, XPilotStatusProp))) { | 887 | if ((vo = isAPropertyOf(vtodo, XPilotStatusProp))) { |
902 | anEvent->setSyncStatus(atoi(s = fakeCString(vObjectUStringZValue(vo)))); | 888 | anEvent->setSyncStatus(atoi(s = fakeCString(vObjectUStringZValue(vo)))); |
903 | deleteStr(s); | 889 | deleteStr(s); |
904 | } | 890 | } |
905 | else | 891 | else |
906 | anEvent->setSyncStatus(Event::SYNCMOD); | 892 | anEvent->setSyncStatus(Event::SYNCMOD); |
907 | 893 | ||
908 | return anEvent; | 894 | return anEvent; |
909 | } | 895 | } |
910 | 896 | ||
911 | Event* VCalFormat::VEventToEvent(VObject *vevent) | 897 | Event* VCalFormat::VEventToEvent(VObject *vevent) |
912 | { | 898 | { |
913 | VObject *vo; | 899 | VObject *vo; |
914 | VObjectIterator voi; | 900 | VObjectIterator voi; |
915 | char *s; | 901 | char *s; |
916 | 902 | ||
917 | Event *anEvent = new Event; | 903 | Event *anEvent = new Event; |
918 | 904 | ||
919 | // creation date | 905 | // creation date |
920 | if ((vo = isAPropertyOf(vevent, VCDCreatedProp)) != 0) { | 906 | if ((vo = isAPropertyOf(vevent, VCDCreatedProp)) != 0) { |
921 | anEvent->setCreated(ISOToQDateTime(s = fakeCString(vObjectUStringZValue(vo)))); | 907 | anEvent->setCreated(ISOToQDateTime(s = fakeCString(vObjectUStringZValue(vo)))); |
922 | deleteStr(s); | 908 | deleteStr(s); |
923 | } | 909 | } |
924 | 910 | ||
925 | // unique id | 911 | // unique id |
926 | vo = isAPropertyOf(vevent, VCUniqueStringProp); | 912 | vo = isAPropertyOf(vevent, VCUniqueStringProp); |
927 | // while the UID property is preferred, it is not required. We'll use the | 913 | // while the UID property is preferred, it is not required. We'll use the |
928 | // default Event UID if none is given. | 914 | // default Event UID if none is given. |
929 | if (vo) { | 915 | if (vo) { |
930 | anEvent->setUid(s = fakeCString(vObjectUStringZValue(vo))); | 916 | anEvent->setUid(s = fakeCString(vObjectUStringZValue(vo))); |
931 | deleteStr(s); | 917 | deleteStr(s); |
932 | } | 918 | } |
933 | 919 | ||
934 | // revision | 920 | // revision |
935 | // again NSCAL doesn't give us much to work with, so we improvise... | 921 | // again NSCAL doesn't give us much to work with, so we improvise... |
936 | if ((vo = isAPropertyOf(vevent, VCSequenceProp)) != 0) { | 922 | if ((vo = isAPropertyOf(vevent, VCSequenceProp)) != 0) { |
937 | anEvent->setRevision(atoi(s = fakeCString(vObjectUStringZValue(vo)))); | 923 | anEvent->setRevision(atoi(s = fakeCString(vObjectUStringZValue(vo)))); |
@@ -1283,144 +1269,122 @@ Event* VCalFormat::VEventToEvent(VObject *vevent) | |||
1283 | // description | 1269 | // description |
1284 | if ((vo = isAPropertyOf(vevent, VCDescriptionProp)) != 0) { | 1270 | if ((vo = isAPropertyOf(vevent, VCDescriptionProp)) != 0) { |
1285 | s = fakeCString(vObjectUStringZValue(vo)); | 1271 | s = fakeCString(vObjectUStringZValue(vo)); |
1286 | if (!anEvent->description().isEmpty()) { | 1272 | if (!anEvent->description().isEmpty()) { |
1287 | anEvent->setDescription(anEvent->description() + "\n" + | 1273 | anEvent->setDescription(anEvent->description() + "\n" + |
1288 | QString::fromLocal8Bit(s)); | 1274 | QString::fromLocal8Bit(s)); |
1289 | } else { | 1275 | } else { |
1290 | anEvent->setDescription(QString::fromLocal8Bit(s)); | 1276 | anEvent->setDescription(QString::fromLocal8Bit(s)); |
1291 | } | 1277 | } |
1292 | deleteStr(s); | 1278 | deleteStr(s); |
1293 | } | 1279 | } |
1294 | 1280 | ||
1295 | // some stupid vCal exporters ignore the standard and use Description | 1281 | // some stupid vCal exporters ignore the standard and use Description |
1296 | // instead of Summary for the default field. Correct for this. | 1282 | // instead of Summary for the default field. Correct for this. |
1297 | if (anEvent->summary().isEmpty() && | 1283 | if (anEvent->summary().isEmpty() && |
1298 | !(anEvent->description().isEmpty())) { | 1284 | !(anEvent->description().isEmpty())) { |
1299 | QString tmpStr = anEvent->description().simplifyWhiteSpace(); | 1285 | QString tmpStr = anEvent->description().simplifyWhiteSpace(); |
1300 | anEvent->setDescription(""); | 1286 | anEvent->setDescription(""); |
1301 | anEvent->setSummary(tmpStr); | 1287 | anEvent->setSummary(tmpStr); |
1302 | } | 1288 | } |
1303 | 1289 | ||
1304 | #if 0 | 1290 | #if 0 |
1305 | // status | 1291 | // status |
1306 | if ((vo = isAPropertyOf(vevent, VCStatusProp)) != 0) { | 1292 | if ((vo = isAPropertyOf(vevent, VCStatusProp)) != 0) { |
1307 | QString tmpStr(s = fakeCString(vObjectUStringZValue(vo))); | 1293 | QString tmpStr(s = fakeCString(vObjectUStringZValue(vo))); |
1308 | deleteStr(s); | 1294 | deleteStr(s); |
1309 | // TODO: Define Event status | 1295 | // TODO: Define Event status |
1310 | // anEvent->setStatus(tmpStr); | 1296 | // anEvent->setStatus(tmpStr); |
1311 | } | 1297 | } |
1312 | else | 1298 | else |
1313 | // anEvent->setStatus("NEEDS ACTION"); | 1299 | // anEvent->setStatus("NEEDS ACTION"); |
1314 | #endif | 1300 | #endif |
1315 | 1301 | ||
1316 | // secrecy | 1302 | // secrecy |
1317 | int secrecy = Incidence::SecrecyPublic; | 1303 | int secrecy = Incidence::SecrecyPublic; |
1318 | if ((vo = isAPropertyOf(vevent, VCClassProp)) != 0) { | 1304 | if ((vo = isAPropertyOf(vevent, VCClassProp)) != 0) { |
1319 | s = fakeCString(vObjectUStringZValue(vo)); | 1305 | s = fakeCString(vObjectUStringZValue(vo)); |
1320 | if (strcmp(s,"PRIVATE") == 0) { | 1306 | if (strcmp(s,"PRIVATE") == 0) { |
1321 | secrecy = Incidence::SecrecyPrivate; | 1307 | secrecy = Incidence::SecrecyPrivate; |
1322 | } else if (strcmp(s,"CONFIDENTIAL") == 0) { | 1308 | } else if (strcmp(s,"CONFIDENTIAL") == 0) { |
1323 | secrecy = Incidence::SecrecyConfidential; | 1309 | secrecy = Incidence::SecrecyConfidential; |
1324 | } | 1310 | } |
1325 | deleteStr(s); | 1311 | deleteStr(s); |
1326 | } | 1312 | } |
1327 | anEvent->setSecrecy(secrecy); | 1313 | anEvent->setSecrecy(secrecy); |
1328 | 1314 | ||
1329 | // categories | 1315 | // categories |
1330 | QStringList tmpStrList; | 1316 | QStringList tmpStrList; |
1331 | int index1 = 0; | ||
1332 | int index2 = 0; | ||
1333 | if ((vo = isAPropertyOf(vevent, VCCategoriesProp)) != 0) { | 1317 | if ((vo = isAPropertyOf(vevent, VCCategoriesProp)) != 0) { |
1334 | s = fakeCString(vObjectUStringZValue(vo)); | 1318 | s = fakeCString(vObjectUStringZValue(vo)); |
1335 | QString categories = QString::fromLocal8Bit(s); | 1319 | QString categories = QString::fromLocal8Bit(s); |
1336 | deleteStr(s); | 1320 | deleteStr(s); |
1337 | //const char* category; | 1321 | tmpStrList = QStringList::split( ';', categories ); |
1338 | QString category; | ||
1339 | while ((index2 = categories.find(',', index1)) != -1) { | ||
1340 | //category = (const char *) categories.mid(index1, (index2 - index1)); | ||
1341 | category = categories.mid(index1, (index2 - index1)); | ||
1342 | tmpStrList.append(category); | ||
1343 | index1 = index2+1; | ||
1344 | } | ||
1345 | // get last category | ||
1346 | category = categories.mid(index1, (categories.length()-index1)); | ||
1347 | tmpStrList.append(category); | ||
1348 | anEvent->setCategories(tmpStrList); | 1322 | anEvent->setCategories(tmpStrList); |
1349 | } | 1323 | } |
1350 | 1324 | ||
1351 | // attachments | 1325 | // attachments |
1352 | tmpStrList.clear(); | ||
1353 | initPropIterator(&voi, vevent); | 1326 | initPropIterator(&voi, vevent); |
1354 | while (moreIteration(&voi)) { | 1327 | while (moreIteration(&voi)) { |
1355 | vo = nextVObject(&voi); | 1328 | vo = nextVObject(&voi); |
1356 | if (strcmp(vObjectName(vo), VCAttachProp) == 0) { | 1329 | if (strcmp(vObjectName(vo), VCAttachProp) == 0) { |
1357 | s = fakeCString(vObjectUStringZValue(vo)); | 1330 | s = fakeCString(vObjectUStringZValue(vo)); |
1358 | anEvent->addAttachment(new Attachment(QString(s))); | 1331 | anEvent->addAttachment(new Attachment(QString(s))); |
1359 | deleteStr(s); | 1332 | deleteStr(s); |
1360 | } | 1333 | } |
1361 | } | 1334 | } |
1362 | 1335 | ||
1363 | // resources | 1336 | // resources |
1364 | if ((vo = isAPropertyOf(vevent, VCResourcesProp)) != 0) { | 1337 | if ((vo = isAPropertyOf(vevent, VCResourcesProp)) != 0) { |
1365 | QString resources = (s = fakeCString(vObjectUStringZValue(vo))); | 1338 | QString resources = (s = fakeCString(vObjectUStringZValue(vo))); |
1366 | deleteStr(s); | 1339 | deleteStr(s); |
1367 | tmpStrList.clear(); | 1340 | tmpStrList = QStringList::split( ';', resources ); |
1368 | index1 = 0; | ||
1369 | index2 = 0; | ||
1370 | QString resource; | ||
1371 | while ((index2 = resources.find(';', index1)) != -1) { | ||
1372 | resource = resources.mid(index1, (index2 - index1)); | ||
1373 | tmpStrList.append(resource); | ||
1374 | index1 = index2; | ||
1375 | } | ||
1376 | anEvent->setResources(tmpStrList); | 1341 | anEvent->setResources(tmpStrList); |
1377 | } | 1342 | } |
1378 | |||
1379 | /* alarm stuff */ | 1343 | /* alarm stuff */ |
1380 | if ((vo = isAPropertyOf(vevent, VCDAlarmProp))) { | 1344 | if ((vo = isAPropertyOf(vevent, VCDAlarmProp))) { |
1381 | Alarm* alarm = anEvent->newAlarm(); | 1345 | Alarm* alarm = anEvent->newAlarm(); |
1382 | VObject *a; | 1346 | VObject *a; |
1383 | if ((a = isAPropertyOf(vo, VCRunTimeProp))) { | 1347 | if ((a = isAPropertyOf(vo, VCRunTimeProp))) { |
1384 | alarm->setTime(ISOToQDateTime(s = fakeCString(vObjectUStringZValue(a)))); | 1348 | alarm->setTime(ISOToQDateTime(s = fakeCString(vObjectUStringZValue(a)))); |
1385 | deleteStr(s); | 1349 | deleteStr(s); |
1386 | } | 1350 | } |
1387 | alarm->setEnabled(true); | 1351 | alarm->setEnabled(true); |
1388 | if ((vo = isAPropertyOf(vevent, VCPAlarmProp))) { | 1352 | if ((vo = isAPropertyOf(vevent, VCPAlarmProp))) { |
1389 | if ((a = isAPropertyOf(vo, VCProcedureNameProp))) { | 1353 | if ((a = isAPropertyOf(vo, VCProcedureNameProp))) { |
1390 | s = fakeCString(vObjectUStringZValue(a)); | 1354 | s = fakeCString(vObjectUStringZValue(a)); |
1391 | alarm->setProcedureAlarm(QFile::decodeName(s)); | 1355 | alarm->setProcedureAlarm(QFile::decodeName(s)); |
1392 | deleteStr(s); | 1356 | deleteStr(s); |
1393 | } | 1357 | } |
1394 | } | 1358 | } |
1395 | if ((vo = isAPropertyOf(vevent, VCAAlarmProp))) { | 1359 | if ((vo = isAPropertyOf(vevent, VCAAlarmProp))) { |
1396 | if ((a = isAPropertyOf(vo, VCAudioContentProp))) { | 1360 | if ((a = isAPropertyOf(vo, VCAudioContentProp))) { |
1397 | s = fakeCString(vObjectUStringZValue(a)); | 1361 | s = fakeCString(vObjectUStringZValue(a)); |
1398 | alarm->setAudioAlarm(QFile::decodeName(s)); | 1362 | alarm->setAudioAlarm(QFile::decodeName(s)); |
1399 | deleteStr(s); | 1363 | deleteStr(s); |
1400 | } | 1364 | } |
1401 | } | 1365 | } |
1402 | } | 1366 | } |
1403 | 1367 | ||
1404 | // priority | 1368 | // priority |
1405 | if ((vo = isAPropertyOf(vevent, VCPriorityProp))) { | 1369 | if ((vo = isAPropertyOf(vevent, VCPriorityProp))) { |
1406 | anEvent->setPriority(atoi(s = fakeCString(vObjectUStringZValue(vo)))); | 1370 | anEvent->setPriority(atoi(s = fakeCString(vObjectUStringZValue(vo)))); |
1407 | deleteStr(s); | 1371 | deleteStr(s); |
1408 | } | 1372 | } |
1409 | 1373 | ||
1410 | // transparency | 1374 | // transparency |
1411 | if ((vo = isAPropertyOf(vevent, VCTranspProp)) != 0) { | 1375 | if ((vo = isAPropertyOf(vevent, VCTranspProp)) != 0) { |
1412 | int i = atoi(s = fakeCString(vObjectUStringZValue(vo))); | 1376 | int i = atoi(s = fakeCString(vObjectUStringZValue(vo))); |
1413 | anEvent->setTransparency( i == 1 ? Event::Transparent : Event::Opaque ); | 1377 | anEvent->setTransparency( i == 1 ? Event::Transparent : Event::Opaque ); |
1414 | deleteStr(s); | 1378 | deleteStr(s); |
1415 | } | 1379 | } |
1416 | 1380 | ||
1417 | // related event | 1381 | // related event |
1418 | if ((vo = isAPropertyOf(vevent, VCRelatedToProp)) != 0) { | 1382 | if ((vo = isAPropertyOf(vevent, VCRelatedToProp)) != 0) { |
1419 | anEvent->setRelatedToUid(s = fakeCString(vObjectUStringZValue(vo))); | 1383 | anEvent->setRelatedToUid(s = fakeCString(vObjectUStringZValue(vo))); |
1420 | deleteStr(s); | 1384 | deleteStr(s); |
1421 | mEventsRelate.append(anEvent); | 1385 | mEventsRelate.append(anEvent); |
1422 | } | 1386 | } |
1423 | 1387 | ||
1424 | /* PILOT SYNC STUFF */ | 1388 | /* PILOT SYNC STUFF */ |
1425 | if ((vo = isAPropertyOf(vevent, XPilotIdProp))) { | 1389 | if ((vo = isAPropertyOf(vevent, XPilotIdProp))) { |
1426 | anEvent->setPilotId(atoi(s = fakeCString(vObjectUStringZValue(vo)))); | 1390 | anEvent->setPilotId(atoi(s = fakeCString(vObjectUStringZValue(vo)))); |