diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,7 @@ set(AKONADI_VERSION "5.11.40") set(KCONTACTS_LIB_VERSION "5.11.40") -set(KCALENDARCORE_LIB_VERSION "5.11.43") +set(KCALENDARCORE_LIB_VERSION "5.11.44") set(IDENTITYMANAGEMENT_LIB_VERSION "5.11.40") set(KMAILTRANSPORT_LIB_VERSION "5.11.40") set(CALENDARUTILS_LIB_VERSION "5.11.40") diff --git a/resources/dav/resource/davfreebusyhandler.cpp b/resources/dav/resource/davfreebusyhandler.cpp --- a/resources/dav/resource/davfreebusyhandler.cpp +++ b/resources/dav/resource/davfreebusyhandler.cpp @@ -61,7 +61,7 @@ } KCalCore::FreeBusy::Ptr fb(new KCalCore::FreeBusy(start, end)); - KCalCore::Attendee::Ptr att(new KCalCore::Attendee(QString(), email)); + KCalCore::Attendee att(QString(), email); fb->addAttendee(att); KCalCore::ICalFormat formatter; diff --git a/resources/google/calendar/calendarresource.cpp b/resources/google/calendar/calendarresource.cpp --- a/resources/google/calendar/calendarresource.cpp +++ b/resources/google/calendar/calendarresource.cpp @@ -775,7 +775,7 @@ KCalCore::FreeBusy::Ptr fb(new KCalCore::FreeBusy); fb->setUid(QStringLiteral("%1%2@google.com").arg(QDateTime::currentDateTimeUtc().toString(QStringLiteral("yyyyMMddTHHmmssZ")))); fb->setOrganizer(account()->accountName()); - fb->addAttendee(KCalCore::Attendee::Ptr(new KCalCore::Attendee(QString(), queryJob->id()))); + fb->addAttendee(KCalCore::Attendee(QString(), queryJob->id())); // FIXME: is it really sort? fb->setDateTime(QDateTime::currentDateTimeUtc(), KCalCore::IncidenceBase::RoleSort); diff --git a/resources/kolab/pimkolab/autotests/kcalconversiontest.cpp b/resources/kolab/pimkolab/autotests/kcalconversiontest.cpp --- a/resources/kolab/pimkolab/autotests/kcalconversiontest.cpp +++ b/resources/kolab/pimkolab/autotests/kcalconversiontest.cpp @@ -43,11 +43,11 @@ { QCOMPARE(list.size(), other.size()); for (int i = 0; i < list.size(); i++) { - KCalCore::Attendee::Ptr at1 = list.at(i).constCast(); - at1->setUid(QString()); - KCalCore::Attendee::Ptr at2 = other.at(i).constCast(); - at2->setUid(QString()); - QCOMPARE(*at1, *at2); + KCalCore::Attendee at1 = list.at(i); + at1.setUid(QString()); + KCalCore::Attendee at2 = other.at(i); + at2.setUid(QString()); + QCOMPARE(at1, at2); } } @@ -183,9 +183,9 @@ kcal.setOrganizer(KCalCore::Person(QStringLiteral("organizer"), QStringLiteral("organizer@email"))); //Url kcal.setNonKDECustomProperty("X-KOLAB-URL", QStringLiteral("http://test.org")); - KCalCore::Attendee::Ptr att(new KCalCore::Attendee(QStringLiteral("attendee"), QStringLiteral("attendee@email"), false, KCalCore::Attendee::NeedsAction, KCalCore::Attendee::ReqParticipant)); - att->setDelegate(QStringLiteral("mailto:delegatee")); - att->setDelegator(QStringLiteral("mailto:delegator")); + KCalCore::Attendee att(QStringLiteral("attendee"), QStringLiteral("attendee@email"), false, KCalCore::Attendee::NeedsAction, KCalCore::Attendee::ReqParticipant); + att.setDelegate(QStringLiteral("mailto:delegatee")); + att.setDelegator(QStringLiteral("mailto:delegator")); kcal.addAttendee(att); kcal.addAttachment(KCalCore::Attachment::Ptr(new KCalCore::Attachment(QStringLiteral("uri"), QStringLiteral("mimetype/mime")))); KCalCore::Alarm::Ptr alarm = KCalCore::Alarm::Ptr(new KCalCore::Alarm(&kcal)); diff --git a/resources/kolab/pimkolab/autotests/testutils.h b/resources/kolab/pimkolab/autotests/testutils.h --- a/resources/kolab/pimkolab/autotests/testutils.h +++ b/resources/kolab/pimkolab/autotests/testutils.h @@ -135,7 +135,7 @@ //TODO make sure that the UID does really not need to be persistent auto attendees = incidence->attendees(); for (auto &attendee : attendees) { - attendee->setUid(attendee->email()); + attendee.setUid(attendee.email()); } incidence->setAttendees(attendees); diff --git a/resources/kolab/pimkolab/conversion/kcalconversion.cpp b/resources/kolab/pimkolab/conversion/kcalconversion.cpp --- a/resources/kolab/pimkolab/conversion/kcalconversion.cpp +++ b/resources/kolab/pimkolab/conversion/kcalconversion.cpp @@ -283,28 +283,28 @@ * KCalCore always sets a UID if empty, but that's just a pointer, and not the uid of a real contact. * Since that means the semantics of the two are different, we have to store the kolab uid as a custom property. */ - KCalCore::Attendee::Ptr attendee = KCalCore::Attendee::Ptr(new KCalCore::Attendee(fromStdString(a.contact().name()), + KCalCore::Attendee attendee(fromStdString(a.contact().name()), fromStdString(a.contact().email()), a.rsvp(), toPartStat(a.partStat()), - toRole(a.role()))); + toRole(a.role())); if (!a.contact().uid().empty()) { //TODO Identify contact from addressbook based on uid - attendee->customProperties().setNonKDECustomProperty(CUSTOM_KOLAB_CONTACT_UUID, fromStdString(a.contact().uid())); + attendee.customProperties().setNonKDECustomProperty(CUSTOM_KOLAB_CONTACT_UUID, fromStdString(a.contact().uid())); } if (!a.delegatedTo().empty()) { if (a.delegatedTo().size() > 1) { qCWarning(PIMKOLAB_LOG) << "multiple delegatees are not supported"; } - attendee->setDelegate(toMailto(a.delegatedTo().front().email(), a.delegatedTo().front().name()).toString()); + attendee.setDelegate(toMailto(a.delegatedTo().front().email(), a.delegatedTo().front().name()).toString()); } if (!a.delegatedFrom().empty()) { if (a.delegatedFrom().size() > 1) { qCWarning(PIMKOLAB_LOG) << "multiple delegators are not supported"; } - attendee->setDelegator(toMailto(a.delegatedFrom().front().email(), a.delegatedFrom().front().name()).toString()); + attendee.setDelegator(toMailto(a.delegatedFrom().front().email(), a.delegatedFrom().front().name()).toString()); } if (a.cutype() != Kolab::CutypeIndividual) { - attendee->customProperties().setNonKDECustomProperty(CUSTOM_KOLAB_CONTACT_CUTYPE, QString::number(a.cutype())); + attendee.customProperties().setNonKDECustomProperty(CUSTOM_KOLAB_CONTACT_CUTYPE, QString::number(a.cutype())); } i.addAttendee(attendee); } @@ -349,23 +349,23 @@ i.setDescription(toStdString(e.description())); i.setStatus(fromStatus(e.status())); std::vector attendees; - foreach (const KCalCore::Attendee::Ptr &ptr, e.attendees()) { - const QString &uid = ptr->customProperties().nonKDECustomProperty(CUSTOM_KOLAB_CONTACT_UUID); - Kolab::Attendee a(Kolab::ContactReference(toStdString(ptr->email()), toStdString(ptr->name()), toStdString(uid))); - a.setRSVP(ptr->RSVP()); - a.setPartStat(fromPartStat(ptr->status())); - a.setRole(fromRole(ptr->role())); - if (!ptr->delegate().isEmpty()) { + foreach (const KCalCore::Attendee &ptr, e.attendees()) { + const QString &uid = ptr.customProperties().nonKDECustomProperty(CUSTOM_KOLAB_CONTACT_UUID); + Kolab::Attendee a(Kolab::ContactReference(toStdString(ptr.email()), toStdString(ptr.name()), toStdString(uid))); + a.setRSVP(ptr.RSVP()); + a.setPartStat(fromPartStat(ptr.status())); + a.setRole(fromRole(ptr.role())); + if (!ptr.delegate().isEmpty()) { std::string name; - const std::string &email = fromMailto(QUrl(ptr->delegate()), name); + const std::string &email = fromMailto(QUrl(ptr.delegate()), name); a.setDelegatedTo(std::vector() << Kolab::ContactReference(email, name)); } - if (!ptr->delegator().isEmpty()) { + if (!ptr.delegator().isEmpty()) { std::string name; - const std::string &email = fromMailto(QUrl(ptr->delegator()), name); + const std::string &email = fromMailto(QUrl(ptr.delegator()), name); a.setDelegatedFrom(std::vector() << Kolab::ContactReference(email, name)); } - const QString &cutype = ptr->customProperties().nonKDECustomProperty(CUSTOM_KOLAB_CONTACT_CUTYPE); + const QString &cutype = ptr.customProperties().nonKDECustomProperty(CUSTOM_KOLAB_CONTACT_CUTYPE); if (!cutype.isEmpty()) { a.setCutype(static_cast(cutype.toInt())); } diff --git a/resources/kolab/pimkolab/icalendar/imip.cpp b/resources/kolab/pimkolab/icalendar/imip.cpp --- a/resources/kolab/pimkolab/icalendar/imip.cpp +++ b/resources/kolab/pimkolab/icalendar/imip.cpp @@ -146,9 +146,9 @@ QStringList ccList; const int numberOfAttendees(attendees.count()); for (int i = 0; i < numberOfAttendees; ++i) { - KCalCore::Attendee::Ptr a = attendees.at(i); + KCalCore::Attendee a = attendees.at(i); - const QString email = a->email(); + const QString email = a.email(); if (email.isEmpty()) { continue; } @@ -162,15 +162,15 @@ // Build a nice address for this attendee including the CN. QString tname, temail; - const QString username = KEmailAddress::quoteNameIfNecessary(a->name()); + const QString username = KEmailAddress::quoteNameIfNecessary(a.name()); // ignore the return value from extractEmailAddressAndName() because // it will always be false since tusername does not contain "@domain". KEmailAddress::extractEmailAddressAndName(username, temail /*byref*/, tname /*byref*/); tname += QLatin1String(" <") + email + QLatin1Char('>'); // Optional Participants and Non-Participants are copied on the email - if (a->role() == KCalCore::Attendee::OptParticipant - || a->role() == KCalCore::Attendee::NonParticipant) { + if (a.role() == KCalCore::Attendee::OptParticipant + || a.role() == KCalCore::Attendee::NonParticipant) { ccList << tname; } else { toList << tname; diff --git a/resources/kolab/pimkolab/kolabformatV2/incidence.cpp b/resources/kolab/pimkolab/kolabformatV2/incidence.cpp --- a/resources/kolab/pimkolab/kolabformatV2/incidence.cpp +++ b/resources/kolab/pimkolab/kolabformatV2/incidence.cpp @@ -843,19 +843,19 @@ // Attendees: const KCalCore::Attendee::List attendees = incidence->attendees(); - foreach (const KCalCore::Attendee::Ptr &kcalAttendee, attendees) { + foreach (const KCalCore::Attendee &kcalAttendee, attendees) { Attendee attendee; - attendee.displayName = kcalAttendee->name(); - attendee.smtpAddress = kcalAttendee->email(); - attendee.status = attendeeStatusToString(kcalAttendee->status()); - attendee.requestResponse = kcalAttendee->RSVP(); + attendee.displayName = kcalAttendee.name(); + attendee.smtpAddress = kcalAttendee.email(); + attendee.status = attendeeStatusToString(kcalAttendee.status()); + attendee.requestResponse = kcalAttendee.RSVP(); // TODO: KCalCore::Attendee::mFlag is not accessible // attendee.invitationSent = kcalAttendee->mFlag; // DF: Hmm? mFlag is set to true and never used at all.... Did you mean another field? - attendee.role = attendeeRoleToString(kcalAttendee->role()); - attendee.delegate = kcalAttendee->delegate(); - attendee.delegator = kcalAttendee->delegator(); + attendee.role = attendeeRoleToString(kcalAttendee.role()); + attendee.delegate = kcalAttendee.delegate(); + attendee.delegator = kcalAttendee.delegator(); addAttendee(attendee); } @@ -961,12 +961,12 @@ foreach (const Attendee &attendee, mAttendees) { KCalCore::Attendee::PartStat status = attendeeStringToStatus(attendee.status); KCalCore::Attendee::Role role = attendeeStringToRole(attendee.role); - KCalCore::Attendee::Ptr a(new KCalCore::Attendee(attendee.displayName, + KCalCore::Attendee a(attendee.displayName, attendee.smtpAddress, attendee.requestResponse, - status, role)); - a->setDelegate(attendee.delegate); - a->setDelegator(attendee.delegator); + status, role); + a.setDelegate(attendee.delegate); + a.setDelegator(attendee.delegator); incidence->addAttendee(a); } diff --git a/resources/openxchange/oxa/incidenceutils.cpp b/resources/openxchange/oxa/incidenceutils.cpp --- a/resources/openxchange/oxa/incidenceutils.cpp +++ b/resources/openxchange/oxa/incidenceutils.cpp @@ -48,9 +48,9 @@ QString name; QString email; - KCalCore::Attendee::Ptr attendee = incidence->attendeeByUid(uid); + KCalCore::Attendee attendee = incidence->attendeeByUid(uid); if (!user.isValid()) { - if (attendee) { + if (!attendee.isNull()) { continue; } @@ -61,23 +61,23 @@ email = user.email(); } - if (attendee) { - attendee->setName(name); - attendee->setEmail(email); + if (!attendee.isNull()) { + attendee.setName(name); + attendee.setEmail(email); } else { - attendee = KCalCore::Attendee::Ptr(new KCalCore::Attendee(name, email)); - attendee->setUid(uid); + attendee = KCalCore::Attendee(name, email); + attendee.setUid(uid); incidence->addAttendee(attendee); } const QString status = child.attribute(QStringLiteral("confirm")); if (!status.isEmpty()) { if (status == QLatin1String("accept")) { - attendee->setStatus(KCalCore::Attendee::Accepted); + attendee.setStatus(KCalCore::Attendee::Accepted); } else if (status == QLatin1String("decline")) { - attendee->setStatus(KCalCore::Attendee::Declined); + attendee.setStatus(KCalCore::Attendee::Declined); } else { - attendee->setStatus(KCalCore::Attendee::NeedsAction); + attendee.setStatus(KCalCore::Attendee::NeedsAction); } } } @@ -311,15 +311,15 @@ if (incidence->attendeeCount() > 0) { QDomElement members = DAVUtils::addOxElement(document, parent, QStringLiteral("participants")); const KCalCore::Attendee::List attendees = incidence->attendees(); - for (const KCalCore::Attendee::Ptr &attendee : attendees) { - const User user = Users::self()->lookupEmail(attendee->email()); + for (const KCalCore::Attendee &attendee : attendees) { + const User user = Users::self()->lookupEmail(attendee.email()); if (!user.isValid()) { continue; } QString status; - switch (attendee->status()) { + switch (attendee.status()) { case KCalCore::Attendee::Accepted: status = QStringLiteral("accept"); break;