Commit 587898fa authored by Laurent Montel's avatar Laurent Montel
Browse files

Make compile without deprecated methods

parent 8281eef0
Pipeline #249899 passed with stage
in 8 minutes and 58 seconds
......@@ -213,7 +213,11 @@ void IncidenceAttendee::save(const KCalendarCore::Incidence::Ptr &incidence)
i18nc("@title:window", "Invalid Email Address"),
KGuiItem(i18nc("@action:button", "Invite"), QStringLiteral("dialog-ok")),
KGuiItem(i18nc("@action:button", "Do Not Invite"), QStringLiteral("dialog-cancel")))
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
!= KMessageBox::ButtonCode::PrimaryAction) {
#else
!= KMessageBox::Yes) {
#endif
skip = true;
}
}
......@@ -793,7 +797,11 @@ void IncidenceAttendee::slotOrganizerChanged(const QString &newOrganizer)
KGuiItem(i18nc("@action:button", "Change Attendee"), QStringLiteral("dialog-ok")),
KGuiItem(i18nc("@action:button", "Do Not Change"), QStringLiteral("dialog-cancel")));
} else {
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
answer = KMessageBox::ButtonCode::PrimaryAction;
#else
answer = KMessageBox::Yes;
#endif
}
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
......
......@@ -11,6 +11,7 @@
#include <CalendarSupport/KCalPrefs>
#include <KMessageBox>
#include <kwidgetsaddons_version.h>
#include <QDBusConnection>
#include <QDBusConnectionInterface>
......@@ -156,19 +157,35 @@ void IndividualMailITIPHandlerDialogDelegate::openDialog(const QString &question
switch (action) {
case ActionSendMessage:
Q_EMIT setUpdate(mIncidence, attendees);
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
Q_EMIT dialogClosed(KMessageBox::ButtonCode::PrimaryAction, mMethod, mIncidence);
#else
Q_EMIT dialogClosed(KMessageBox::Yes, mMethod, mIncidence);
#endif
break;
case ActionDontSendMessage:
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
Q_EMIT dialogClosed(KMessageBox::ButtonCode::SecondaryAction, mMethod, mIncidence);
#else
Q_EMIT dialogClosed(KMessageBox::No, mMethod, mIncidence);
#endif
break;
default:
switch (CalendarSupport::KCalPrefs::instance()->sendPolicy()) {
case (CalendarSupport::KCalPrefs::InvitationPolicySend):
Q_EMIT setUpdate(mIncidence, attendees);
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
Q_EMIT dialogClosed(KMessageBox::ButtonCode::PrimaryAction, mMethod, mIncidence);
#else
Q_EMIT dialogClosed(KMessageBox::Yes, mMethod, mIncidence);
#endif
break;
case (CalendarSupport::KCalPrefs::InvitationPolicyDontSend):
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
Q_EMIT dialogClosed(KMessageBox::ButtonCode::SecondaryAction, mMethod, mIncidence);
#else
Q_EMIT dialogClosed(KMessageBox::No, mMethod, mIncidence);
#endif
break;
case (CalendarSupport::KCalPrefs::InvitationPolicyAsk):
default:
......@@ -230,9 +247,17 @@ void IndividualMailITIPHandlerDialogDelegate::onDialogClosed(int result)
if (result == QDialogButtonBox::Yes) {
Q_EMIT setEdit(mIncidence, mDialog->editAttendees());
Q_EMIT setUpdate(mIncidence, mDialog->updateAttendees());
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
Q_EMIT dialogClosed(KMessageBox::ButtonCode::PrimaryAction, mMethod, mIncidence);
#else
Q_EMIT dialogClosed(KMessageBox::Yes, mMethod, mIncidence);
#endif
} else {
#if KWIDGETSADDONS_VERSION >= QT_VERSION_CHECK(5, 100, 0)
Q_EMIT dialogClosed(KMessageBox::ButtonCode::SecondaryAction, mMethod, mIncidence);
#else
Q_EMIT dialogClosed(KMessageBox::No, mMethod, mIncidence);
#endif
}
}
......
Supports Markdown
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