Commit d04da30a authored by Volker Krause's avatar Volker Krause
Browse files

Adapt to KCalCore::Attendee changes

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D21823
parent bbd4cde2
......@@ -35,7 +35,7 @@ set(KMIME_LIB_VERSION "5.11.40")
set(KMAILTRANSPORT_LIB_VERSION "5.11.40")
set(KLDAP_LIB_VERSION "5.11.40")
set(CALENDARUTILS_LIB_VERSION "5.11.40")
set(KCALENDARCORE_LIB_VERSION "5.11.42")
set(KCALENDARCORE_LIB_VERSION "5.11.44")
set(CALENDARSUPPORT_LIB_VERSION "5.11.40")
set(LIBKDEPIM_LIB_VERSION "5.11.40")
set(EVENTVIEW_LIB_VERSION "5.11.40")
......
......@@ -40,10 +40,9 @@ void ConflictResolverTest::insertAttendees()
void ConflictResolverTest::addAttendee(const QString &email, const KCalCore::FreeBusy::Ptr &fb, KCalCore::Attendee::Role role)
{
QString name = QStringLiteral("attendee %1").arg(attendees.count());
CalendarSupport::FreeBusyItem::Ptr item(new CalendarSupport::FreeBusyItem(KCalCore::Attendee::Ptr(
new KCalCore::Attendee(name, email, false,
CalendarSupport::FreeBusyItem::Ptr item(new CalendarSupport::FreeBusyItem(KCalCore::Attendee(name, email, false,
KCalCore::Attendee::Accepted,
role)), nullptr));
role), nullptr));
item->setFreeBusy(KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(*fb.data())));
attendees << item;
}
......
......@@ -53,7 +53,7 @@ void FreeBusyGanttProxyModelTest::testModelValidity()
const QDateTime dt1(QDate(2010, 8, 24), QTime(7, 0, 0), Qt::UTC);
const QDateTime dt2(QDate(2010, 8, 24), QTime(16, 0, 0), Qt::UTC);
KCalCore::Attendee::Ptr a1(new KCalCore::Attendee(QStringLiteral("fred"), QStringLiteral("fred@example.com")));
KCalCore::Attendee a1(QStringLiteral("fred"), QStringLiteral("fred@example.com"));
KCalCore::FreeBusy::Ptr fb1(new KCalCore::FreeBusy());
fb1->addPeriod(dt1, KCalCore::Duration(60 * 60));
......@@ -64,7 +64,7 @@ void FreeBusyGanttProxyModelTest::testModelValidity()
const QDateTime dt3(QDate(2010, 8, 25), QTime(7, 0, 0), Qt::UTC);
const QDateTime dt4(QDate(2010, 8, 25), QTime(16, 0, 0), Qt::UTC);
KCalCore::Attendee::Ptr a2(new KCalCore::Attendee(QStringLiteral("joe"), QStringLiteral("joe@example.com")));
KCalCore::Attendee a2(QStringLiteral("joe"), QStringLiteral("joe@example.com"));
KCalCore::FreeBusy::Ptr fb2(new KCalCore::FreeBusy());
fb2->addPeriod(dt3, KCalCore::Duration(60 * 60));
......
......@@ -36,12 +36,9 @@ private Q_SLOTS:
KGuiItem buttonYes = KGuiItem(QStringLiteral("Send Email"));
KGuiItem buttonNo = KGuiItem(QStringLiteral("Do not send"));
KCalCore::Attendee::Ptr attendee1(new KCalCore::Attendee(QStringLiteral("test1"),
QStringLiteral("test1@example.com")));
KCalCore::Attendee::Ptr attendee2(new KCalCore::Attendee(QStringLiteral("test2"),
QStringLiteral("test2@example.com")));
KCalCore::Attendee::Ptr attendee3(new KCalCore::Attendee(QStringLiteral("test3"),
QStringLiteral("test3@example.com")));
KCalCore::Attendee attendee1(QStringLiteral("test1"), QStringLiteral("test1@example.com"));
KCalCore::Attendee attendee2(QStringLiteral("test2"), QStringLiteral("test2@example.com"));
KCalCore::Attendee attendee3(QStringLiteral("test3"), QStringLiteral("test3@example.com"));
attendees << attendee1 << attendee2 << attendee3;
......
......@@ -37,7 +37,7 @@ bool AttendeeData::isEmpty() const
return name().isEmpty() && email().isEmpty();
}
KCalCore::Attendee::Ptr AttendeeData::attendee() const
KCalCore::Attendee AttendeeData::attendee() const
{
return KCalCore::Attendee::Ptr(new KCalCore::Attendee(*this));
return KCalCore::Attendee(*this);
}
......@@ -38,7 +38,7 @@ public:
{
}
explicit AttendeeData(const KCalCore::Attendee::Ptr &attendee) : KCalCore::Attendee(*attendee)
explicit AttendeeData(const KCalCore::Attendee &attendee) : KCalCore::Attendee(attendee)
{
}
......@@ -48,7 +48,7 @@ public:
/**
* Return a copy of the attendee data
*/
Q_REQUIRED_RESULT KCalCore::Attendee::Ptr attendee() const;
Q_REQUIRED_RESULT KCalCore::Attendee attendee() const;
};
}
......
......@@ -40,7 +40,7 @@ void AttendeeEditor::slotLineAdded(KPIM::MultiplyingLine *line)
}
connect(att, qOverload<>(&AttendeeLine::changed), this, &AttendeeEditor::slotCalculateTotal);
connect(att, qOverload<const KCalCore::Attendee::Ptr &, const KCalCore::Attendee::Ptr &>(&AttendeeLine:: changed), this, &AttendeeEditor::changed);
connect(att, qOverload<const KCalCore::Attendee&, const KCalCore::Attendee&>(&AttendeeLine:: changed), this, &AttendeeEditor::changed);
connect(att, &AttendeeLine::editingFinished, this, &AttendeeEditor::editingFinished);
}
......@@ -82,7 +82,7 @@ AttendeeData::List AttendeeEditor::attendees() const
return attList;
}
void AttendeeEditor::addAttendee(const KCalCore::Attendee::Ptr &attendee)
void AttendeeEditor::addAttendee(const KCalCore::Attendee &attendee)
{
addData(AttendeeData::Ptr(new AttendeeData(attendee)));
}
......
......@@ -49,14 +49,14 @@ public:
AttendeeData::List attendees() const;
void addAttendee(const KCalCore::Attendee::Ptr &attendee);
void addAttendee(const KCalCore::Attendee &attendee);
void removeAttendee(const AttendeeData::Ptr &attendee);
void setActions(AttendeeLine::AttendeeActions actions);
Q_SIGNALS:
void countChanged(int);
void changed(const KCalCore::Attendee::Ptr &oldAttendee, const KCalCore::Attendee::Ptr &newAttendee);
void changed(const KCalCore::Attendee &oldAttendee, const KCalCore::Attendee &newAttendee);
void editingFinished(KPIM::MultiplyingLine *);
protected Q_SLOTS:
......
......@@ -271,7 +271,7 @@ void AttendeeLine::dataFromFields()
return;
}
KCalCore::Attendee::Ptr oldAttendee(mData->attendee());
KCalCore::Attendee oldAttendee(mData->attendee());
QString email, name;
KEmailAddress::extractEmailAddressAndName(mEdit->text(), email, name);
......@@ -287,7 +287,7 @@ void AttendeeLine::dataFromFields()
clearModified();
if (!(oldAttendee == mData->attendee()) && !email.isEmpty()) {
// if email is empty, we don't want to update anything
qCDebug(INCIDENCEEDITOR_LOG) << oldAttendee->email() << mData->email();
qCDebug(INCIDENCEEDITOR_LOG) << oldAttendee.email() << mData->email();
Q_EMIT changed(oldAttendee, mData->attendee());
}
}
......@@ -402,9 +402,7 @@ void AttendeeLine::aboutToBeDeleted()
return;
}
Q_EMIT changed(mData->attendee(),
KCalCore::Attendee::Ptr(new KCalCore::Attendee(QLatin1String(""),
QLatin1String(""))));
Q_EMIT changed(mData->attendee(), KCalCore::Attendee(QLatin1String(""), QLatin1String("")));
}
bool AttendeeLine::canDeleteLineEdit() const
......
......@@ -122,7 +122,7 @@ public:
Q_SIGNALS:
void changed();
void changed(const KCalCore::Attendee::Ptr &oldAttendee, const KCalCore::Attendee::Ptr &newAttendee);
void changed(const KCalCore::Attendee &oldAttendee, const KCalCore::Attendee &newAttendee);
void editingFinished(KPIM::MultiplyingLine *);
private:
......
......@@ -65,13 +65,13 @@ QVariant AttendeeTableModel::data(const QModelIndex &index, int role) const
return QVariant();
}
KCalCore::Attendee::Ptr attendee = mAttendeeList[index.row()];
const KCalCore::Attendee attendee = mAttendeeList[index.row()];
if (role == Qt::DisplayRole || role == Qt::EditRole) {
switch (index.column()) {
case Role:
return attendee->role();
return attendee.role();
case FullName:
return attendee->fullName();
return attendee.fullName();
case Available:
{
AvailableStatus available = mAttendeeAvailable[index.row()];
......@@ -93,15 +93,15 @@ QVariant AttendeeTableModel::data(const QModelIndex &index, int role) const
}
}
case Status:
return attendee->status();
return attendee.status();
case CuType:
return attendee->cuType();
return attendee.cuType();
case Response:
return attendee->RSVP();
return attendee.RSVP();
case Name:
return attendee->name();
return attendee.name();
case Email:
return attendee->email();
return attendee.email();
}
}
if (role == AttendeeRole) {
......@@ -114,23 +114,23 @@ bool AttendeeTableModel::setData(const QModelIndex &index, const QVariant &value
{
QString email, name;
if (index.isValid() && role == Qt::EditRole) {
KCalCore::Attendee::Ptr attendee = mAttendeeList[index.row()];
KCalCore::Attendee &attendee = mAttendeeList[index.row()];
switch (index.column()) {
case Role:
attendee->setRole(static_cast<KCalCore::Attendee::Role>(value.toInt()));
attendee.setRole(static_cast<KCalCore::Attendee::Role>(value.toInt()));
break;
case FullName:
if (mRemoveEmptyLines && value.toString().trimmed().isEmpty()) {
// Do not remove last empty line if mKeepEmpty==true
// (only works if initially there is only one empty line)
if (!mKeepEmpty || !(attendee->name().isEmpty() && attendee->email().isEmpty())) {
if (!mKeepEmpty || !(attendee.name().isEmpty() && attendee.email().isEmpty())) {
removeRows(index.row(), 1);
return true;
}
}
KEmailAddress::extractEmailAddressAndName(value.toString(), email, name);
attendee->setName(name);
attendee->setEmail(email);
attendee.setName(name);
attendee.setEmail(email);
addEmptyAttendee();
break;
......@@ -138,13 +138,13 @@ bool AttendeeTableModel::setData(const QModelIndex &index, const QVariant &value
mAttendeeAvailable[index.row()] = static_cast<AvailableStatus>(value.toInt());
break;
case Status:
attendee->setStatus(static_cast<KCalCore::Attendee::PartStat>(value.toInt()));
attendee.setStatus(static_cast<KCalCore::Attendee::PartStat>(value.toInt()));
break;
case CuType:
attendee->setCuType(static_cast<KCalCore::Attendee::CuType>(value.toInt()));
attendee.setCuType(static_cast<KCalCore::Attendee::CuType>(value.toInt()));
break;
case Response:
attendee->setRSVP(value.toBool());
attendee.setRSVP(value.toBool());
break;
default:
return false;
......@@ -191,7 +191,7 @@ bool AttendeeTableModel::insertRows(int position, int rows, const QModelIndex &p
beginInsertRows(parent, position, position + rows - 1);
for (int row = 0; row < rows; ++row) {
KCalCore::Attendee::Ptr attendee(new KCalCore::Attendee(QLatin1String(""), QLatin1String("")));
KCalCore::Attendee attendee(QLatin1String(""), QLatin1String(""));
mAttendeeList.insert(position, attendee);
mAttendeeAvailable.insert(mAttendeeAvailable.begin() + position, AvailableStatus{});
}
......@@ -213,7 +213,7 @@ bool AttendeeTableModel::removeRows(int position, int rows, const QModelIndex &p
return true;
}
bool AttendeeTableModel::insertAttendee(int position, const KCalCore::Attendee::Ptr &attendee)
bool AttendeeTableModel::insertAttendee(int position, const KCalCore::Attendee &attendee)
{
beginInsertRows(QModelIndex(), position, position);
mAttendeeList.insert(position, attendee);
......@@ -247,8 +247,8 @@ void AttendeeTableModel::addEmptyAttendee()
{
if (mKeepEmpty) {
bool create = true;
for (const KCalCore::Attendee::Ptr &attendee : qAsConst(mAttendeeList)) {
if (attendee->fullName().isEmpty()) {
for (const KCalCore::Attendee &attendee : qAsConst(mAttendeeList)) {
if (attendee.fullName().isEmpty()) {
create = false;
break;
}
......
......@@ -68,7 +68,7 @@ public:
Q_REQUIRED_RESULT bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex()) override;
Q_REQUIRED_RESULT bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex()) override;
Q_REQUIRED_RESULT bool insertAttendee(int position, const KCalCore::Attendee::Ptr &attendee);
Q_REQUIRED_RESULT bool insertAttendee(int position, const KCalCore::Attendee &attendee);
void setAttendees(const KCalCore::Attendee::List &resources);
Q_REQUIRED_RESULT KCalCore::Attendee::List attendees() const;
......
......@@ -66,7 +66,7 @@ ConflictResolver::ConflictResolver(QWidget *parentWidget, QObject *parent)
mCalculateTimer.setSingleShot(true);
}
void ConflictResolver::insertAttendee(const KCalCore::Attendee::Ptr &attendee)
void ConflictResolver::insertAttendee(const KCalCore::Attendee&attendee)
{
if (!mFBModel->containsAttendee(attendee)) {
mFBModel->addItem(CalendarSupport::FreeBusyItem::Ptr(new CalendarSupport::FreeBusyItem(
......@@ -81,7 +81,7 @@ void ConflictResolver::insertAttendee(const CalendarSupport::FreeBusyItem::Ptr &
}
}
void ConflictResolver::removeAttendee(const KCalCore::Attendee::Ptr &attendee)
void ConflictResolver::removeAttendee(const KCalCore::Attendee &attendee)
{
mFBModel->removeAttendee(attendee);
calculateConflicts();
......@@ -92,7 +92,7 @@ void ConflictResolver::clearAttendees()
mFBModel->clear();
}
bool ConflictResolver::containsAttendee(const KCalCore::Attendee::Ptr &attendee)
bool ConflictResolver::containsAttendee(const KCalCore::Attendee &attendee)
{
return mFBModel->containsAttendee(attendee);
}
......@@ -151,10 +151,9 @@ int ConflictResolver::tryDate(QDateTime &tryFrom, QDateTime &tryTo)
int conflicts_count = 0;
for (int i = 0; i < mFBModel->rowCount(); ++i) {
QModelIndex index = mFBModel->index(i);
KCalCore::Attendee::Ptr attendee
KCalCore::Attendee attendee
= mFBModel->data(index,
CalendarSupport::FreeBusyItemModel::AttendeeRole).value<KCalCore::
Attendee::Ptr>();
CalendarSupport::FreeBusyItemModel::AttendeeRole).value<KCalCore::Attendee>();
if (!matchesRoleConstraint(attendee)) {
continue;
}
......@@ -279,10 +278,9 @@ void ConflictResolver::findAllFreeSlots()
QList<KCalCore::FreeBusy::Ptr> filteredFBItems;
for (int i = 0; i < mFBModel->rowCount(); ++i) {
QModelIndex index = mFBModel->index(i);
KCalCore::Attendee::Ptr attendee
KCalCore::Attendee attendee
= mFBModel->data(index,
CalendarSupport::FreeBusyItemModel::AttendeeRole).value<KCalCore::
Attendee::Ptr>();
CalendarSupport::FreeBusyItemModel::AttendeeRole).value<KCalCore::Attendee>();
if (!matchesRoleConstraint(attendee)) {
continue;
}
......@@ -484,9 +482,9 @@ void ConflictResolver::setMandatoryRoles(const QSet< KCalCore::Attendee::Role >
calculateConflicts();
}
bool ConflictResolver::matchesRoleConstraint(const KCalCore::Attendee::Ptr &attendee)
bool ConflictResolver::matchesRoleConstraint(const KCalCore::Attendee &attendee)
{
return mMandatoryRoles.contains(attendee->role());
return mMandatoryRoles.contains(attendee.role());
}
KCalCore::Period::List ConflictResolver::availableSlots() const
......
......@@ -57,7 +57,7 @@ public:
* The attendees free busy info will be fetched
* and integrated into the resolver.
*/
void insertAttendee(const KCalCore::Attendee::Ptr &attendee);
void insertAttendee(const KCalCore::Attendee &attendee);
void insertAttendee(const CalendarSupport::FreeBusyItem::Ptr &freebusy);
/**
......@@ -66,7 +66,7 @@ public:
* resolving conflicts
*/
void removeAttendee(const KCalCore::Attendee::Ptr &attendee);
void removeAttendee(const KCalCore::Attendee &attendee);
/**
* Clear all attendees
......@@ -76,7 +76,7 @@ public:
/**
* Returns whether the resolver contains the attendee
*/
Q_REQUIRED_RESULT bool containsAttendee(const KCalCore::Attendee::Ptr &attendee);
Q_REQUIRED_RESULT bool containsAttendee(const KCalCore::Attendee &attendee);
/**
* Constrain the free time slot search to the weekdays
......@@ -177,7 +177,7 @@ private:
* current mandatory role constraint.
* @return true if the attendee is of one of the mandatory roles, false if not
*/
bool matchesRoleConstraint(const KCalCore::Attendee::Ptr &attendee);
bool matchesRoleConstraint(const KCalCore::Attendee &attendee);
void calculateConflicts();
......
This diff is collapsed.
......@@ -76,7 +76,7 @@ public Q_SLOTS:
private Q_SLOTS:
// cheks if row is a group, that can/should be expanded
void checkIfExpansionIsNeeded(const KCalCore::Attendee::Ptr &attendee);
void checkIfExpansionIsNeeded(const KCalCore::Attendee &attendee);
// results of the group search job
void groupSearchResult(KJob *job);
......@@ -100,7 +100,7 @@ private Q_SLOTS:
void slotFreeBusyAdded(const QModelIndex &index, int first, int last);
void slotFreeBusyChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
void updateFBStatus();
void updateFBStatus(const KCalCore::Attendee::Ptr &attendee, const KCalCore::FreeBusy::Ptr &fb);
void updateFBStatus(const KCalCore::Attendee &attendee, const KCalCore::FreeBusy::Ptr &fb);
void slotGroupSubstitutionAttendeeAdded(const QModelIndex &index, int first, int last);
void slotGroupSubstitutionAttendeeRemoved(const QModelIndex &index, int first, int last);
......
......@@ -57,7 +57,7 @@ class IncidenceDefaultsPrivate
public:
/// Members
KCalCore::Attachment::List mAttachments;
QVector<KCalCore::Attendee::Ptr> mAttendees;
QVector<KCalCore::Attendee> mAttendees;
QStringList mEmails;
QString mGroupWareDomain;
KCalCore::Incidence::Ptr mRelatedIncidence;
......@@ -67,7 +67,7 @@ public:
/// Methods
KCalCore::Person organizerAsPerson() const;
KCalCore::Attendee::Ptr organizerAsAttendee(const KCalCore::Person &organizer) const;
KCalCore::Attendee organizerAsAttendee(const KCalCore::Person &organizer) const;
void todoDefaults(const KCalCore::Todo::Ptr &todo) const;
void eventDefaults(const KCalCore::Event::Ptr &event) const;
......@@ -122,19 +122,18 @@ KCalCore::Person IncidenceDefaultsPrivate::organizerAsPerson() const
return organizer;
}
KCalCore::Attendee::Ptr IncidenceDefaultsPrivate::organizerAsAttendee(
KCalCore::Attendee IncidenceDefaultsPrivate::organizerAsAttendee(
const KCalCore::Person &organizer) const
{
KCalCore::Attendee::Ptr organizerAsAttendee(new KCalCore::Attendee(QLatin1String(
""), QLatin1String("")));
KCalCore::Attendee organizerAsAttendee;
// Really, the appropriate values (even the fall back values) should come from
// organizer. (See organizerAsPerson for more details).
organizerAsAttendee->setName(organizer.name());
organizerAsAttendee->setEmail(organizer.email());
organizerAsAttendee.setName(organizer.name());
organizerAsAttendee.setEmail(organizer.email());
// NOTE: Don't set the status to None, this value is not supported by the attendee
// editor atm.
organizerAsAttendee->setStatus(KCalCore::Attendee::Accepted);
organizerAsAttendee->setRole(KCalCore::Attendee::ReqParticipant);
organizerAsAttendee.setStatus(KCalCore::Attendee::Accepted);
organizerAsAttendee.setRole(KCalCore::Attendee::ReqParticipant);
return organizerAsAttendee;
}
......@@ -314,8 +313,7 @@ void IncidenceDefaults::setAttendees(const QStringList &attendees)
for (it = attendees.begin(); it != attendees.end(); ++it) {
QString name, email;
KContacts::Addressee::parseEmailAddress(*it, name, email);
d->mAttendees << KCalCore::Attendee::Ptr(
new KCalCore::Attendee(name, email, true, KCalCore::Attendee::NeedsAction));
d->mAttendees << KCalCore::Attendee(name, email, true, KCalCore::Attendee::NeedsAction);
}
}
......@@ -380,7 +378,7 @@ void IncidenceDefaults::setDefaults(const KCalCore::Incidence::Ptr &incidence) c
#ifdef KDEPIM_ENTERPRISE_BUILD
incidence->addAttendee(d->organizerAsAttendee(organizerAsPerson));
#endif
for (const KCalCore::Attendee::Ptr &attendee : qAsConst(d->mAttendees)) {
for (const KCalCore::Attendee &attendee : qAsConst(d->mAttendees)) {
incidence->addAttendee(attendee);
}
// Ical standard: No attendees -> must not have an organizer!
......
......@@ -580,12 +580,12 @@ void IncidenceDialogPrivate::load(const Akonadi::Item &item)
const KCalCore::Incidence::Ptr incidence = CalendarSupport::incidence(item);
const QStringList allEmails = IncidenceEditorNG::EditorConfig::instance()->allEmails();
KCalCore::Attendee::Ptr me = incidence->attendeeByMails(allEmails);
const KCalCore::Attendee me = incidence->attendeeByMails(allEmails);
if (incidence->attendeeCount() > 1 // >1 because you won't drink alone
&& me && (me->status() == KCalCore::Attendee::NeedsAction
|| me->status() == KCalCore::Attendee::Tentative
|| me->status() == KCalCore::Attendee::InProcess)) {
&& !me.isNull() && (me.status() == KCalCore::Attendee::NeedsAction
|| me.status() == KCalCore::Attendee::Tentative
|| me.status() == KCalCore::Attendee::InProcess)) {
// Show the invitation bar: "You are invited [accept] [decline]"
mUi->mInvitationBar->show();
} else {
......
......@@ -150,8 +150,8 @@ void IncidenceResource::bookResource()
}
QString name, email;
KEmailAddress::extractEmailAddressAndName(mUi->mNewResource->text(), email, name);
KCalCore::Attendee::Ptr attendee(new KCalCore::Attendee(name, email));
attendee->setCuType(KCalCore::Attendee::Resource);
KCalCore::Attendee attendee(name, email);
attendee.setCuType(KCalCore::Attendee::Resource);
dataModel->insertAttendee(dataModel->rowCount(), attendee);
}
......@@ -166,8 +166,8 @@ void IncidenceResource::dialogOkPressed()
if (item) {
const QString name = QString::fromLatin1(item->ldapObject().value(QStringLiteral("cn")));
const QString email = QString::fromLatin1(item->ldapObject().value(QStringLiteral("mail")));
KCalCore::Attendee::Ptr attendee(new KCalCore::Attendee(name, email));
attendee->setCuType(KCalCore::Attendee::Resource);
KCalCore::Attendee attendee(name, email);
attendee.setCuType(KCalCore::Attendee::Resource);
dataModel->insertAttendee(dataModel->rowCount(), attendee);
}
}
......
......@@ -51,12 +51,12 @@ void IndividualMessageQueueJob::start()
QSet<QString> attendeesCc(QSet<QString>::fromList(addressAttribute().cc()));
QStringList attendeesAutoTo, attendeesAutoCc;
for (const KCalCore::Attendee::Ptr &attendee : qAsConst(mUpdate)) {
if (attendeesTo.contains(attendee->email())) {
attendeesAutoTo.append(attendee->fullName());
for (const KCalCore::Attendee &attendee : qAsConst(mUpdate)) {
if (attendeesTo.contains(attendee.email())) {
attendeesAutoTo.append(attendee.fullName());
}
if (attendeesCc.contains(attendee->email())) {
attendeesAutoCc.append(attendee->fullName());
if (attendeesCc.contains(attendee.email())) {
attendeesAutoCc.append(attendee.fullName());
}
}
if (!attendeesAutoTo.isEmpty() || !attendeesAutoCc.isEmpty()
......@@ -65,12 +65,12 @@ void IndividualMessageQueueJob::start()
}
QStringList attendeesComposerTo, attendeesComposerCc;
for (const KCalCore::Attendee::Ptr &attendee : qAsConst(mEdit)) {
if (attendeesTo.contains(attendee->email())) {
attendeesComposerTo.append(attendee->fullName());
for (const KCalCore::Attendee &attendee : qAsConst(mEdit)) {
if (attendeesTo.contains(attendee.email())) {
attendeesComposerTo.append(attendee.fullName());
}
if (attendeesCc.contains(attendee->email())) {
attendeesComposerCc.append(attendee->fullName());
if (attendeesCc.contains(attendee.email())) {
attendeesComposerCc.append(attendee.fullName());
}
}
if (!attendeesComposerTo.isEmpty() || !attendeesComposerCc.isEmpty()) {
......@@ -200,9 +200,7 @@ void IndividualMailITIPHandlerDialogDelegate::openDialogIncidenceCreated(Recipie
if (recipient == Attendees) {
openDialog(question, mIncidence->attendees(), action, buttonYes, buttonNo);
} else {
KCalCore::Attendee::Ptr organizer(new KCalCore::Attendee(
mIncidence->organizer().name(),
mIncidence->organizer().email()));
KCalCore::Attendee organizer(mIncidence->organizer().name(), mIncidence->organizer().email());
openDialog(question, KCalCore::Attendee::List() << organizer, action, buttonYes, buttonNo);
}
}
......@@ -214,9 +212,7 @@ void IndividualMailITIPHandlerDialogDelegate::openDialogIncidenceModified(
if (recipient == Attendees) {
openDialog(question, mIncidence->attendees(), action, buttonYes, buttonNo);
} else {
KCalCore::Attendee::Ptr organizer(new KCalCore::Attendee(
mIncidence->organizer().name(),
mIncidence->organizer().email()));
KCalCore::Attendee organizer(mIncidence->organizer().name(), mIncidence->organizer().email());
openDialog(question, KCalCore::Attendee::List() << organizer, action, buttonYes, buttonNo);
}
}
......@@ -226,9 +222,7 @@ void IndividualMailITIPHandlerDialogDelegate::openDialogIncidenceDeleted(Recipie
if (recipient == Attendees) {
openDialog(question, mIncidence->attendees(), action, buttonYes, buttonNo);
} else {
KCalCore::Attendee::Ptr organizer(new KCalCore::Attendee(
mIncidence->organizer().name(),
mIncidence->organizer().email()));
KCalCore::Attendee organizer(mIncidence->organizer().name(), mIncidence->organizer().email());
openDialog(question, KCalCore::Attendee::List() << organizer, action, buttonYes, buttonNo);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment