1 |
--- calendar/gcalresource.cpp 2011/01/05 00:51:05 1211814 |
2 |
+++ calendar/gcalresource.cpp 2011/01/21 15:45:14 1216151 |
3 |
@@ -203,12 +203,16 @@ |
4 |
temp = gcal_event_get_end(event); |
5 |
end = end.fromString(temp, KDateTime::ISODate); |
6 |
kevent->setDtStart(start); |
7 |
+ |
8 |
+ if (end.isDateOnly()) { |
9 |
+ // KCal::Event::dtEnd() is inclusive, not exclusive. |
10 |
+ // ( When serializing back to ICal, +1 is added internaly, to respect ical rfc ) |
11 |
+ end = end.addDays(-1); |
12 |
+ } |
13 |
kevent->setDtEnd(end); |
14 |
- |
15 |
+ |
16 |
qDebug() << "start: " << start.dateTime() |
17 |
<< "\tend: " << end.dateTime(); |
18 |
- |
19 |
- |
20 |
/* remoteID: edit_url */ |
21 |
KUrl urlEtag(gcal_event_get_url(event)); |
22 |
item.setRemoteId(urlEtag.url()); |
23 |
@@ -379,8 +383,15 @@ |
24 |
temp = gcal_event_get_end(event); |
25 |
end = end.fromString(temp, KDateTime::ISODate); |
26 |
kevent->setDtStart(start); |
27 |
- kevent->setDtEnd(end); |
28 |
+ |
29 |
+ if (end.isDateOnly()) { |
30 |
+ // KCal::Event::dtEnd() is inclusive, not exclusive. |
31 |
+ // ( When serializing back to ICal, +1 is added internaly, to respect ical rfc ) |
32 |
+ end = end.addDays(-1); |
33 |
+ } |
34 |
|
35 |
+ kevent->setDtEnd(end); |
36 |
+ |
37 |
url = gcal_event_get_url(event); |
38 |
item.setRemoteId(url.url()); |
39 |
item.setPayload(IncidencePtr(kevent)); |
40 |
@@ -527,6 +538,12 @@ |
41 |
gcal_event_set_start(event, t_byte.data()); |
42 |
|
43 |
time = kevent->dtEnd(); |
44 |
+ |
45 |
+ if (time.isDateOnly()) { |
46 |
+ // KCal::Event::dtEnd() is inclusive, not exclusive. |
47 |
+ time = time.addDays(1); |
48 |
+ } |
49 |
+ |
50 |
temp = time.toString(KDateTime::ISODate); |
51 |
t_byte = temp.toUtf8(); |
52 |
gcal_event_set_end(event, t_byte.data()); |
53 |
@@ -627,6 +644,12 @@ |
54 |
gcal_event_set_start(event, t_byte.data()); |
55 |
|
56 |
time = kevent->dtEnd(); |
57 |
+ |
58 |
+ if (time.isDateOnly()) { |
59 |
+ // KCal::Event::dtEnd() is inclusive, not exclusive. |
60 |
+ time = time.addDays(1); |
61 |
+ } |
62 |
+ |
63 |
temp = time.toString(KDateTime::ISODate); |
64 |
t_byte = temp.toUtf8(); |
65 |
gcal_event_set_end(event, t_byte.data()); |
66 |
|