summaryrefslogtreecommitdiffstats
path: root/tests/teststore.cpp
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2018-04-11 17:03:55 +0200
committerMinijackson <minijackson@riseup.net>2018-04-11 17:03:55 +0200
commit79a78d81412c1c99ecfa06a85925946609327835 (patch)
tree710ea0706f46eee701eb531886e1cc9b4090c661 /tests/teststore.cpp
parent004a1a2e91c72f9b1b7ca964fe20cd6a1a6e68a6 (diff)
downloadkube-calendar-feature/teststore.tar.gz
kube-calendar-feature/teststore.zip
Update to Event preprocessor change + set the resources correctlycalendar-feature/teststore
Diffstat (limited to 'tests/teststore.cpp')
-rw-r--r--tests/teststore.cpp18
1 files changed, 6 insertions, 12 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