From 79a78d81412c1c99ecfa06a85925946609327835 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Wed, 11 Apr 2018 17:03:55 +0200 Subject: Update to Event preprocessor change + set the resources correctly --- tests/teststore.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'tests/teststore.cpp') 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 auto calcoreEvent = QSharedPointer::create(); + QString uid; if (object.contains("uid")) { - auto uid = object["uid"].toString(); - sinkEvent.setUid(uid); - calcoreEvent->setUid(uid); + uid = object["uid"].toString(); } else { - auto uid = QUuid::createUuid().toString(); - sinkEvent.setUid(uid); - calcoreEvent->setUid(uid); + uid = QUuid::createUuid().toString(); } + calcoreEvent->setUid(uid); auto summary = object["summary"].toString(); - sinkEvent.setSummary(summary); calcoreEvent->setSummary(summary); if (object.contains("description")) { auto description = object["description"].toString(); - sinkEvent.setDescription(description); calcoreEvent->setDescription(description); } auto startTime = object["starts"].toDateTime(); auto endTime = object["ends"].toDateTime(); - sinkEvent.setStartTime(startTime); - sinkEvent.setEndTime(endTime); calcoreEvent->setDtStart(startTime); calcoreEvent->setDtEnd(endTime); - auto ical = KCalCore::ICalFormat().toRawString(static_cast>(calcoreEvent)); - sinkEvent.setIcal(ical); + auto ical = KCalCore::ICalFormat().toICalString(calcoreEvent); + sinkEvent.setIcal(ical.toUtf8()); sinkEvent.setCalendar(calendarId); -- cgit v1.2.3