diff options
-rw-r--r-- | tests/teststore.cpp | 18 | ||||
-rw-r--r-- | views/calendar/main.qml | 19 |
2 files changed, 17 insertions, 20 deletions
diff --git a/tests/teststore.cpp b/tests/teststore.cpp index 902014cd..3a60676d 100644 --- a/tests/teststore.cpp +++ b/tests/teststore.cpp | |||
@@ -138,36 +138,30 @@ static void createEvent(const QVariantMap &object, const QByteArray &calendarId | |||
138 | 138 | ||
139 | auto calcoreEvent = QSharedPointer<KCalCore::Event>::create(); | 139 | auto calcoreEvent = QSharedPointer<KCalCore::Event>::create(); |
140 | 140 | ||
141 | QString uid; | ||
141 | if (object.contains("uid")) { | 142 | if (object.contains("uid")) { |
142 | auto uid = object["uid"].toString(); | 143 | uid = object["uid"].toString(); |
143 | sinkEvent.setUid(uid); | ||
144 | calcoreEvent->setUid(uid); | ||
145 | } else { | 144 | } else { |
146 | auto uid = QUuid::createUuid().toString(); | 145 | uid = QUuid::createUuid().toString(); |
147 | sinkEvent.setUid(uid); | ||
148 | calcoreEvent->setUid(uid); | ||
149 | } | 146 | } |
147 | calcoreEvent->setUid(uid); | ||
150 | 148 | ||
151 | auto summary = object["summary"].toString(); | 149 | auto summary = object["summary"].toString(); |
152 | sinkEvent.setSummary(summary); | ||
153 | calcoreEvent->setSummary(summary); | 150 | calcoreEvent->setSummary(summary); |
154 | 151 | ||
155 | if (object.contains("description")) { | 152 | if (object.contains("description")) { |
156 | auto description = object["description"].toString(); | 153 | auto description = object["description"].toString(); |
157 | sinkEvent.setDescription(description); | ||
158 | calcoreEvent->setDescription(description); | 154 | calcoreEvent->setDescription(description); |
159 | } | 155 | } |
160 | 156 | ||
161 | auto startTime = object["starts"].toDateTime(); | 157 | auto startTime = object["starts"].toDateTime(); |
162 | auto endTime = object["ends"].toDateTime(); | 158 | auto endTime = object["ends"].toDateTime(); |
163 | sinkEvent.setStartTime(startTime); | ||
164 | sinkEvent.setEndTime(endTime); | ||
165 | 159 | ||
166 | calcoreEvent->setDtStart(startTime); | 160 | calcoreEvent->setDtStart(startTime); |
167 | calcoreEvent->setDtEnd(endTime); | 161 | calcoreEvent->setDtEnd(endTime); |
168 | 162 | ||
169 | auto ical = KCalCore::ICalFormat().toRawString(static_cast<QSharedPointer<KCalCore::Incidence>>(calcoreEvent)); | 163 | auto ical = KCalCore::ICalFormat().toICalString(calcoreEvent); |
170 | sinkEvent.setIcal(ical); | 164 | sinkEvent.setIcal(ical.toUtf8()); |
171 | 165 | ||
172 | sinkEvent.setCalendar(calendarId); | 166 | sinkEvent.setCalendar(calendarId); |
173 | 167 | ||
diff --git a/views/calendar/main.qml b/views/calendar/main.qml index d2bdc1c3..672e3e21 100644 --- a/views/calendar/main.qml +++ b/views/calendar/main.qml | |||
@@ -47,19 +47,22 @@ ApplicationWindow { | |||
47 | }], | 47 | }], |
48 | calendars: [{ | 48 | calendars: [{ |
49 | id: "calendar1", | 49 | id: "calendar1", |
50 | resource: "caldavresource", | ||
50 | name: "Test Calendar", | 51 | name: "Test Calendar", |
51 | events: [ | 52 | events: [ |
52 | { | 53 | { |
53 | "summary": "Test Event1", | 54 | resource: "caldavresource", |
54 | "description": "This is test event #1", | 55 | summary: "Test Event1", |
55 | "starts": "2018-04-10T14:03:00", | 56 | description: "This is test event #1", |
56 | "ends": "2018-04-10T17:03:00", | 57 | starts: "2018-04-10T14:03:00", |
58 | ends: "2018-04-10T17:03:00", | ||
57 | }, | 59 | }, |
58 | { | 60 | { |
59 | "summary": "Test Event1", | 61 | resource: "caldavresource", |
60 | "description": "This is test event #1", | 62 | summary: "Test Event2", |
61 | "starts": "2018-04-11T09:03:00", | 63 | description: "This is test event #2", |
62 | "ends": "2018-04-11T14:03:00", | 64 | starts: "2018-04-11T09:03:00", |
65 | ends: "2018-04-11T14:03:00", | ||
63 | }, | 66 | }, |
64 | ], | 67 | ], |
65 | }], | 68 | }], |