Changeset View
Changeset View
Standalone View
Standalone View
resources/kolab/pimkolab/autotests/testutils.h
Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Line(s) | |||||
130 | 130 | | |||
131 | //Normalize incidences for comparison | 131 | //Normalize incidences for comparison | ||
132 | void normalizeIncidence(KCalCore::Incidence::Ptr incidence) | 132 | void normalizeIncidence(KCalCore::Incidence::Ptr incidence) | ||
133 | { | 133 | { | ||
134 | //The UID is not persistent (it's just the internal pointer), therefore we clear it | 134 | //The UID is not persistent (it's just the internal pointer), therefore we clear it | ||
135 | //TODO make sure that the UID does really not need to be persistent | 135 | //TODO make sure that the UID does really not need to be persistent | ||
136 | auto attendees = incidence->attendees(); | 136 | auto attendees = incidence->attendees(); | ||
137 | for (auto &attendee : attendees) { | 137 | for (auto &attendee : attendees) { | ||
138 | attendee->setUid(attendee->email()); | 138 | attendee.setUid(attendee.email()); | ||
139 | } | 139 | } | ||
140 | incidence->setAttendees(attendees); | 140 | incidence->setAttendees(attendees); | ||
141 | 141 | | |||
142 | //FIXME even if hasDueDate can differ, it shouldn't because it breaks equality. Check why they differ in the first place. | 142 | //FIXME even if hasDueDate can differ, it shouldn't because it breaks equality. Check why they differ in the first place. | ||
143 | if (incidence->type() == KCalCore::IncidenceBase::TypeTodo) { | 143 | if (incidence->type() == KCalCore::IncidenceBase::TypeTodo) { | ||
144 | KCalCore::Todo::Ptr todo = incidence.dynamicCast<KCalCore::Todo>(); | 144 | KCalCore::Todo::Ptr todo = incidence.dynamicCast<KCalCore::Todo>(); | ||
145 | Q_ASSERT(todo.data()); | 145 | Q_ASSERT(todo.data()); | ||
146 | if (!todo->hasDueDate() && !todo->hasStartDate()) { | 146 | if (!todo->hasDueDate() && !todo->hasStartDate()) { | ||
▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines |