Commit a4635c24 authored by Volker Krause's avatar Volker Krause

Adapt to KCalCore::Calendar API changes

parent 9b6f7863
......@@ -1221,7 +1221,7 @@ void CalendarView::newFloatingEvent()
bool CalendarView::addIncidence(const QString &ical)
{
KCalCore::ICalFormat format;
format.setTimeSpec(mCalendar->timeSpec());
format.setTimeZone(mCalendar->timeZone());
KCalCore::Incidence::Ptr incidence(format.fromString(ical));
return addIncidence(incidence);
}
......
......@@ -165,7 +165,7 @@ void SearchDialog::search(const QRegExp &re)
if (m_ui->eventsCheck->isChecked()) {
events =
m_calendarview->calendar()->events(
startDt, endDt, KDateTime::LocalZone, m_ui->inclusiveCheck->isChecked());
startDt, endDt, QTimeZone::systemTimeZone(), m_ui->inclusiveCheck->isChecked());
}
KCalCore::Todo::List todos;
......
......@@ -347,7 +347,7 @@ void KODayMatrix::updateEvents()
return;
}
const KCalCore::Event::List eventlist = mCalendar->events(mDays[0], mDays[NUMDAYS - 1],
mCalendar->timeSpec());
mCalendar->timeZone());
for (const KCalCore::Event::Ptr &event : eventlist) {
if (mEvents.count() == NUMDAYS) {
......
......@@ -25,6 +25,7 @@
#include <KCalCore/Event>
#include <KCalCore/MemoryCalendar>
#include <KLocale>
#include <QTimeZone>
QTEST_GUILESS_MAIN(SummaryEventTester)
......@@ -33,7 +34,7 @@ void SummaryEventTester::test_Multiday()
QDate today = QDate::currentDate();
QString multidayWithTimeInProgress = QStringLiteral("Multiday, time specified, in progress");
KCalCore::MemoryCalendar *cal = new KCalCore::MemoryCalendar(KDateTime().timeSpec());
KCalCore::MemoryCalendar *cal = new KCalCore::MemoryCalendar(QTimeZone::systemTimeZone());
KCalCore::Event::Ptr event(new KCalCore::Event());
event->setDtStart(KDateTime(today.addDays(-1)));
......@@ -179,7 +180,7 @@ void SummaryEventTester::test_eventsForRange()
QDate today = QDate::currentDate();
KCalCore::MemoryCalendar *cal = new KCalCore::MemoryCalendar(KDateTime().timeSpec());
KCalCore::MemoryCalendar *cal = new KCalCore::MemoryCalendar(QTimeZone::systemTimeZone());
KCalCore::Event::Ptr event(new KCalCore::Event());
event->setDtStart(KDateTime(today.addDays(start)));
......
......@@ -181,7 +181,7 @@ void KOrganizerPlugin::processDropEvent(QDropEvent *event)
if (KCalUtils::ICalDrag::canDecode(event->mimeData())) {
KCalCore::MemoryCalendar::Ptr cal(
new KCalCore::MemoryCalendar(KDateTime::LocalZone));
new KCalCore::MemoryCalendar(QTimeZone::systemTimeZone()));
if (KCalUtils::ICalDrag::fromMimeData(event->mimeData(), cal)) {
KCalCore::Incidence::List incidences = cal->incidences();
Q_ASSERT(incidences.count());
......
......@@ -190,7 +190,7 @@ void TodoPlugin::processDropEvent(QDropEvent *event)
}
if (KCalUtils::ICalDrag::canDecode(event->mimeData())) {
KCalCore::MemoryCalendar::Ptr cal(new KCalCore::MemoryCalendar(KDateTime::LocalZone));
KCalCore::MemoryCalendar::Ptr cal(new KCalCore::MemoryCalendar(QTimeZone::systemTimeZone()));
if (KCalUtils::ICalDrag::fromMimeData(event->mimeData(), cal)) {
KCalCore::Incidence::List incidences = cal->incidences();
Q_ASSERT(incidences.count());
......
......@@ -272,7 +272,7 @@ void SDSummaryWidget::createLabels()
for (dt = QDate::currentDate();
dt <= QDate::currentDate().addDays(mDaysAhead - 1);
dt = dt.addDays(1)) {
const KCalCore::Event::List events = mCalendar->events(dt, mCalendar->timeSpec(),
const KCalCore::Event::List events = mCalendar->events(dt, mCalendar->timeZone(),
KCalCore::EventSortStartDate,
KCalCore::SortDirectionAscending);
for (const KCalCore::Event::Ptr &ev : events) {
......
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