Commit 5c572587 authored by Volker Krause's avatar Volker Krause
Browse files

Adapt to KCalendarCore namespace change

parent 559079d3
......@@ -21,9 +21,9 @@
#include "conflictresolvertest.h"
#include "conflictresolver.h"
#include <KCalCore/Event>
#include <KCalCore/Period>
#include <KCalCore/Duration>
#include <KCalendarCore/Event>
#include <KCalendarCore/Period>
#include <KCalendarCore/Duration>
#include <QWidget>
#include <QTest>
......@@ -37,13 +37,13 @@ void ConflictResolverTest::insertAttendees()
}
}
void ConflictResolverTest::addAttendee(const QString &email, const KCalCore::FreeBusy::Ptr &fb, KCalCore::Attendee::Role role)
void ConflictResolverTest::addAttendee(const QString &email, const KCalendarCore::FreeBusy::Ptr &fb, KCalendarCore::Attendee::Role role)
{
QString name = QStringLiteral("attendee %1").arg(attendees.count());
CalendarSupport::FreeBusyItem::Ptr item(new CalendarSupport::FreeBusyItem(KCalCore::Attendee(name, email, false,
KCalCore::Attendee::Accepted,
CalendarSupport::FreeBusyItem::Ptr item(new CalendarSupport::FreeBusyItem(KCalendarCore::Attendee(name, email, false,
KCalendarCore::Attendee::Accepted,
role), nullptr));
item->setFreeBusy(KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(*fb.data())));
item->setFreeBusy(KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(*fb.data())));
attendees << item;
}
......@@ -69,9 +69,9 @@ void ConflictResolverTest::cleanup()
void ConflictResolverTest::simpleTest()
{
KCalCore::Period meeting(end.addSecs(-3 * 60 * 60), KCalCore::Duration(2 * 60 * 60));
KCalendarCore::Period meeting(end.addSecs(-3 * 60 * 60), KCalendarCore::Duration(2 * 60 * 60));
addAttendee(QStringLiteral("albert@einstein.net"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List()
<< meeting)));
insertAttendees();
......@@ -84,11 +84,11 @@ void ConflictResolverTest::simpleTest()
QVERIFY(resolver->availableSlots().size() == 2);
KCalCore::Period first = resolver->availableSlots().at(0);
KCalendarCore::Period first = resolver->availableSlots().at(0);
QCOMPARE(first.start(), base);
QCOMPARE(first.end(), meeting.start());
KCalCore::Period second = resolver->availableSlots().at(1);
KCalendarCore::Period second = resolver->availableSlots().at(1);
QEXPECT_FAIL("", "Got broken in revision f17b9a8c975588ad7cf4ce8b94ab8e32ac193ed8", Continue);
QCOMPARE(second.start(), meeting.end().addSecs(resolution)); //add 15 minutes because the
//free block doesn't start until
......@@ -98,17 +98,17 @@ void ConflictResolverTest::simpleTest()
void ConflictResolverTest::stillPrettySimpleTest()
{
KCalCore::Period meeting1(base, KCalCore::Duration(2 * 60 * 60));
KCalCore::Period meeting2(base.addSecs(60 * 60), KCalCore::Duration(2 * 60 * 60));
KCalCore::Period meeting3(end.addSecs(-3 * 60 * 60), KCalCore::Duration(2 * 60 * 60));
KCalendarCore::Period meeting1(base, KCalendarCore::Duration(2 * 60 * 60));
KCalendarCore::Period meeting2(base.addSecs(60 * 60), KCalendarCore::Duration(2 * 60 * 60));
KCalendarCore::Period meeting3(end.addSecs(-3 * 60 * 60), KCalendarCore::Duration(2 * 60 * 60));
addAttendee(QStringLiteral("john.f@kennedy.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List()
<< meeting1 << meeting3)));
addAttendee(QStringLiteral("elvis@rock.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List()
<< meeting2 << meeting3)));
addAttendee(QStringLiteral("albert@einstein.net"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List()
<< meeting3)));
insertAttendees();
......@@ -121,12 +121,12 @@ void ConflictResolverTest::stillPrettySimpleTest()
QVERIFY(resolver->availableSlots().size() == 2);
KCalCore::Period first = resolver->availableSlots().at(0);
KCalendarCore::Period first = resolver->availableSlots().at(0);
QEXPECT_FAIL("", "Got broken in revision f17b9a8c975588ad7cf4ce8b94ab8e32ac193ed8", Continue);
QCOMPARE(first.start(), meeting2.end().addSecs(resolution));
QCOMPARE(first.end(), meeting3.start());
KCalCore::Period second = resolver->availableSlots().at(1);
KCalendarCore::Period second = resolver->availableSlots().at(1);
QEXPECT_FAIL("", "Got broken in revision f17b9a8c975588ad7cf4ce8b94ab8e32ac193ed8", Continue);
QCOMPARE(second.start(), meeting3.end().addSecs(resolution)); //add 15 minutes because the
//free block doesn't start until
......@@ -143,67 +143,67 @@ void ConflictResolverTest::akademy2010()
// first event was at 9:30, so lets align our start time there
base.setTime(QTime(9, 30));
end = base.addSecs(8 * 60 * 60);
KCalCore::Period opening(_time(9, 30), _time(9, 45));
KCalCore::Period keynote(_time(9, 45), _time(10, 30));
KCalendarCore::Period opening(_time(9, 30), _time(9, 45));
KCalendarCore::Period keynote(_time(9, 45), _time(10, 30));
KCalCore::Period sevenPrinciples(_time(10, 30), _time(11, 15));
KCalCore::Period commAsService(_time(10, 30), _time(11, 15));
KCalendarCore::Period sevenPrinciples(_time(10, 30), _time(11, 15));
KCalendarCore::Period commAsService(_time(10, 30), _time(11, 15));
KCalCore::Period kdeForums(_time(11, 15), _time(11, 45));
KCalCore::Period oviStore(_time(11, 15), _time(11, 45));
KCalendarCore::Period kdeForums(_time(11, 15), _time(11, 45));
KCalendarCore::Period oviStore(_time(11, 15), _time(11, 45));
// 10 min break
KCalCore::Period highlights(_time(12, 0), _time(12, 45));
KCalCore::Period styles(_time(12, 0), _time(12, 45));
KCalendarCore::Period highlights(_time(12, 0), _time(12, 45));
KCalendarCore::Period styles(_time(12, 0), _time(12, 45));
KCalCore::Period wikimedia(_time(12, 45), _time(13, 15));
KCalCore::Period avalanche(_time(12, 45), _time(13, 15));
KCalendarCore::Period wikimedia(_time(12, 45), _time(13, 15));
KCalendarCore::Period avalanche(_time(12, 45), _time(13, 15));
KCalCore::Period pimp(_time(13, 15), _time(13, 45));
KCalCore::Period direction(_time(13, 15), _time(13, 45));
KCalendarCore::Period pimp(_time(13, 15), _time(13, 45));
KCalendarCore::Period direction(_time(13, 15), _time(13, 45));
// lunch 1 hr 25 min lunch
KCalCore::Period blurr(_time(15, 15), _time(16, 00));
KCalCore::Period plasma(_time(15, 15), _time(16, 00));
KCalendarCore::Period blurr(_time(15, 15), _time(16, 00));
KCalendarCore::Period plasma(_time(15, 15), _time(16, 00));
// for ( int i = 1; i < 80; ++i ) {
// adds 80 people (adds the same 8 peopl 10 times)
addAttendee(QStringLiteral("akademyattendee1@email.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List()
<< opening << keynote
<< oviStore << wikimedia
<< direction)));
addAttendee(QStringLiteral("akademyattendee2@email.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List()
<< opening << keynote
<< commAsService << highlights
<< pimp)));
addAttendee(QStringLiteral("akademyattendee3@email.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List()
<< opening << kdeForums
<< styles << pimp << plasma)));
addAttendee(QStringLiteral("akademyattendee4@email.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List()
<< opening << keynote
<< oviStore << pimp << blurr)));
addAttendee(QStringLiteral("akademyattendee5@email.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List()
<< keynote << oviStore
<< highlights << avalanche)));
addAttendee(QStringLiteral("akademyattendee6@email.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List()
<< opening << keynote
<< commAsService
<< highlights)));
addAttendee(QStringLiteral("akademyattendee7@email.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List()
<< opening << kdeForums
<< styles << avalanche
<< pimp << plasma)));
addAttendee(QStringLiteral("akademyattendee8@email.com"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List()
<< opening << keynote
<< oviStore << wikimedia
<< blurr)));
......@@ -222,9 +222,9 @@ void ConflictResolverTest::akademy2010()
QVERIFY(resolver->availableSlots().size() == 3);
QEXPECT_FAIL("", "Got broken in revision f17b9a8c975588ad7cf4ce8b94ab8e32ac193ed8", Abort);
QCOMPARE(resolver->availableSlots().at(0).duration(),
KCalCore::Duration(10 * 60));
KCalendarCore::Duration(10 * 60));
QCOMPARE(resolver->availableSlots().at(1).duration(),
KCalCore::Duration(1 * 60 * 60 + 25 * 60));
KCalendarCore::Duration(1 * 60 * 60 + 25 * 60));
QVERIFY(resolver->availableSlots().at(2).start() > plasma.end());
}
......@@ -236,13 +236,13 @@ void ConflictResolverTest::testPeriodIsLargerThenTimeframe()
end.setDate(QDate(2010, 7, 29));
end.setTime(QTime(8, 30));
KCalCore::Period testEvent(_time(5, 45), _time(8, 45));
KCalendarCore::Period testEvent(_time(5, 45), _time(8, 45));
addAttendee(QStringLiteral("kdabtest1@demo.kolab.org"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List()
<< testEvent)));
addAttendee(QStringLiteral("kdabtest2@demo.kolab.org"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List())));
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List())));
insertAttendees();
resolver->setEarliestDateTime(base);
......@@ -260,13 +260,13 @@ void ConflictResolverTest::testPeriodBeginsBeforeTimeframeBegins()
end.setDate(QDate(2010, 7, 29));
end.setTime(QTime(9, 30));
KCalCore::Period testEvent(_time(5, 45), _time(8, 45));
KCalendarCore::Period testEvent(_time(5, 45), _time(8, 45));
addAttendee(QStringLiteral("kdabtest1@demo.kolab.org"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List()
<< testEvent)));
addAttendee(QStringLiteral("kdabtest2@demo.kolab.org"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List())));
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List())));
insertAttendees();
resolver->setEarliestDateTime(base);
......@@ -274,7 +274,7 @@ void ConflictResolverTest::testPeriodBeginsBeforeTimeframeBegins()
resolver->findAllFreeSlots();
QCOMPARE(resolver->availableSlots().size(), 1);
KCalCore::Period freeslot = resolver->availableSlots().at(0);
KCalendarCore::Period freeslot = resolver->availableSlots().at(0);
QCOMPARE(freeslot.start(), _time(8, 45));
QCOMPARE(freeslot.end(), end);
}
......@@ -287,13 +287,13 @@ void ConflictResolverTest::testPeriodEndsAfterTimeframeEnds()
end.setDate(QDate(2010, 7, 29));
end.setTime(QTime(9, 30));
KCalCore::Period testEvent(_time(8, 00), _time(9, 45));
KCalendarCore::Period testEvent(_time(8, 00), _time(9, 45));
addAttendee(QStringLiteral("kdabtest1@demo.kolab.org"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List()
<< testEvent)));
addAttendee(QStringLiteral("kdabtest2@demo.kolab.org"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List())));
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List())));
insertAttendees();
resolver->setEarliestDateTime(base);
......@@ -301,8 +301,8 @@ void ConflictResolverTest::testPeriodEndsAfterTimeframeEnds()
resolver->findAllFreeSlots();
QCOMPARE(resolver->availableSlots().size(), 1);
KCalCore::Period freeslot = resolver->availableSlots().at(0);
QCOMPARE(freeslot.duration(), KCalCore::Duration(30 * 60));
KCalendarCore::Period freeslot = resolver->availableSlots().at(0);
QCOMPARE(freeslot.duration(), KCalendarCore::Duration(30 * 60));
QCOMPARE(freeslot.start(), base);
QCOMPARE(freeslot.end(), _time(8, 00));
}
......@@ -315,13 +315,13 @@ void ConflictResolverTest::testPeriodEndsAtSametimeAsTimeframe()
end.setDate(QDate(2010, 7, 29));
end.setTime(QTime(8, 45));
KCalCore::Period testEvent(_time(5, 45), _time(8, 45));
KCalendarCore::Period testEvent(_time(5, 45), _time(8, 45));
addAttendee(QStringLiteral("kdabtest1@demo.kolab.org"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List()
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List()
<< testEvent)));
addAttendee(QStringLiteral("kdabtest2@demo.kolab.org"),
KCalCore::FreeBusy::Ptr(new KCalCore::FreeBusy(KCalCore::Period::List())));
KCalendarCore::FreeBusy::Ptr(new KCalendarCore::FreeBusy(KCalendarCore::Period::List())));
insertAttendees();
resolver->setEarliestDateTime(base);
......
......@@ -23,8 +23,8 @@
#include "CalendarSupport/FreeBusyItem"
#include <KCalCore/FreeBusy>
#include <KCalCore/Attendee>
#include <KCalendarCore/FreeBusy>
#include <KCalendarCore/Attendee>
#include <QObject>
......@@ -49,7 +49,7 @@ private Q_SLOTS:
private:
void insertAttendees();
void addAttendee(const QString &email, const KCalCore::FreeBusy::Ptr &fb, KCalCore::Attendee::Role role = KCalCore::Attendee::ReqParticipant);
void addAttendee(const QString &email, const KCalendarCore::FreeBusy::Ptr &fb, KCalendarCore::Attendee::Role role = KCalendarCore::Attendee::ReqParticipant);
QList<CalendarSupport::FreeBusyItem::Ptr> attendees;
QWidget *parent;
IncidenceEditorNG::ConflictResolver *resolver;
......
......@@ -26,7 +26,7 @@
#include <CalendarSupport/FreeBusyItemModel>
#include <KGantt/KGanttGraphicsView>
#include <KCalCore/Attendee>
#include <KCalendarCore/Attendee>
#include <QTest>
#include <QStandardPaths>
......@@ -53,22 +53,22 @@ 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 a1(QStringLiteral("fred"), QStringLiteral("fred@example.com"));
KCalCore::FreeBusy::Ptr fb1(new KCalCore::FreeBusy());
KCalendarCore::Attendee a1(QStringLiteral("fred"), QStringLiteral("fred@example.com"));
KCalendarCore::FreeBusy::Ptr fb1(new KCalendarCore::FreeBusy());
fb1->addPeriod(dt1, KCalCore::Duration(60 * 60));
fb1->addPeriod(dt2, KCalCore::Duration(60 * 60));
fb1->addPeriod(dt1, KCalendarCore::Duration(60 * 60));
fb1->addPeriod(dt2, KCalendarCore::Duration(60 * 60));
CalendarSupport::FreeBusyItem::Ptr item1(new CalendarSupport::FreeBusyItem(a1, nullptr));
item1->setFreeBusy(fb1);
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 a2(QStringLiteral("joe"), QStringLiteral("joe@example.com"));
KCalCore::FreeBusy::Ptr fb2(new KCalCore::FreeBusy());
KCalendarCore::Attendee a2(QStringLiteral("joe"), QStringLiteral("joe@example.com"));
KCalendarCore::FreeBusy::Ptr fb2(new KCalendarCore::FreeBusy());
fb2->addPeriod(dt3, KCalCore::Duration(60 * 60));
fb2->addPeriod(dt4, KCalCore::Duration(60 * 60));
fb2->addPeriod(dt3, KCalendarCore::Duration(60 * 60));
fb2->addPeriod(dt4, KCalendarCore::Duration(60 * 60));
CalendarSupport::FreeBusyItem::Ptr item2(new CalendarSupport::FreeBusyItem(a2, nullptr));
item2->setFreeBusy(fb2);
......
......@@ -32,13 +32,13 @@ class TestIndividualMailDialog : public QObject
private Q_SLOTS:
void testDialog()
{
KCalCore::Attendee::List attendees;
KCalendarCore::Attendee::List attendees;
KGuiItem buttonYes = KGuiItem(QStringLiteral("Send Email"));
KGuiItem buttonNo = KGuiItem(QStringLiteral("Do not send"));
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"));
KCalendarCore::Attendee attendee1(QStringLiteral("test1"), QStringLiteral("test1@example.com"));
KCalendarCore::Attendee attendee2(QStringLiteral("test2"), QStringLiteral("test2@example.com"));
KCalendarCore::Attendee attendee3(QStringLiteral("test3"), QStringLiteral("test3@example.com"));
attendees << attendee1 << attendee2 << attendee3;
......
......@@ -30,7 +30,7 @@
using namespace IncidenceEditorNG;
AlarmDialog::AlarmDialog(KCalCore::Incidence::IncidenceType incidenceType, QWidget *parent)
AlarmDialog::AlarmDialog(KCalendarCore::Incidence::IncidenceType incidenceType, QWidget *parent)
: QDialog(parent)
, mUi(new Ui::AlarmDialog)
, mIncidenceType(incidenceType)
......@@ -75,7 +75,7 @@ AlarmDialog::~AlarmDialog()
delete mUi;
}
void AlarmDialog::load(const KCalCore::Alarm::Ptr &alarm)
void AlarmDialog::load(const KCalendarCore::Alarm::Ptr &alarm)
{
if (!alarm) {
return;
......@@ -126,25 +126,25 @@ void AlarmDialog::load(const KCalCore::Alarm::Ptr &alarm)
int id = 0;
switch (alarm->type()) {
case KCalCore::Alarm::Audio:
case KCalendarCore::Alarm::Audio:
mUi->mTypeCombo->setCurrentIndex(1);
mUi->mSoundFile->setUrl(QUrl::fromLocalFile(alarm->audioFile()));
id = 1;
break;
case KCalCore::Alarm::Procedure:
case KCalendarCore::Alarm::Procedure:
mUi->mTypeCombo->setCurrentIndex(2);
mUi->mApplication->setUrl(QUrl::fromLocalFile(alarm->programFile()));
mUi->mAppArguments->setText(alarm->programArguments());
id = 2;
break;
case KCalCore::Alarm::Email:
case KCalendarCore::Alarm::Email:
{
mUi->mTypeCombo->setCurrentIndex(3);
KCalCore::Person::List addresses = alarm->mailAddresses();
KCalendarCore::Person::List addresses = alarm->mailAddresses();
QStringList add;
add.reserve(addresses.count());
const KCalCore::Person::List::ConstIterator end(addresses.constEnd());
for (KCalCore::Person::List::ConstIterator it = addresses.constBegin();
const KCalendarCore::Person::List::ConstIterator end(addresses.constEnd());
for (KCalendarCore::Person::List::ConstIterator it = addresses.constBegin();
it != end; ++it) {
add << (*it).fullName();
}
......@@ -153,8 +153,8 @@ void AlarmDialog::load(const KCalCore::Alarm::Ptr &alarm)
id = 3;
break;
}
case KCalCore::Alarm::Display:
case KCalCore::Alarm::Invalid:
case KCalendarCore::Alarm::Display:
case KCalendarCore::Alarm::Invalid:
default:
mUi->mTypeCombo->setCurrentIndex(0);
mUi->mDisplayText->setPlainText(alarm->text());
......@@ -168,7 +168,7 @@ void AlarmDialog::load(const KCalCore::Alarm::Ptr &alarm)
}
}
void AlarmDialog::save(const KCalCore::Alarm::Ptr &alarm) const
void AlarmDialog::save(const KCalendarCore::Alarm::Ptr &alarm) const
{
// Offsets
int offset = mUi->mAlarmOffset->value() * 60; // minutes
......@@ -197,11 +197,11 @@ void AlarmDialog::save(const KCalCore::Alarm::Ptr &alarm) const
// We assume that if mAllowBeginReminders is not set, that mAllowBeginReminders
// is set.
if (!mAllowBeginReminders) { // before or after DTDUE
alarm->setEndOffset(KCalCore::Duration(offset));
alarm->setEndOffset(KCalendarCore::Duration(offset));
} else if (beforeafterpos == 0 || beforeafterpos == 1) { // before or after DTSTART
alarm->setStartOffset(KCalCore::Duration(offset));
alarm->setStartOffset(KCalendarCore::Duration(offset));
} else if (beforeafterpos == 2 || beforeafterpos == 3) { // before or after DTEND/DTDUE
alarm->setEndOffset(KCalCore::Duration(offset));
alarm->setEndOffset(KCalendarCore::Duration(offset));
}
// Repeating
......@@ -219,10 +219,10 @@ void AlarmDialog::save(const KCalCore::Alarm::Ptr &alarm) const
mUi->mAppArguments->text());
} else if (mUi->mTypeCombo->currentIndex() == 3) { // Email
QStringList addresses = KEmailAddress::splitAddressList(mUi->mEmailAddress->text());
KCalCore::Person::List add;
KCalendarCore::Person::List add;
add.reserve(addresses.count());
for (QStringList::Iterator it = addresses.begin(), end = addresses.end(); it != end; ++it) {
add << KCalCore::Person::fromFullName(*it);
add << KCalendarCore::Person::fromFullName(*it);
}
// TODO: Add a subject line and possibilities for attachments
alarm->setEmailAlarm(QString(), mUi->mEmailText->toPlainText(), add);
......@@ -235,7 +235,7 @@ void AlarmDialog::fillCombo()
{
QStringList items;
if (mIncidenceType == KCalCore::Incidence::TypeTodo) {
if (mIncidenceType == KCalendarCore::Incidence::TypeTodo) {
mUi->mBeforeAfter->clear();
if (mAllowBeginReminders) {
......
......@@ -21,7 +21,7 @@
#ifndef INCIDENCEEDITOR_ALARMDIALOG_H
#define INCIDENCEEDITOR_ALARMDIALOG_H
#include <KCalCore/Incidence>
#include <KCalendarCore/Incidence>
#include <QDialog>
......@@ -52,10 +52,10 @@ public:
Constructs a new alarm dialog.
@p incidenceType will influence i18n strings, that will be different for to-dos.
*/
explicit AlarmDialog(KCalCore::Incidence::IncidenceType incidenceType, QWidget *parent = nullptr);
explicit AlarmDialog(KCalendarCore::Incidence::IncidenceType incidenceType, QWidget *parent = nullptr);
~AlarmDialog();
void load(const KCalCore::Alarm::Ptr &alarm);
void save(const KCalCore::Alarm::Ptr &alarm) const;
void load(const KCalendarCore::Alarm::Ptr &alarm);
void save(const KCalendarCore::Alarm::Ptr &alarm) const;
void setAllowBeginReminders(bool allow);
void setAllowEndReminders(bool allow);
void setOffset(int offset);
......@@ -67,7 +67,7 @@ private:
private:
Ui::AlarmDialog *mUi = nullptr;
KCalCore::Incidence::IncidenceType mIncidenceType;
KCalendarCore::Incidence::IncidenceType mIncidenceType;
bool mAllowBeginReminders;
bool mAllowEndReminders;
};
......
......@@ -22,22 +22,22 @@
#include <CalendarSupport/KCalPrefs>
#include <KCalCore/Alarm>
#include <KCalendarCore/Alarm>
#include <KLocalizedString>
#include "incidenceeditor_debug.h"
using namespace CalendarSupport;
using namespace KCalCore;
using namespace KCalendarCore;
namespace IncidenceEditorNG {
namespace AlarmPresets {
// Don't use a map, because order matters
Q_GLOBAL_STATIC(QStringList, sBeforeStartPresetNames)
Q_GLOBAL_STATIC(QStringList, sBeforeEndPresetNames)
Q_GLOBAL_STATIC(QList<KCalCore::Alarm::Ptr>, sBeforeStartPresets)
Q_GLOBAL_STATIC(QList<KCalCore::Alarm::Ptr>, sBeforeEndPresets)
Q_GLOBAL_STATIC(QList<KCalendarCore::Alarm::Ptr>, sBeforeStartPresets)
Q_GLOBAL_STATIC(QList<KCalendarCore::Alarm::Ptr>, sBeforeEndPresets)
static int sDefaultPresetIndex = 0;
static int sDefaultAlarmOffset = 0; // We must save it, so we can detect that config changed.
......@@ -93,8 +93,8 @@ void initPresets(AlarmPresets::When when)
case AlarmPresets::BeforeStart:
for (int i = 0; i < hardcodedPresets.count(); ++i) {
KCalCore::Alarm::Ptr alarm(new KCalCore::Alarm(nullptr));
alarm->setType(KCalCore::Alarm::Display);
KCalendarCore::Alarm::Ptr alarm(new KCalendarCore::Alarm(nullptr));
alarm->setType(KCalendarCore::Alarm::Display);
const int minutes = hardcodedPresets[i];
alarm->setStartOffset(-minutes * 60);
alarm->setEnabled(true);
......@@ -121,8 +121,8 @@ void initPresets(AlarmPresets::When when)
case AlarmPresets::BeforeEnd:
for (int i = 0; i < hardcodedPresets.count(); ++i) {
KCalCore::Alarm::Ptr alarm(new KCalCore::Alarm(nullptr));
alarm->setType(KCalCore::Alarm::Display);
KCalendarCore::Alarm::Ptr alarm(new KCalendarCore::Alarm(nullptr));
alarm->setType(KCalendarCore::Alarm::Display);
const int minutes = hardcodedPresets[i];
alarm->setEndOffset(-minutes * 60);
alarm->setEnabled(true);
......@@ -185,7 +185,7 @@ QStringList availablePresets(AlarmPresets::When when)
return QStringList();
}
KCalCore::Alarm::Ptr preset(When when, const QString &name)
KCalendarCore::Alarm::Ptr preset(When when, const QString &name)
{
checkInitNeeded(when);
......@@ -202,18 +202,18 @@ KCalCore::Alarm::Ptr preset(When when, const QString &name)
Q_ASSERT_X(false, "preset", "Number of presets should be one");
}
return KCalCore::Alarm::Ptr(
new KCalCore::Alarm(*sBeforeStartPresets->at(sBeforeStartPresetNames->indexOf(name))));
return KCalendarCore::Alarm::Ptr(
new KCalendarCore::Alarm(*sBeforeStartPresets->at(sBeforeStartPresetNames->indexOf(name))));
case AlarmPresets::BeforeEnd:
Q_ASSERT(sBeforeEndPresetNames->count(name) == 1); // The name should exists and only once
return KCalCore::Alarm::Ptr(
new KCalCore::Alarm(*sBeforeEndPresets->at(sBeforeEndPresetNames->indexOf(name))));
return KCalendarCore::Alarm::Ptr(
new KCalendarCore::Alarm(*sBeforeEndPresets->at(sBeforeEndPresetNames->indexOf(name))));
}
return KCalCore::Alarm::Ptr();
return KCalendarCore::Alarm::Ptr();
}
KCalCore::Alarm::Ptr defaultAlarm(When when)
KCalendarCore::Alarm::Ptr defaultAlarm(When when)
{
checkInitNeeded(when);
......@@ -226,13 +226,13 @@ KCalCore::Alarm::Ptr defaultAlarm(When when)