Page MenuHomePhorge

D2323.1775164520.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D2323.1775164520.diff

diff --git a/calendaring/event.cpp b/calendaring/event.cpp
--- a/calendaring/event.cpp
+++ b/calendaring/event.cpp
@@ -141,17 +141,22 @@
void Event::delegate(const std::vector< Attendee >& delegators, const std::vector< Attendee >& delegatees)
{
- //First build a list of attendee references, and insert any missing attendees
- std::vector<Kolab::Attendee*> delegateesRef;
+ //First insert any missing attendees
foreach(const Attendee &a, delegatees) {
- if (Attendee *attendee = getAttendee(a.contact())) {
- delegateesRef.push_back(attendee);
- } else {
+ if (!getAttendee(a.contact())) {
d->attendees.push_back(a);
- delegateesRef.push_back(&d->attendees.back());
}
}
+ //Build a list of attendee references
+ //These are pointers into d->attendees, so we MUST NOT modify that vector after this point!
+ std::vector<Kolab::Attendee*> delegateesRef;
+ foreach(const Attendee &a, delegatees) {
+ Attendee *attendee = getAttendee(a.contact());
+ Q_ASSERT(attendee);
+ delegateesRef.push_back(attendee);
+ }
+
std::vector<Kolab::Attendee*> delegatorsRef;
foreach(const Attendee& a, delegators) {
if (Attendee *attendee = getAttendee(a.contact())) {
diff --git a/conversion/kcalconversion.cpp b/conversion/kcalconversion.cpp
--- a/conversion/kcalconversion.cpp
+++ b/conversion/kcalconversion.cpp
@@ -316,7 +316,7 @@
if (!a.uri().empty()) {
ptr = KCalCore::Attachment::Ptr(new KCalCore::Attachment(fromStdString(a.uri()), fromStdString(a.mimetype())));
} else {
- ptr = KCalCore::Attachment::Ptr(new KCalCore::Attachment(QByteArray::fromRawData(a.data().c_str(), a.data().size()), fromStdString(a.mimetype())));
+ ptr = KCalCore::Attachment::Ptr(new KCalCore::Attachment(QByteArray(a.data().c_str(), a.data().size()), fromStdString(a.mimetype())));
}
if (!a.label().empty()) {
ptr->setLabel(fromStdString(a.label()));

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 2, 9:15 PM (3 d, 21 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18820905
Default Alt Text
D2323.1775164520.diff (1 KB)

Event Timeline