diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ set(QT_REQUIRED_VERSION "5.11.0") set(KMIME_LIB_VERSION "5.11.80") set(CALENDARUTILS_LIB_VERSION "5.11.80") -set(KCALENDARCORE_LIB_VERSION "5.11.80") +set(KCALENDARCORE_LIB_VERSION "5.11.90") set(IDENTITYMANAGEMENT_LIB_VERSION "5.11.80") set(AKONADICALENDAR_LIB_VERSION "5.11.80") set(PIMCOMMON_LIB_VERSION "5.11.80") diff --git a/src/attachmenthandler.h b/src/attachmenthandler.h --- a/src/attachmenthandler.h +++ b/src/attachmenthandler.h @@ -26,9 +26,9 @@ #ifndef CALENDARSUPPORT_ATTACHMENTHANDLER_H #define CALENDARSUPPORT_ATTACHMENTHANDLER_H -#include -#include -#include +#include +#include +#include #include @@ -62,8 +62,8 @@ * @param incidence is a pointer to a valid Incidence object containing the attachment. * @return a pointer to the Attachment object located; 0 if no such attachment could be found. */ - KCalCore::Attachment find(const QString &attachmentName, - const KCalCore::Incidence::Ptr &incidence); + KCalendarCore::Attachment find(const QString &attachmentName, + const KCalendarCore::Incidence::Ptr &incidence); /** * Finds the attachment in the user's calendar, by @p attachmentName and a scheduler message; @@ -73,16 +73,16 @@ * @param message is a pointer to a valid ScheduleMessage object containing the attachment. * @return a pointer to the Attachment object located; 0 if no such attachment could be found. */ - KCalCore::Attachment find(const QString &attachmentName, - const KCalCore::ScheduleMessage::Ptr &message); + KCalendarCore::Attachment find(const QString &attachmentName, + const KCalendarCore::ScheduleMessage::Ptr &message); /** * Launches a viewer on the specified attachment. * * @param attachment is a pointer to a valid Attachment object. * @return true if the viewer program successfully launched; false otherwise. */ - bool view(const KCalCore::Attachment &attachment); + bool view(const KCalendarCore::Attachment &attachment); /** * Launches a viewer on the specified attachment. @@ -92,7 +92,7 @@ * @return true if the attachment could be found and the viewer program successfully launched; * false otherwise. */ - bool view(const QString &attachmentName, const KCalCore::Incidence::Ptr &incidence); + bool view(const QString &attachmentName, const KCalendarCore::Incidence::Ptr &incidence); /** Launches a viewer on the specified attachment. @@ -115,16 +115,16 @@ @return true if the attachment could be found and the viewer program successfully launched; false otherwise. */ - bool view(const QString &attachmentName, const KCalCore::ScheduleMessage::Ptr &message); + bool view(const QString &attachmentName, const KCalendarCore::ScheduleMessage::Ptr &message); /** Saves the specified attachment to a file of the user's choice. @param attachment is a pointer to a valid Attachment object. @return true if the save operation was successful; false otherwise. */ - bool saveAs(const KCalCore::Attachment &attachment); + bool saveAs(const KCalendarCore::Attachment &attachment); /** Saves the specified attachment to a file of the user's choice. @@ -135,7 +135,7 @@ @return true if the attachment could be found and the save operation was successful; false otherwise. */ - bool saveAs(const QString &attachmentName, const KCalCore::Incidence::Ptr &incidence); + bool saveAs(const QString &attachmentName, const KCalendarCore::Incidence::Ptr &incidence); /** Saves the specified attachment to a file of the user's choice. @@ -157,7 +157,7 @@ @return true if the attachment could be found and the save operation was successful; false otherwise. */ - bool saveAs(const QString &attachmentName, const KCalCore::ScheduleMessage::Ptr &message); + bool saveAs(const QString &attachmentName, const KCalendarCore::ScheduleMessage::Ptr &message); Q_SIGNALS: void viewFinished(const QString &uid, const QString &attachmentName, bool success); diff --git a/src/attachmenthandler.cpp b/src/attachmenthandler.cpp --- a/src/attachmenthandler.cpp +++ b/src/attachmenthandler.cpp @@ -49,7 +49,7 @@ #include #include -using namespace KCalCore; +using namespace KCalendarCore; using namespace Akonadi; namespace CalendarSupport { diff --git a/src/calendarsingleton.cpp b/src/calendarsingleton.cpp --- a/src/calendarsingleton.cpp +++ b/src/calendarsingleton.cpp @@ -24,7 +24,7 @@ #include "kcalprefs.h" #include -#include +#include /** * Singleton is implemented through qApp parenting because we can't rely on K_GLOBAL_STATIC. @@ -39,7 +39,7 @@ if (!calendar && createIfNull) { calendar = Akonadi::ETMCalendar::Ptr(new Akonadi::ETMCalendar()); calendar->setCollectionFilteringEnabled(false); - calendar->setOwner(KCalCore::Person(KCalPrefs::instance()->fullName(), KCalPrefs::instance()->email())); + calendar->setOwner(KCalendarCore::Person(KCalPrefs::instance()->fullName(), KCalPrefs::instance()->email())); } return calendar; diff --git a/src/calendarutils.cpp b/src/calendarutils.cpp --- a/src/calendarutils.cpp +++ b/src/calendarutils.cpp @@ -28,16 +28,16 @@ #include "calendarutils.h" #include "utils.h" -#include +#include #include #include #include #include #include "calendarsupport_debug.h" using namespace CalendarSupport; -using namespace KCalCore; +using namespace KCalendarCore; /// CalendarUtilsPrivate @@ -68,7 +68,7 @@ Akonadi::IncidenceChanger::ResultCode resultCode, const QString &errorString); - bool purgeCompletedSubTodos(const KCalCore::Todo::Ptr &todo, bool &allPurged); + bool purgeCompletedSubTodos(const KCalendarCore::Todo::Ptr &todo, bool &allPurged); /// Members Akonadi::ETMCalendar::Ptr mCalendar; @@ -133,7 +133,7 @@ } } -bool CalendarUtilsPrivate::purgeCompletedSubTodos(const KCalCore::Todo::Ptr &todo, bool &allPurged) +bool CalendarUtilsPrivate::purgeCompletedSubTodos(const KCalendarCore::Todo::Ptr &todo, bool &allPurged) { if (!todo) { return true; @@ -144,7 +144,7 @@ for (const Akonadi::Item &item : subTodos) { if (CalendarSupport::hasTodo(item)) { deleteThisTodo - &= purgeCompletedSubTodos(item.payload(), allPurged); + &= purgeCompletedSubTodos(item.payload(), allPurged); } } @@ -240,17 +240,17 @@ Q_D(CalendarUtils); bool allDeleted = true; // startMultiModify( i18n( "Purging completed to-dos" ) ); - KCalCore::Todo::List todos = calendar()->rawTodos(); - KCalCore::Todo::List rootTodos; + KCalendarCore::Todo::List todos = calendar()->rawTodos(); + KCalendarCore::Todo::List rootTodos; - for (const KCalCore::Todo::Ptr &todo : qAsConst(todos)) { + for (const KCalendarCore::Todo::Ptr &todo : qAsConst(todos)) { if (todo && todo->relatedTo().isEmpty()) { // top level todo //REVIEW(AKONADI_PORT) rootTodos.append(todo); } } // now that we have a list of all root todos, check them and their children - for (const KCalCore::Todo::Ptr &todo : qAsConst(rootTodos)) { + for (const KCalendarCore::Todo::Ptr &todo : qAsConst(rootTodos)) { d->purgeCompletedSubTodos(todo, allDeleted); } diff --git a/src/eventarchiver.h b/src/eventarchiver.h --- a/src/eventarchiver.h +++ b/src/eventarchiver.h @@ -28,8 +28,8 @@ #include #include -#include -#include +#include +#include #include @@ -90,7 +90,7 @@ void archiveIncidences(const Akonadi::ETMCalendar::Ptr &calendar, Akonadi::IncidenceChanger *changer, const QDate &limitDate, - QWidget *widget, const KCalCore::Incidence::List &incidences, + QWidget *widget, const KCalendarCore::Incidence::List &incidences, bool withGUI); /** @@ -101,7 +101,7 @@ * @param checkedUids used internaly to prevent infinit recursion due to invalid calendar files */ bool isSubTreeComplete(const Akonadi::ETMCalendar::Ptr &calendar, - const KCalCore::Todo::Ptr &todo, const QDate &limitDate, + const KCalendarCore::Todo::Ptr &todo, const QDate &limitDate, QStringList checkedUids = QStringList()) const; }; } diff --git a/src/eventarchiver.cpp b/src/eventarchiver.cpp --- a/src/eventarchiver.cpp +++ b/src/eventarchiver.cpp @@ -29,9 +29,9 @@ #include -#include -#include -#include +#include +#include +#include #include @@ -46,7 +46,7 @@ #include #include -using namespace KCalCore; +using namespace KCalendarCore; using namespace KCalUtils; using namespace CalendarSupport; @@ -112,9 +112,9 @@ GroupwareScoppedDisabler disabler(changer); // Disables groupware communication temporarily // We need to use rawEvents, otherwise events hidden by filters will not be archived. - KCalCore::Event::List events; - KCalCore::Todo::List todos; - KCalCore::Journal::List journals; + KCalendarCore::Event::List events; + KCalendarCore::Todo::List todos; + KCalendarCore::Journal::List journals; if (KCalPrefs::instance()->mArchiveEvents) { events = calendar->rawEvents( @@ -125,17 +125,17 @@ true); } if (KCalPrefs::instance()->mArchiveTodos) { - const KCalCore::Todo::List rawTodos = calendar->rawTodos(); + const KCalendarCore::Todo::List rawTodos = calendar->rawTodos(); - for (const KCalCore::Todo::Ptr &todo : rawTodos) { + for (const KCalendarCore::Todo::Ptr &todo : rawTodos) { Q_ASSERT(todo); if (isSubTreeComplete(calendar, todo, limitDate)) { todos.append(todo); } } } - const KCalCore::Incidence::List incidences = calendar->mergeIncidenceList(events, todos, + const KCalendarCore::Incidence::List incidences = calendar->mergeIncidenceList(events, todos, journals); qCDebug(CALENDARSUPPORT_LOG) << "archiving incidences before" << limitDate @@ -194,7 +194,7 @@ void EventArchiver::archiveIncidences(const Akonadi::ETMCalendar::Ptr &calendar, Akonadi::IncidenceChanger *changer, const QDate &limitDate, - QWidget *widget, const KCalCore::Incidence::List &incidences, + QWidget *widget, const KCalendarCore::Incidence::List &incidences, bool withGUI) { Q_UNUSED(limitDate); @@ -237,10 +237,10 @@ QStringList uids; Incidence::List allIncidences = archiveCalendar->rawIncidences(); uids.reserve(incidences.count()); - for (const KCalCore::Incidence::Ptr &incidence : qAsConst(incidences)) { + for (const KCalendarCore::Incidence::Ptr &incidence : qAsConst(incidences)) { uids.append(incidence->uid()); } - for (const KCalCore::Incidence::Ptr &incidence : qAsConst(allIncidences)) { + for (const KCalendarCore::Incidence::Ptr &incidence : qAsConst(allIncidences)) { if (!uids.contains(incidence->uid())) { archiveCalendar->deleteIncidence(incidence); } @@ -337,9 +337,9 @@ } checkedUids.append(todo->uid()); - const KCalCore::Incidence::List childs = calendar->childIncidences(todo->uid()); - for (const KCalCore::Incidence::Ptr &incidence : childs) { - const Todo::Ptr t = incidence.dynamicCast(); + const KCalendarCore::Incidence::List childs = calendar->childIncidences(todo->uid()); + for (const KCalendarCore::Incidence::Ptr &incidence : childs) { + const Todo::Ptr t = incidence.dynamicCast(); if (t && !isSubTreeComplete(calendar, t, limitDate, checkedUids)) { return false; } diff --git a/src/freebusymodel/autotests/testfreebusyitemmodel.cpp b/src/freebusymodel/autotests/testfreebusyitemmodel.cpp --- a/src/freebusymodel/autotests/testfreebusyitemmodel.cpp +++ b/src/freebusymodel/autotests/testfreebusyitemmodel.cpp @@ -23,7 +23,7 @@ #include "../freebusyitemmodel.h" #include "../freebusyitem.h" -#include +#include #include @@ -42,11 +42,11 @@ const QDateTime dt1(QDate(2010, 7, 24), QTime(7, 0, 0), Qt::UTC); const QDateTime dt2(QDate(2010, 7, 24), QTime(10, 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)); FreeBusyItem::Ptr item1(new FreeBusyItem(a1, nullptr)); item1->setFreeBusy(fb1); @@ -58,9 +58,9 @@ QModelIndex i = model->index(0, 0); QCOMPARE(a1.fullName(), model->data(i, Qt::DisplayRole).toString()); QCOMPARE(a1, - model->data(i, FreeBusyItemModel::AttendeeRole).value()); + model->data(i, FreeBusyItemModel::AttendeeRole).value()); QCOMPARE(item1->freeBusy(), - model->data(i, FreeBusyItemModel::FreeBusyRole).value()); + model->data(i, FreeBusyItemModel::FreeBusyRole).value()); QCOMPARE(model->rowCount(i), 2); @@ -96,23 +96,23 @@ const QDateTime dt3(QDate(2010, 7, 24), QTime(12, 0, 0), Qt::UTC); const QDateTime dt4(QDate(2010, 7, 24), QTime(14, 0, 0), Qt::UTC); - KCalCore::Attendee a1(QStringLiteral("fred"), QStringLiteral( "fred@example.com")); - KCalCore::Attendee a2(QStringLiteral("joe"), QStringLiteral( "joe@example.com")); - KCalCore::Attendee a3(QStringLiteral("max"), QStringLiteral( "max@example.com")); - KCalCore::FreeBusy::Ptr fb1(new KCalCore::FreeBusy()); - KCalCore::FreeBusy::Ptr fb2(new KCalCore::FreeBusy()); - KCalCore::FreeBusy::Ptr fb3(new KCalCore::FreeBusy()); + KCalendarCore::Attendee a1(QStringLiteral("fred"), QStringLiteral( "fred@example.com")); + KCalendarCore::Attendee a2(QStringLiteral("joe"), QStringLiteral( "joe@example.com")); + KCalendarCore::Attendee a3(QStringLiteral("max"), QStringLiteral( "max@example.com")); + KCalendarCore::FreeBusy::Ptr fb1(new KCalendarCore::FreeBusy()); + KCalendarCore::FreeBusy::Ptr fb2(new KCalendarCore::FreeBusy()); + KCalendarCore::FreeBusy::Ptr fb3(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)); - fb2->addPeriod(dt1, KCalCore::Duration(60 * 60)); - fb2->addPeriod(dt2, KCalCore::Duration(60 * 60)); - fb2->addPeriod(dt3, KCalCore::Duration(60 * 60)); + fb2->addPeriod(dt1, KCalendarCore::Duration(60 * 60)); + fb2->addPeriod(dt2, KCalendarCore::Duration(60 * 60)); + fb2->addPeriod(dt3, KCalendarCore::Duration(60 * 60)); - fb3->addPeriod(dt1, KCalCore::Duration(60 * 60)); - fb3->addPeriod(dt2, KCalCore::Duration(60 * 60)); - fb3->addPeriod(dt4, KCalCore::Duration(60 * 60 * 2)); + fb3->addPeriod(dt1, KCalendarCore::Duration(60 * 60)); + fb3->addPeriod(dt2, KCalendarCore::Duration(60 * 60)); + fb3->addPeriod(dt4, KCalendarCore::Duration(60 * 60 * 2)); FreeBusyItem::Ptr item1(new FreeBusyItem(a1, nullptr)); item1->setFreeBusy(fb1); @@ -132,60 +132,60 @@ QModelIndex i1 = model->index(0, 0); QCOMPARE(a1.fullName(), model->data(i1, Qt::DisplayRole).toString()); QCOMPARE(a1, - model->data(i1, FreeBusyItemModel::AttendeeRole).value()); + model->data(i1, FreeBusyItemModel::AttendeeRole).value()); QCOMPARE(item1->freeBusy(), - model->data(i1, FreeBusyItemModel::FreeBusyRole).value()); + model->data(i1, FreeBusyItemModel::FreeBusyRole).value()); QModelIndex i2 = model->index(1, 0); QCOMPARE(a2.fullName(), model->data(i2, Qt::DisplayRole).toString()); QCOMPARE(a2, - model->data(i2, FreeBusyItemModel::AttendeeRole).value()); + model->data(i2, FreeBusyItemModel::AttendeeRole).value()); QVERIFY(model->rowCount(i2) == 0); QVERIFY(model->data(i2, FreeBusyItemModel::FreeBusyRole).isValid() == false); QModelIndex i3 = model->index(2, 0); QCOMPARE(a3.fullName(), model->data(i3, Qt::DisplayRole).toString()); QCOMPARE(a3, - model->data(i3, FreeBusyItemModel::AttendeeRole).value()); + model->data(i3, FreeBusyItemModel::AttendeeRole).value()); QVERIFY(model->rowCount(i3) == 0); QVERIFY(model->data(i3, FreeBusyItemModel::FreeBusyRole).isValid() == false); model->slotInsertFreeBusy(fb2, QStringLiteral("joe@example.com")); QCOMPARE(item2->freeBusy(), - model->data(i2, FreeBusyItemModel::FreeBusyRole).value()); + model->data(i2, FreeBusyItemModel::FreeBusyRole).value()); QVERIFY(model->rowCount(i2) == fb2->fullBusyPeriods().size()); QModelIndex i2_0 = model->index(0, 0, i2); QCOMPARE(fb2->fullBusyPeriods().first(), model->data( - i2_0, FreeBusyItemModel::FreeBusyPeriodRole).value()); + i2_0, FreeBusyItemModel::FreeBusyPeriodRole).value()); QModelIndex i2_1 = model->index(1, 0, i2); QCOMPARE(fb2->fullBusyPeriods().at(1), model->data( - i2_1, FreeBusyItemModel::FreeBusyPeriodRole).value()); + i2_1, FreeBusyItemModel::FreeBusyPeriodRole).value()); QModelIndex i2_2 = model->index(2, 0, i2); QCOMPARE(fb2->fullBusyPeriods().last(), model->data( - i2_2, FreeBusyItemModel::FreeBusyPeriodRole).value()); + i2_2, FreeBusyItemModel::FreeBusyPeriodRole).value()); model->slotInsertFreeBusy(fb3, QStringLiteral("max@example.com")); QCOMPARE(item3->freeBusy(), - model->data(i3, FreeBusyItemModel::FreeBusyRole).value()); + model->data(i3, FreeBusyItemModel::FreeBusyRole).value()); QVERIFY(model->rowCount(i3) == fb3->fullBusyPeriods().size()); QModelIndex i3_0 = model->index(0, 0, i3); QCOMPARE(fb3->fullBusyPeriods().first(), model->data( - i3_0, FreeBusyItemModel::FreeBusyPeriodRole).value()); + i3_0, FreeBusyItemModel::FreeBusyPeriodRole).value()); QModelIndex i3_1 = model->index(1, 0, i3); QCOMPARE(fb3->fullBusyPeriods().at(1), model->data( - i3_1, FreeBusyItemModel::FreeBusyPeriodRole).value()); + i3_1, FreeBusyItemModel::FreeBusyPeriodRole).value()); QModelIndex i3_2 = model->index(2, 0, i3); QCOMPARE(fb3->fullBusyPeriods().last(), model->data( - i3_2, FreeBusyItemModel::FreeBusyPeriodRole).value()); + i3_2, FreeBusyItemModel::FreeBusyPeriodRole).value()); model->removeAttendee(a2); @@ -198,15 +198,15 @@ i3_0 = model->index(0, 0, i3); QCOMPARE(fb3->fullBusyPeriods().first(), model->data( - i3_0, FreeBusyItemModel::FreeBusyPeriodRole).value()); + i3_0, FreeBusyItemModel::FreeBusyPeriodRole).value()); i3_1 = model->index(1, 0, i3); QCOMPARE(fb3->fullBusyPeriods().at(1), model->data( - i3_1, FreeBusyItemModel::FreeBusyPeriodRole).value()); + i3_1, FreeBusyItemModel::FreeBusyPeriodRole).value()); i3_2 = model->index(2, 0, i3); QCOMPARE(fb3->fullBusyPeriods().last(), model->data( - i3_2, FreeBusyItemModel::FreeBusyPeriodRole).value()); + i3_2, FreeBusyItemModel::FreeBusyPeriodRole).value()); } void FreeBusyItemModelTest::testInsertFreeBusy() @@ -216,18 +216,18 @@ const QDateTime dt1(QDate(2010, 7, 24), QTime(7, 0, 0), Qt::UTC); const QDateTime dt2(QDate(2010, 7, 24), QTime(10, 0, 0), Qt::UTC); - KCalCore::Attendee a1(QStringLiteral("fred"), QStringLiteral( "fred@example.com")); - KCalCore::FreeBusy::Ptr fb1(new KCalCore::FreeBusy()); - fb1->addPeriod(dt1, KCalCore::Duration(60 * 60)); - fb1->addPeriod(dt2, KCalCore::Duration(60 * 60)); + KCalendarCore::Attendee a1(QStringLiteral("fred"), QStringLiteral( "fred@example.com")); + KCalendarCore::FreeBusy::Ptr fb1(new KCalendarCore::FreeBusy()); + fb1->addPeriod(dt1, KCalendarCore::Duration(60 * 60)); + fb1->addPeriod(dt2, KCalendarCore::Duration(60 * 60)); const QDateTime dt3(QDate(2010, 7, 24), QTime(12, 0, 0), Qt::UTC); const QDateTime dt4(QDate(2010, 7, 24), QTime(14, 0, 0), Qt::UTC); - KCalCore::FreeBusy::Ptr fb2(new KCalCore::FreeBusy()); - fb2->addPeriod(dt1, KCalCore::Duration(60 * 60)); - fb2->addPeriod(dt2, KCalCore::Duration(60 * 60)); - fb2->addPeriod(dt3, KCalCore::Duration(60 * 60)); - fb2->addPeriod(dt4, KCalCore::Duration(60 * 60 * 2)); + KCalendarCore::FreeBusy::Ptr fb2(new KCalendarCore::FreeBusy()); + fb2->addPeriod(dt1, KCalendarCore::Duration(60 * 60)); + fb2->addPeriod(dt2, KCalendarCore::Duration(60 * 60)); + fb2->addPeriod(dt3, KCalendarCore::Duration(60 * 60)); + fb2->addPeriod(dt4, KCalendarCore::Duration(60 * 60 * 2)); FreeBusyItem::Ptr item1(new FreeBusyItem(a1, nullptr)); item1->setFreeBusy(fb1); diff --git a/src/freebusymodel/autotests/testfreeperiodmodel.cpp b/src/freebusymodel/autotests/testfreeperiodmodel.cpp --- a/src/freebusymodel/autotests/testfreeperiodmodel.cpp +++ b/src/freebusymodel/autotests/testfreeperiodmodel.cpp @@ -22,8 +22,8 @@ #include "modeltest.h" #include "../freeperiodmodel.h" -#include -#include +#include +#include #include @@ -41,10 +41,10 @@ const QDateTime dt1(QDate(2010, 7, 24), QTime(7, 0, 0), Qt::UTC); const QDateTime dt2(QDate(2010, 7, 24), QTime(10, 0, 0), Qt::UTC); - KCalCore::Period::List list; + KCalendarCore::Period::List list; - list << KCalCore::Period(dt1, KCalCore::Duration(60 * 60)); - list << KCalCore::Period(dt2, KCalCore::Duration(60 * 60)); + list << KCalendarCore::Period(dt1, KCalendarCore::Duration(60 * 60)); + list << KCalendarCore::Period(dt2, KCalendarCore::Duration(60 * 60)); QCOMPARE(model->rowCount(), 0); model->slotNewFreePeriods(list); @@ -59,10 +59,10 @@ const QDateTime startDt(QDate(2010, 7, 24), QTime(8, 0, 0), Qt::UTC); const QDateTime endDt(QDate(2010, 7, 25), QTime(8, 0, 0), Qt::UTC); - KCalCore::Period::List list; + KCalendarCore::Period::List list; // This period goes from 8am on the 24th to 8am on the 25th - list << KCalCore::Period(startDt, endDt); + list << KCalendarCore::Period(startDt, endDt); QCOMPARE(model->rowCount(), 0); @@ -75,11 +75,11 @@ const QDateTime startPeriod2(QDate(2010, 7, 25), QTime(0, 0, 0, 0), Qt::UTC); QModelIndex index = model->index(0, 0); - KCalCore::Period period1 - = model->data(index, FreePeriodModel::PeriodRole).value(); + KCalendarCore::Period period1 + = model->data(index, FreePeriodModel::PeriodRole).value(); index = model->index(1, 0); - KCalCore::Period period2 - = model->data(index, FreePeriodModel::PeriodRole).value(); + KCalendarCore::Period period2 + = model->data(index, FreePeriodModel::PeriodRole).value(); QCOMPARE(period1.start(), startDt); QCOMPARE(period1.end(), endPeriod1); diff --git a/src/freebusymodel/freebusycalendar.h b/src/freebusymodel/freebusycalendar.h --- a/src/freebusymodel/freebusycalendar.h +++ b/src/freebusymodel/freebusycalendar.h @@ -26,8 +26,8 @@ #include "freebusyitemmodel.h" -#include -#include +#include +#include namespace CalendarSupport { class FreeBusyCalendarPrivate; @@ -41,7 +41,7 @@ void setModel(FreeBusyItemModel *model); FreeBusyItemModel *model() const; - KCalCore::Calendar::Ptr calendar() const; + KCalendarCore::Calendar::Ptr calendar() const; private: void onRowsChanged(const QModelIndex &, const QModelIndex &); diff --git a/src/freebusymodel/freebusycalendar.cpp b/src/freebusymodel/freebusycalendar.cpp --- a/src/freebusymodel/freebusycalendar.cpp +++ b/src/freebusymodel/freebusycalendar.cpp @@ -22,10 +22,10 @@ #include "freebusycalendar.h" #include "calendarsupport_debug.h" -#include -#include -#include -#include +#include +#include +#include +#include #include @@ -41,16 +41,16 @@ } FreeBusyItemModel *mModel = nullptr; - KCalCore::Calendar::Ptr mCalendar; - QMap mFbEvent; + KCalendarCore::Calendar::Ptr mCalendar; + QMap mFbEvent; }; FreeBusyCalendar::FreeBusyCalendar(QObject *parent) : QObject(parent) , d(new CalendarSupport::FreeBusyCalendarPrivate) { d->mCalendar - = KCalCore::Calendar::Ptr(new KCalCore::MemoryCalendar(QTimeZone::systemTimeZone())); + = KCalendarCore::Calendar::Ptr(new KCalendarCore::MemoryCalendar(QTimeZone::systemTimeZone())); qCDebug(CALENDARSUPPORT_LOG) << "creating" << this; } @@ -60,7 +60,7 @@ delete d; } -KCalCore::Calendar::Ptr FreeBusyCalendar::calendar() const +KCalendarCore::Calendar::Ptr FreeBusyCalendar::calendar() const { return d->mCalendar; } @@ -92,8 +92,8 @@ void FreeBusyCalendar::deleteAllEvents() { - const KCalCore::Event::List lstEvents = d->mCalendar->events(); - for (const KCalCore::Event::Ptr &event : lstEvents) { + const KCalendarCore::Event::List lstEvents = d->mCalendar->events(); + for (const KCalendarCore::Event::Ptr &event : lstEvents) { d->mCalendar->deleteEvent(event); } } @@ -118,32 +118,32 @@ for (int i = first; i <= last; ++i) { QModelIndex index = d->mModel->index(i, 0, parent); - const KCalCore::FreeBusyPeriod &period = d->mModel->data(index, + const KCalendarCore::FreeBusyPeriod &period = d->mModel->data(index, FreeBusyItemModel::FreeBusyPeriodRole) - .value(); - const KCalCore::FreeBusy::Ptr &fb + .value(); + const KCalendarCore::FreeBusy::Ptr &fb = d->mModel->data(parent, - FreeBusyItemModel::FreeBusyRole).value(); + FreeBusyItemModel::FreeBusyRole).value(); - KCalCore::Event::Ptr inc = KCalCore::Event::Ptr(new KCalCore::Event()); + KCalendarCore::Event::Ptr inc = KCalendarCore::Event::Ptr(new KCalendarCore::Event()); inc->setDtStart(period.start()); inc->setDtEnd(period.end()); inc->setUid(QLatin1String("fb-") + fb->uid() + QLatin1String("-") + QString::number(i)); inc->setCustomProperty("FREEBUSY", "STATUS", QString::number(period.type())); QString summary = period.summary(); if (summary.isEmpty()) { switch (period.type()) { - case KCalCore::FreeBusyPeriod::Free: + case KCalendarCore::FreeBusyPeriod::Free: summary = i18n("Free"); break; - case KCalCore::FreeBusyPeriod::Busy: + case KCalendarCore::FreeBusyPeriod::Busy: summary = i18n("Busy"); break; - case KCalCore::FreeBusyPeriod::BusyUnavailable: + case KCalendarCore::FreeBusyPeriod::BusyUnavailable: summary = i18n("Unavailable"); break; - case KCalCore::FreeBusyPeriod::BusyTentative: + case KCalendarCore::FreeBusyPeriod::BusyTentative: summary = i18n("Tentative"); break; default: @@ -167,7 +167,7 @@ } else { for (int i = first; i <= last; ++i) { QModelIndex index = d->mModel->index(i, 0, parent); - KCalCore::Event::Ptr inc = d->mFbEvent.take(index); + KCalendarCore::Event::Ptr inc = d->mFbEvent.take(index); d->mCalendar->deleteEvent(inc); } } @@ -180,7 +180,7 @@ } for (int i = topLeft.row(); i <= bottomRight.row(); ++i) { QModelIndex index = d->mModel->index(i, 0, topLeft.parent()); - KCalCore::Event::Ptr inc = d->mFbEvent.value(index); + KCalendarCore::Event::Ptr inc = d->mFbEvent.value(index); d->mCalendar->beginChange(inc); d->mCalendar->endChange(inc); } diff --git a/src/freebusymodel/freebusyitem.h b/src/freebusymodel/freebusyitem.h --- a/src/freebusymodel/freebusyitem.h +++ b/src/freebusymodel/freebusyitem.h @@ -25,7 +25,7 @@ #include "calendarsupport_export.h" -#include +#include namespace CalendarSupport { /** @@ -39,14 +39,14 @@ /** * @param parentWidget is passed to Akonadi when fetching free/busy data. */ - FreeBusyItem(const KCalCore::Attendee &attendee, QWidget *parentWidget); + FreeBusyItem(const KCalendarCore::Attendee &attendee, QWidget *parentWidget); ~FreeBusyItem() { } - KCalCore::Attendee attendee() const; - void setFreeBusy(const KCalCore::FreeBusy::Ptr &fb); - KCalCore::FreeBusy::Ptr freeBusy() const; + KCalendarCore::Attendee attendee() const; + void setFreeBusy(const KCalendarCore::FreeBusy::Ptr &fb); + KCalendarCore::FreeBusy::Ptr freeBusy() const; Q_REQUIRED_RESULT QString email() const; void setUpdateTimerID(int id); @@ -57,12 +57,12 @@ Q_REQUIRED_RESULT bool isDownloading() const; Q_SIGNALS: - void attendeeChanged(const KCalCore::Attendee &attendee); - void freebusyChanged(const KCalCore::FreeBusy::Ptr fb); + void attendeeChanged(const KCalendarCore::Attendee &attendee); + void freebusyChanged(const KCalendarCore::FreeBusy::Ptr fb); private: - KCalCore::Attendee mAttendee; - KCalCore::FreeBusy::Ptr mFreeBusy; + KCalendarCore::Attendee mAttendee; + KCalendarCore::FreeBusy::Ptr mFreeBusy; // This is used for the update timer int mTimerID; diff --git a/src/freebusymodel/freebusyitem.cpp b/src/freebusymodel/freebusyitem.cpp --- a/src/freebusymodel/freebusyitem.cpp +++ b/src/freebusymodel/freebusyitem.cpp @@ -26,28 +26,28 @@ using namespace CalendarSupport; -FreeBusyItem::FreeBusyItem(const KCalCore::Attendee &attendee, QWidget *parentWidget) +FreeBusyItem::FreeBusyItem(const KCalendarCore::Attendee &attendee, QWidget *parentWidget) : mAttendee(attendee) , mTimerID(0) , mIsDownloading(false) , mParentWidget(parentWidget) { Q_ASSERT(!attendee.isNull()); - setFreeBusy(KCalCore::FreeBusy::Ptr()); + setFreeBusy(KCalendarCore::FreeBusy::Ptr()); } -KCalCore::Attendee FreeBusyItem::attendee() const +KCalendarCore::Attendee FreeBusyItem::attendee() const { return mAttendee; } -void FreeBusyItem::setFreeBusy(const KCalCore::FreeBusy::Ptr &fb) +void FreeBusyItem::setFreeBusy(const KCalendarCore::FreeBusy::Ptr &fb) { mFreeBusy = fb; mIsDownloading = false; } -KCalCore::FreeBusy::Ptr FreeBusyItem::freeBusy() const +KCalendarCore::FreeBusy::Ptr FreeBusyItem::freeBusy() const { return mFreeBusy; } diff --git a/src/freebusymodel/freebusyitemmodel.h b/src/freebusymodel/freebusyitemmodel.h --- a/src/freebusymodel/freebusyitemmodel.h +++ b/src/freebusymodel/freebusyitemmodel.h @@ -64,11 +64,11 @@ void addItem(const FreeBusyItem::Ptr &freebusy); void clear(); - void removeAttendee(const KCalCore::Attendee &attendee); + void removeAttendee(const KCalendarCore::Attendee &attendee); void removeItem(const FreeBusyItem::Ptr &freebusy); void removeRow(int row); - Q_REQUIRED_RESULT bool containsAttendee(const KCalCore::Attendee &attendee); + Q_REQUIRED_RESULT bool containsAttendee(const KCalendarCore::Attendee &attendee); /** * Queues a reload of free/busy data. @@ -88,16 +88,16 @@ void reload(); public Q_SLOTS: - void slotInsertFreeBusy(const KCalCore::FreeBusy::Ptr &fb, const QString &email); + void slotInsertFreeBusy(const KCalendarCore::FreeBusy::Ptr &fb, const QString &email); protected: void timerEvent(QTimerEvent *) override; private: // Only download FB if the auto-download option is set in config void autoReload(); - void setFreeBusyPeriods(const QModelIndex &parent, const KCalCore::FreeBusyPeriod::List &list); + void setFreeBusyPeriods(const QModelIndex &parent, const KCalendarCore::FreeBusyPeriod::List &list); void updateFreeBusyData(const FreeBusyItem::Ptr &); FreeBusyItemModelPrivate *const d; diff --git a/src/freebusymodel/freebusyitemmodel.cpp b/src/freebusymodel/freebusyitemmodel.cpp --- a/src/freebusymodel/freebusyitemmodel.cpp +++ b/src/freebusymodel/freebusyitemmodel.cpp @@ -103,9 +103,9 @@ : QAbstractItemModel(parent) , d(new CalendarSupport::FreeBusyItemModelPrivate) { - qRegisterMetaType(); - qRegisterMetaType("KCalCore::FreeBusy::Ptr"); - qRegisterMetaType("KCalCore::Period"); + qRegisterMetaType(); + qRegisterMetaType("KCalendarCore::FreeBusy::Ptr"); + qRegisterMetaType("KCalendarCore::Period"); Akonadi::FreeBusyManager *m = Akonadi::FreeBusyManager::self(); connect(m, &Akonadi::FreeBusyManager::freeBusyRetrieved, this, @@ -157,7 +157,7 @@ return QVariant(); } - KCalCore::FreeBusyPeriod period = fbitem->freeBusy()->fullBusyPeriods().at(index.row()); + KCalendarCore::FreeBusyPeriod period = fbitem->freeBusy()->fullBusyPeriods().at(index.row()); switch (role) { case Qt::DisplayRole: // return something to make modeltest happy return QStringLiteral("%1 - %2"). @@ -253,7 +253,7 @@ } void FreeBusyItemModel::setFreeBusyPeriods(const QModelIndex &parent, - const KCalCore::FreeBusyPeriod::List &list) + const KCalendarCore::FreeBusyPeriod::List &list) { if (!parent.isValid()) { return; @@ -317,7 +317,7 @@ } } -void FreeBusyItemModel::removeAttendee(const KCalCore::Attendee &attendee) +void FreeBusyItemModel::removeAttendee(const KCalendarCore::Attendee &attendee) { FreeBusyItem::Ptr anItem; for (int i = 0; i < d->mFreeBusyItems.count(); ++i) { @@ -332,7 +332,7 @@ } } -bool FreeBusyItemModel::containsAttendee(const KCalCore::Attendee &attendee) +bool FreeBusyItemModel::containsAttendee(const KCalendarCore::Attendee &attendee) { FreeBusyItem::Ptr anItem; for (int i = 0; i < d->mFreeBusyItems.count(); ++i) { @@ -373,7 +373,7 @@ } } -void FreeBusyItemModel::slotInsertFreeBusy(const KCalCore::FreeBusy::Ptr &fb, const QString &email) +void FreeBusyItemModel::slotInsertFreeBusy(const KCalendarCore::FreeBusy::Ptr &fb, const QString &email) { if (!fb) { return; diff --git a/src/freebusymodel/freeperiodmodel.h b/src/freebusymodel/freeperiodmodel.h --- a/src/freebusymodel/freeperiodmodel.h +++ b/src/freebusymodel/freeperiodmodel.h @@ -23,7 +23,7 @@ #include "calendarsupport_export.h" -#include +#include #include @@ -45,18 +45,18 @@ int role = Qt::DisplayRole) const override; public Q_SLOTS: - void slotNewFreePeriods(const KCalCore::Period::List &freePeriods); + void slotNewFreePeriods(const KCalendarCore::Period::List &freePeriods); private: /** Splits period blocks in the provided list, so that each period occurs on one day */ - KCalCore::Period::List splitPeriodsByDay(const KCalCore::Period::List &freePeriods); + KCalendarCore::Period::List splitPeriodsByDay(const KCalendarCore::Period::List &freePeriods); QString day(int index) const; QString date(int index) const; QString stringify(int index) const; QString tooltipify(int index) const; - KCalCore::Period::List mPeriodList; + KCalendarCore::Period::List mPeriodList; friend class FreePeriodModelTest; }; } diff --git a/src/freebusymodel/freeperiodmodel.cpp b/src/freebusymodel/freeperiodmodel.cpp --- a/src/freebusymodel/freeperiodmodel.cpp +++ b/src/freebusymodel/freeperiodmodel.cpp @@ -20,7 +20,7 @@ #include "freeperiodmodel.h" -#include +#include #include #include @@ -95,32 +95,32 @@ return QAbstractItemModel::headerData(section, orientation, role); } -void FreePeriodModel::slotNewFreePeriods(const KCalCore::Period::List &freePeriods) +void FreePeriodModel::slotNewFreePeriods(const KCalendarCore::Period::List &freePeriods) { beginResetModel(); mPeriodList.clear(); mPeriodList = splitPeriodsByDay(freePeriods); std::sort(mPeriodList.begin(), mPeriodList.end()); endResetModel(); } -KCalCore::Period::List FreePeriodModel::splitPeriodsByDay( - const KCalCore::Period::List &freePeriods) +KCalendarCore::Period::List FreePeriodModel::splitPeriodsByDay( + const KCalendarCore::Period::List &freePeriods) { - KCalCore::Period::List splitList; - for (const KCalCore::Period &period : freePeriods) { + KCalendarCore::Period::List splitList; + for (const KCalendarCore::Period &period : freePeriods) { if (period.start().date() == period.end().date()) { splitList << period; // period occurs on the same day continue; } const int validPeriodSecs = 300; // 5 minutes - KCalCore::Period tmpPeriod = period; + KCalendarCore::Period tmpPeriod = period; while (tmpPeriod.start().date() != tmpPeriod.end().date()) { const QDateTime midnight(tmpPeriod.start().date(), QTime(23, 59, 59, 999), tmpPeriod.start().timeZone()); - KCalCore::Period firstPeriod(tmpPeriod.start(), midnight); - KCalCore::Period secondPeriod(midnight.addMSecs(1), tmpPeriod.end()); + KCalendarCore::Period firstPeriod(tmpPeriod.start(), midnight); + KCalendarCore::Period secondPeriod(midnight.addMSecs(1), tmpPeriod.end()); if (firstPeriod.duration().asSeconds() >= validPeriodSecs) { splitList << firstPeriod; } @@ -133,23 +133,23 @@ // Perform some jiggery pokery to remove duplicates - QList tmpList = splitList.toList(); - const QSet set = tmpList.toSet(); - tmpList = QList::fromSet(set); - return KCalCore::Period::List::fromList(tmpList); + QList tmpList = splitList.toList(); + const QSet set = tmpList.toSet(); + tmpList = QList::fromSet(set); + return KCalendarCore::Period::List::fromList(tmpList); } QString FreePeriodModel::day(int index) const { - KCalCore::Period period = mPeriodList.at(index); + KCalendarCore::Period period = mPeriodList.at(index); const QDate startDate = period.start().date(); return ki18nc("@label Day of the week name, example: Monday,", "%1,"). subs(QLocale::system().dayName(startDate.dayOfWeek(), QLocale::LongFormat)).toString(); } QString FreePeriodModel::date(int index) const { - KCalCore::Period period = mPeriodList.at(index); + KCalendarCore::Period period = mPeriodList.at(index); const QDate startDate = period.start().date(); const QString startTime @@ -168,7 +168,7 @@ QString FreePeriodModel::stringify(int index) const { - KCalCore::Period period = mPeriodList.at(index); + KCalendarCore::Period period = mPeriodList.at(index); const QDate startDate = period.start().date(); const QString startTime = QLocale().toString(period.start().time(), QLocale::ShortFormat); @@ -190,7 +190,7 @@ QString FreePeriodModel::tooltipify(int index) const { - KCalCore::Period period = mPeriodList.at(index); + KCalendarCore::Period period = mPeriodList.at(index); unsigned long duration = period.duration().asSeconds() * 1000; // we want milliseconds QString toolTip = QStringLiteral(""); toolTip += QLatin1String("") + i18nc("@info:tooltip", "Free Period") + QLatin1String(""); diff --git a/src/incidenceattachmentmodel.h b/src/incidenceattachmentmodel.h --- a/src/incidenceattachmentmodel.h +++ b/src/incidenceattachmentmodel.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include @@ -58,7 +58,7 @@ ~IncidenceAttachmentModel() override; - KCalCore::Incidence::Ptr incidence() const; + KCalendarCore::Incidence::Ptr incidence() const; void setItem(const Akonadi::Item &item); void setIndex(const QPersistentModelIndex &modelIndex); diff --git a/src/incidenceattachmentmodel.cpp b/src/incidenceattachmentmodel.cpp --- a/src/incidenceattachmentmodel.cpp +++ b/src/incidenceattachmentmodel.cpp @@ -88,19 +88,19 @@ item = m_modelIndex.data(EntityTreeModel::ItemRole).value(); } - if (!item.isValid() || !item.hasPayload()) { - m_incidence = KCalCore::Incidence::Ptr(); + if (!item.isValid() || !item.hasPayload()) { + m_incidence = KCalendarCore::Incidence::Ptr(); return; } - m_incidence = item.payload(); + m_incidence = item.payload(); } Q_DECLARE_PUBLIC(IncidenceAttachmentModel) IncidenceAttachmentModel *const q_ptr; QModelIndex m_modelIndex; Akonadi::Item m_item; - KCalCore::Incidence::Ptr m_incidence; + KCalendarCore::Incidence::Ptr m_incidence; Akonadi::Monitor *m_monitor = nullptr; }; } @@ -129,7 +129,7 @@ delete d_ptr; } -KCalCore::Incidence::Ptr IncidenceAttachmentModel::incidence() const +KCalendarCore::Incidence::Ptr IncidenceAttachmentModel::incidence() const { Q_D(const IncidenceAttachmentModel); return d->m_incidence; @@ -149,7 +149,7 @@ void IncidenceAttachmentModel::setItem(const Akonadi::Item &item) { Q_D(IncidenceAttachmentModel); - if (!item.hasPayload()) { + if (!item.hasPayload()) { ItemFetchJob *job = new ItemFetchJob(item); job->fetchScope().fetchFullPayload(true); connect(job, SIGNAL(itemsReceived(Akonadi::Item::List)), @@ -188,7 +188,7 @@ return QVariant(); } - const KCalCore::Attachment attachment = d->m_incidence->attachments().at(index.row()); + const KCalendarCore::Attachment attachment = d->m_incidence->attachments().at(index.row()); switch (role) { case Qt::DisplayRole: return attachment.label(); diff --git a/src/kcalmodel.cpp b/src/kcalmodel.cpp --- a/src/kcalmodel.cpp +++ b/src/kcalmodel.cpp @@ -23,10 +23,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include @@ -44,10 +44,10 @@ static QStringList allMimeTypes() { QStringList types; - types << KCalCore::Event::eventMimeType() - << KCalCore::Todo::todoMimeType() - << KCalCore::Journal::journalMimeType() - << KCalCore::FreeBusy::freeBusyMimeType(); + types << KCalendarCore::Event::eventMimeType() + << KCalendarCore::Todo::todoMimeType() + << KCalendarCore::Journal::journalMimeType() + << KCalendarCore::FreeBusy::freeBusyMimeType(); return types; } @@ -135,21 +135,21 @@ const Akonadi::Item item = itemForIndex(index); - if (!item.hasPayload()) { + if (!item.hasPayload()) { return QVariant(); } - const KCalCore::Incidence::Ptr incidence = item.payload(); + const KCalendarCore::Incidence::Ptr incidence = item.payload(); // Icon for the model entry switch (role) { case Qt::DecorationRole: if (index.column() == 0) { - if (incidence->type() == KCalCore::Incidence::TypeTodo) { + if (incidence->type() == KCalendarCore::Incidence::TypeTodo) { return QIcon::fromTheme(QStringLiteral("view-pim-tasks")); - } else if (incidence->type() == KCalCore::Incidence::TypeJournal) { + } else if (incidence->type() == KCalendarCore::Incidence::TypeJournal) { return QIcon::fromTheme(QStringLiteral("view-pim-journal")); - } else if (incidence->type() == KCalCore::Incidence::TypeEvent) { + } else if (incidence->type() == KCalendarCore::Incidence::TypeEvent) { return QIcon::fromTheme(QStringLiteral("view-calendar")); } else { return QIcon::fromTheme(QStringLiteral("network-wired")); @@ -163,7 +163,7 @@ case DateTimeStart: return incidence->dtStart().toString(); case DateTimeEnd: - return incidence->dateTime(KCalCore::Incidence::RoleEnd).toString(); + return incidence->dateTime(KCalendarCore::Incidence::RoleEnd).toString(); case Type: return incidence->type(); default: diff --git a/src/next/incidenceviewer.cpp b/src/next/incidenceviewer.cpp --- a/src/next/incidenceviewer.cpp +++ b/src/next/incidenceviewer.cpp @@ -222,7 +222,7 @@ void IncidenceViewer::itemChanged(const Akonadi::Item &item) { - if (!item.hasPayload()) { + if (!item.hasPayload()) { d->mBrowser->clear(); return; } diff --git a/src/printing/calprintdefaultplugins.cpp b/src/printing/calprintdefaultplugins.cpp --- a/src/printing/calprintdefaultplugins.cpp +++ b/src/printing/calprintdefaultplugins.cpp @@ -31,7 +31,7 @@ #include -#include +#include #include #include @@ -123,14 +123,14 @@ } } -class TimePrintStringsVisitor : public KCalCore::Visitor +class TimePrintStringsVisitor : public KCalendarCore::Visitor { public: TimePrintStringsVisitor() { } - bool act(KCalCore::IncidenceBase::Ptr incidence) + bool act(KCalendarCore::IncidenceBase::Ptr incidence) { return incidence->accept(*this, incidence); } @@ -140,7 +140,7 @@ QString mDurationCaption, mDurationString; protected: - bool visit(const KCalCore::Event::Ptr &event) override + bool visit(const KCalendarCore::Event::Ptr &event) override { if (event->dtStart().isValid()) { mStartCaption = i18n("Start date: "); @@ -171,7 +171,7 @@ return true; } - bool visit(const KCalCore::Todo::Ptr &todo) override + bool visit(const KCalendarCore::Todo::Ptr &todo) override { if (todo->hasStartDate()) { mStartCaption = i18n("Start date: "); @@ -193,7 +193,7 @@ return true; } - bool visit(const KCalCore::Journal::Ptr &journal) override + bool visit(const KCalendarCore::Journal::Ptr &journal) override { mStartCaption = i18n("Start date: "); mStartString = KCalUtils::IncidenceFormatter::dateTimeToString( @@ -203,7 +203,7 @@ return true; } - bool visit(const KCalCore::FreeBusy::Ptr &fb) override + bool visit(const KCalendarCore::FreeBusy::Ptr &fb) override { Q_UNUSED(fb); return true; @@ -240,7 +240,7 @@ int lineHeight = p.fontMetrics().lineSpacing(); QString cap, txt; - KCalCore::Incidence::List::ConstIterator it; + KCalendarCore::Incidence::List::ConstIterator it; for (it = mSelectedIncidences.constBegin(); it != mSelectedIncidences.constEnd(); ++it) { // don't do anything on a 0-pointer! if (!(*it)) { @@ -250,7 +250,7 @@ mPrinter->newPage(); } - const bool isJournal = ((*it)->type() == KCalCore::Incidence::TypeJournal); + const bool isJournal = ((*it)->type() == KCalendarCore::Incidence::TypeJournal); // PAGE Layout (same for landscape and portrait! astonishingly, it looks good with both!): // +-----------------------------------+ @@ -314,7 +314,7 @@ if ((*it)->recurs()) { QRect recurBox(timesBox.left() + padding(), h + padding(), timesBox.right() - padding(), lineHeight); - KCalCore::Recurrence *recurs = (*it)->recurrence(); + KCalendarCore::Recurrence *recurs = (*it)->recurrence(); QString displayString = KCalUtils::IncidenceFormatter::recurrenceString((*it)); // exception dates QString exceptString; @@ -335,18 +335,18 @@ // Alarms Printing QRect alarmBox(timesBox.left() + padding(), h + padding(), timesBox.right() - padding(), lineHeight); - KCalCore::Alarm::List alarms = (*it)->alarms(); + KCalendarCore::Alarm::List alarms = (*it)->alarms(); if (alarms.isEmpty()) { cap = i18n("No reminders"); txt.clear(); } else { cap = i18np("Reminder: ", "%1 reminders: ", alarms.count()); QStringList alarmStrings; - KCalCore::Alarm::List::ConstIterator it; + KCalendarCore::Alarm::List::ConstIterator it; alarmStrings.reserve(alarms.count()); for (it = alarms.constBegin(); it != alarms.constEnd(); ++it) { - KCalCore::Alarm::Ptr alarm = *it; + KCalendarCore::Alarm::Ptr alarm = *it; // Alarm offset, copied from koeditoralarms.cpp: KLocalizedString offsetstr; @@ -481,7 +481,7 @@ Akonadi::Item::List relations = mCalendar->childItems(item.id()); if (mShowSubitemsNotes && !isJournal) { - if (relations.isEmpty() || (*it)->type() != KCalCore::Incidence::TypeTodo) { + if (relations.isEmpty() || (*it)->type() != KCalendarCore::Incidence::TypeTodo) { int notesPosition = drawBoxWithCaption(p, notesBox, i18n("Notes:"), QString(), /*sameLine=*/ false, /*expand=*/ false, captionFont, textFont); @@ -502,15 +502,15 @@ QString datesString; int count = 0; for (const Akonadi::Item &item : qAsConst(relations)) { - KCalCore::Todo::Ptr todo = CalendarSupport::todo(item); + KCalendarCore::Todo::Ptr todo = CalendarSupport::todo(item); ++count; if (!todo) { // defensive, skip any zero pointers continue; } // format the status statusString = KCalUtils::Stringify::incidenceStatus(todo->status()); if (statusString.isEmpty()) { - if (todo->status() == KCalCore::Incidence::StatusNone) { + if (todo->status() == KCalendarCore::Incidence::StatusNone) { statusString = i18nc("no status", "none"); } else { statusString = i18nc("unknown status", "unknown"); @@ -528,16 +528,16 @@ time(), QLocale::ShortFormat)); } } - if (todo->dateTime(KCalCore::Incidence::RoleEnd).isValid()) { + if (todo->dateTime(KCalendarCore::Incidence::RoleEnd).isValid()) { subitemString += i18nc("subitem due date", "Due Date: %1\n", - QLocale().toString(todo->dateTime(KCalCore::Incidence + QLocale().toString(todo->dateTime(KCalendarCore::Incidence ::RoleEnd). toLocalTime().date(), QLocale::ShortFormat)); if (!todo->allDay()) { subitemString += i18nc("subitem due time", "Due Time: %1\n", - QLocale().toString(todo->dateTime(KCalCore:: + QLocale().toString(todo->dateTime(KCalendarCore:: Incidence:: RoleEnd). toLocalTime().time(), @@ -571,7 +571,7 @@ } if (mShowAttachments && !isJournal) { - const KCalCore::Attachment::List attachments = (*it)->attachments(); + const KCalendarCore::Attachment::List attachments = (*it)->attachments(); QString attachmentCaption; if (attachments.isEmpty()) { attachmentCaption = i18n("No Attachments"); @@ -582,7 +582,7 @@ attachments.count()); } QString attachmentString; - KCalCore::Attachment::List::ConstIterator ait = attachments.constBegin(); + KCalendarCore::Attachment::List::ConstIterator ait = attachments.constBegin(); for (; ait != attachments.constEnd(); ++ait) { if (!attachmentString.isEmpty()) { attachmentString += i18nc("Spacer for list of attachments", " "); @@ -595,7 +595,7 @@ captionFont, textFont); } if (mShowAttendees) { - const KCalCore::Attendee::List attendees = (*it)->attendees(); + const KCalendarCore::Attendee::List attendees = (*it)->attendees(); QString attendeeCaption; if (attendees.isEmpty()) { attendeeCaption = i18n("No Attendees"); @@ -605,7 +605,7 @@ attendees.count()); } QString attendeeString; - KCalCore::Attendee::List::ConstIterator ait = attendees.constBegin(); + KCalendarCore::Attendee::List::ConstIterator ait = attendees.constBegin(); for (; ait != attendees.constEnd(); ++ait) { if (!attendeeString.isEmpty()) { attendeeString += QLatin1Char('\n'); @@ -637,21 +637,21 @@ KCalUtils::Stringify::incidenceSecrecy((*it)->secrecy())); optionsString += QLatin1Char('\n'); } - if ((*it)->type() == KCalCore::Incidence::TypeEvent) { - KCalCore::Event::Ptr e = (*it).staticCast(); - if (e->transparency() == KCalCore::Event::Opaque) { + if ((*it)->type() == KCalendarCore::Incidence::TypeEvent) { + KCalendarCore::Event::Ptr e = (*it).staticCast(); + if (e->transparency() == KCalendarCore::Event::Opaque) { optionsString += i18n("Show as: Busy"); } else { optionsString += i18n("Show as: Free"); } optionsString += QLatin1Char('\n'); - } else if ((*it)->type() == KCalCore::Incidence::TypeTodo) { - KCalCore::Todo::Ptr t = (*it).staticCast(); + } else if ((*it)->type() == KCalendarCore::Incidence::TypeTodo) { + KCalendarCore::Todo::Ptr t = (*it).staticCast(); if (t->isOverdue()) { optionsString += i18n("This task is overdue!"); optionsString += QLatin1Char('\n'); } - } else if ((*it)->type() == KCalCore::Incidence::TypeJournal) { + } else if ((*it)->type() == KCalendarCore::Incidence::TypeJournal) { //TODO: Anything Journal-specific? } drawBoxWithCaption(p, optionsBox, i18n("Settings: "), @@ -859,13 +859,13 @@ } drawHeader(p, local.toString(curDay, QLocale::ShortFormat), curDay, QDate(), headerBox); - KCalCore::Event::List eventList = mCalendar->events(curDay, QTimeZone::systemTimeZone(), - KCalCore::EventSortStartDate, - KCalCore::SortDirectionAscending); + KCalendarCore::Event::List eventList = mCalendar->events(curDay, QTimeZone::systemTimeZone(), + KCalendarCore::EventSortStartDate, + KCalendarCore::SortDirectionAscending); // split out the all day events as they will be printed in a separate box - KCalCore::Event::List alldayEvents, timedEvents; - for (const KCalCore::Event::Ptr &event : qAsConst(eventList)) { + KCalendarCore::Event::List alldayEvents, timedEvents; + for (const KCalendarCore::Event::Ptr &event : qAsConst(eventList)) { if (event->allDay()) { alldayEvents.append(event); } else { @@ -903,7 +903,7 @@ eventBox.setTop(eventBox.top() + padding()); eventBox.setBottom(eventBox.top() + lineSpacing); int count = 0; - for (const KCalCore::Event::Ptr &event : qAsConst(alldayEvents)) { + for (const KCalendarCore::Event::Ptr &event : qAsConst(alldayEvents)) { if (count == maxAllDayEvents) { break; } @@ -1568,37 +1568,37 @@ p.setFont(QFont(QStringLiteral("sans-serif"), 10)); //fontHeight = p.fontMetrics().height(); - KCalCore::Todo::List todoList; - KCalCore::Todo::List tempList; + KCalendarCore::Todo::List todoList; + KCalendarCore::Todo::List tempList; - KCalCore::SortDirection sortDirection = KCalCore::SortDirectionAscending; + KCalendarCore::SortDirection sortDirection = KCalendarCore::SortDirectionAscending; switch (mTodoSortDirection) { case TodoDirectionAscending: - sortDirection = KCalCore::SortDirectionAscending; + sortDirection = KCalendarCore::SortDirectionAscending; break; case TodoDirectionDescending: - sortDirection = KCalCore::SortDirectionDescending; + sortDirection = KCalendarCore::SortDirectionDescending; break; case TodoDirectionUnset: break; } - KCalCore::TodoSortField sortField = KCalCore::TodoSortSummary; + KCalendarCore::TodoSortField sortField = KCalendarCore::TodoSortSummary; switch (mTodoSortField) { case TodoFieldSummary: - sortField = KCalCore::TodoSortSummary; + sortField = KCalendarCore::TodoSortSummary; break; case TodoFieldStartDate: - sortField = KCalCore::TodoSortStartDate; + sortField = KCalendarCore::TodoSortStartDate; break; case TodoFieldDueDate: - sortField = KCalCore::TodoSortDueDate; + sortField = KCalendarCore::TodoSortDueDate; break; case TodoFieldPriority: - sortField = KCalCore::TodoSortPriority; + sortField = KCalendarCore::TodoSortPriority; break; case TodoFieldPercentComplete: - sortField = KCalCore::TodoSortPercentComplete; + sortField = KCalendarCore::TodoSortPercentComplete; break; case TodoFieldUnset: break; @@ -1610,16 +1610,16 @@ case TodosAll: break; case TodosUnfinished: - for (const KCalCore::Todo::Ptr &todo : qAsConst(todoList)) { + for (const KCalendarCore::Todo::Ptr &todo : qAsConst(todoList)) { Q_ASSERT(todo); if (!todo->isCompleted()) { tempList.append(todo); } } todoList = tempList; break; case TodosDueRange: - for (const KCalCore::Todo::Ptr &todo : qAsConst(todoList)) { + for (const KCalendarCore::Todo::Ptr &todo : qAsConst(todoList)) { Q_ASSERT(todo); if (todo->hasDueDate()) { if (todo->dtDue().date() >= mFromDate && todo->dtDue().date() <= mToDate) { @@ -1635,9 +1635,9 @@ // Print to-dos int count = 0; - for (const KCalCore::Todo::Ptr &todo : qAsConst(todoList)) { - if ((mExcludeConfidential && todo->secrecy() == KCalCore::Incidence::SecrecyConfidential) - || (mExcludePrivate && todo->secrecy() == KCalCore::Incidence::SecrecyPrivate)) { + for (const KCalendarCore::Todo::Ptr &todo : qAsConst(todoList)) { + if ((mExcludeConfidential && todo->secrecy() == KCalendarCore::Incidence::SecrecyConfidential) + || (mExcludePrivate && todo->secrecy() == KCalendarCore::Incidence::SecrecyPrivate)) { continue; } // Skip sub-to-dos. They will be printed recursively in drawTodo() diff --git a/src/printing/calprinter.h b/src/printing/calprinter.h --- a/src/printing/calprinter.h +++ b/src/printing/calprinter.h @@ -81,7 +81,7 @@ public: void print(int type, const QDate &fd, const QDate &td, - const KCalCore::Incidence::List &selectedIncidences = KCalCore::Incidence::List(), bool preview = false); + const KCalendarCore::Incidence::List &selectedIncidences = KCalendarCore::Incidence::List(), bool preview = false); Akonadi::ETMCalendar::Ptr calendar() const; KConfig *config() const; diff --git a/src/printing/calprinter.cpp b/src/printing/calprinter.cpp --- a/src/printing/calprinter.cpp +++ b/src/printing/calprinter.cpp @@ -98,7 +98,7 @@ } void CalPrinter::print(int type, const QDate &fd, const QDate &td, - const KCalCore::Incidence::List &selectedIncidences, bool preview) + const KCalendarCore::Incidence::List &selectedIncidences, bool preview) { PrintPlugin::List::Iterator it; const PrintPlugin::List::Iterator end = mPrintPlugins.end(); @@ -125,7 +125,7 @@ delete printDialog; for (it = mPrintPlugins.begin(); it != mPrintPlugins.end(); ++it) { - (*it)->setSelectedIncidences(KCalCore::Incidence::List()); + (*it)->setSelectedIncidences(KCalendarCore::Incidence::List()); } } diff --git a/src/printing/calprintpluginbase.h b/src/printing/calprintpluginbase.h --- a/src/printing/calprintpluginbase.h +++ b/src/printing/calprintpluginbase.h @@ -30,9 +30,9 @@ #include -#include -#include -#include +#include +#include +#include #include #include @@ -191,7 +191,7 @@ @param flags is a bitwise OR of Qt::AlignmentFlags and Qt::TextFlags values. */ void showEventBox(QPainter &p, int linewidth, const QRect &box, - const KCalCore::Incidence::Ptr &incidence, const QString &str, + const KCalendarCore::Incidence::Ptr &incidence, const QString &str, int flags = -1); /** @@ -339,7 +339,7 @@ @param excludePrivate Whether to exclude Incidence marked private. @return The height used for the all-day box. */ - int drawAllDayBox(QPainter &p, const KCalCore::Event::List &eventList, const QDate &qd, + int drawAllDayBox(QPainter &p, const KCalendarCore::Event::List &eventList, const QDate &qd, bool expandable, const QRect &box, bool excludeConfidential, bool excludePrivate); /** @@ -368,7 +368,7 @@ @param excludePrivate Whether to exclude Incidence marked private. @param workDays List of workDays */ - void drawAgendaDayBox(QPainter &p, const KCalCore::Event::List &eventList, const QDate &qd, + void drawAgendaDayBox(QPainter &p, const KCalendarCore::Event::List &eventList, const QDate &qd, bool expandable, const QTime &fromTime, const QTime &toTime, const QRect &box, bool includeDescription, bool excludeTime, bool excludeConfidential, bool excludePrivate, @@ -549,11 +549,11 @@ @param r Internal (used when printing sub-to-dos to give information about its parent) */ - void drawTodo(int &count, const KCalCore::Todo::Ptr &todo, QPainter &p, - KCalCore::TodoSortField sortField, KCalCore::SortDirection sortDir, + void drawTodo(int &count, const KCalendarCore::Todo::Ptr &todo, QPainter &p, + KCalendarCore::TodoSortField sortField, KCalendarCore::SortDirection sortDir, bool connectSubTodos, bool strikeoutCompleted, bool desc, int posPriority, int posSummary, int posDueDt, int posPercentComplete, int level, int x, int &y, - int width, int pageHeight, const KCalCore::Todo::List &todoList, + int width, int pageHeight, const KCalendarCore::Todo::List &todoList, TodoParentStart *r, bool excludeConfidential, bool excludePrivate); /** @@ -566,7 +566,7 @@ @param pageHeight Total height allowed for the list on a page. If an item would be below that line, a new page is started. */ - void drawJournal(const KCalCore::Journal::Ptr &journal, QPainter &p, int x, int &y, int width, + void drawJournal(const KCalendarCore::Journal::Ptr &journal, QPainter &p, int x, int &y, int width, int pageHeight); /** Draws text lines splitting on page boundaries. @@ -593,7 +593,7 @@ protected: QTime dayStart() const; - QColor categoryBgColor(const KCalCore::Incidence::Ptr &incidence) const; + QColor categoryBgColor(const KCalendarCore::Incidence::Ptr &incidence) const; void drawIncidence(QPainter &p, const QRect &dayBox, const QString &time, const QString &summary, const QString &description, int &textY, @@ -620,11 +620,11 @@ /** * Sets the QPainter's brush and pen color according to the Incidence's category. */ - void setColorsByIncidenceCategory(QPainter &p, const KCalCore::Incidence::Ptr &incidence) const; + void setColorsByIncidenceCategory(QPainter &p, const KCalendarCore::Incidence::Ptr &incidence) const; QString holidayString(const QDate &date) const; - KCalCore::Event::Ptr holidayEvent(const QDate &date) const; + KCalendarCore::Event::Ptr holidayEvent(const QDate &date) const; /** * Returns a nice QColor for text, give the input color &c. diff --git a/src/printing/calprintpluginbase.cpp b/src/printing/calprintpluginbase.cpp --- a/src/printing/calprintpluginbase.cpp +++ b/src/printing/calprintpluginbase.cpp @@ -81,14 +81,14 @@ class PrintCellItem : public CellItem { public: - PrintCellItem(const KCalCore::Event::Ptr &event, const QDateTime &start, const QDateTime &end) + PrintCellItem(const KCalendarCore::Event::Ptr &event, const QDateTime &start, const QDateTime &end) : mEvent(event) , mStart(start) , mEnd(end) { } - KCalCore::Event::Ptr event() const + KCalendarCore::Event::Ptr event() const { return mEvent; } @@ -117,7 +117,7 @@ } private: - KCalCore::Event::Ptr mEvent; + KCalendarCore::Event::Ptr mEvent; QDateTime mStart, mEnd; }; @@ -270,7 +270,7 @@ } void CalPrintPluginBase::setColorsByIncidenceCategory(QPainter &p, - const KCalCore::Incidence::Ptr &incidence) + const KCalendarCore::Incidence::Ptr &incidence) const { QColor bgColor = categoryBgColor(incidence); @@ -299,12 +299,12 @@ return bgColor; } -QColor CalPrintPluginBase::categoryBgColor(const KCalCore::Incidence::Ptr &incidence) const +QColor CalPrintPluginBase::categoryBgColor(const KCalendarCore::Incidence::Ptr &incidence) const { if (incidence) { QColor backColor = categoryColor(incidence->categories()); - if (incidence->type() == KCalCore::Incidence::TypeTodo) { - if ((incidence.staticCast())->isOverdue()) { + if (incidence->type() == KCalendarCore::Incidence::TypeTodo) { + if ((incidence.staticCast())->isOverdue()) { backColor = QColor(255, 100, 100); //was KOPrefs::instance()->todoOverdueColor(); } } @@ -320,14 +320,14 @@ return lst.join(i18nc("@item:intext delimiter for joining holiday names", ",")); } -KCalCore::Event::Ptr CalPrintPluginBase::holidayEvent(const QDate &date) const +KCalendarCore::Event::Ptr CalPrintPluginBase::holidayEvent(const QDate &date) const { QString hstring(holidayString(date)); if (hstring.isEmpty()) { - return KCalCore::Event::Ptr(); + return KCalendarCore::Event::Ptr(); } - KCalCore::Event::Ptr holiday(new KCalCore::Event); + KCalendarCore::Event::Ptr holiday(new KCalendarCore::Event); holiday->setSummary(hstring); holiday->setCategories(i18n("Holiday")); @@ -449,7 +449,7 @@ } void CalPrintPluginBase::showEventBox(QPainter &p, int linewidth, const QRect &box, - const KCalCore::Incidence::Ptr &incidence, const QString &str, + const KCalendarCore::Incidence::Ptr &incidence, const QString &str, int flags) { QPen oldpen(p.pen()); @@ -484,7 +484,7 @@ p.save(); p.rotate(-90); QRect rotatedBox(-box.top() - box.height(), box.left(), box.height(), box.width()); - showEventBox(p, linewidth, rotatedBox, KCalCore::Incidence::Ptr(), str, + showEventBox(p, linewidth, rotatedBox, KCalendarCore::Incidence::Ptr(), str, (flags == -1) ? Qt::AlignLeft | Qt::AlignVCenter | Qt::TextSingleLine : flags); p.restore(); @@ -814,26 +814,26 @@ be the total height used for the all-day events. If !expandable, only one cell will be used, and multiple events are concatenated using ", ". */ -int CalPrintPluginBase::drawAllDayBox(QPainter &p, const KCalCore::Event::List &eventList_, +int CalPrintPluginBase::drawAllDayBox(QPainter &p, const KCalendarCore::Event::List &eventList_, const QDate &qd, bool expandable, const QRect &box, bool excludeConfidential, bool excludePrivate) { - KCalCore::Event::List::Iterator it; + KCalendarCore::Event::List::Iterator it; int offset = box.top(); QString multiDayStr; - KCalCore::Event::List eventList = eventList_; - KCalCore::Event::Ptr hd = holidayEvent(qd); + KCalendarCore::Event::List eventList = eventList_; + KCalendarCore::Event::Ptr hd = holidayEvent(qd); if (hd) { eventList.prepend(hd); } it = eventList.begin(); while (it != eventList.end()) { - KCalCore::Event::Ptr currEvent = *it; + KCalendarCore::Event::Ptr currEvent = *it; if ((excludeConfidential - && currEvent->secrecy() == KCalCore::Incidence::SecrecyConfidential) - || (excludePrivate && currEvent->secrecy() == KCalCore::Incidence::SecrecyPrivate)) { + && currEvent->secrecy() == KCalendarCore::Incidence::SecrecyConfidential) + || (excludePrivate && currEvent->secrecy() == KCalendarCore::Incidence::SecrecyPrivate)) { continue; } if (currEvent && currEvent->allDay()) { @@ -872,7 +872,7 @@ return ret; } -void CalPrintPluginBase::drawAgendaDayBox(QPainter &p, const KCalCore::Event::List &events, +void CalPrintPluginBase::drawAgendaDayBox(QPainter &p, const KCalendarCore::Event::List &events, const QDate &qd, bool expandable, const QTime &fromTime, const QTime &toTime, const QRect &oldbox, bool includeDescription, bool excludeTime, @@ -902,11 +902,11 @@ if (expandable) { // Adapt start/end times to include complete events - for (const KCalCore::Event::Ptr &event : qAsConst(events)) { + for (const KCalendarCore::Event::Ptr &event : qAsConst(events)) { Q_ASSERT(event); if ((excludeConfidential - && event->secrecy() == KCalCore::Incidence::SecrecyConfidential) - || (excludePrivate && event->secrecy() == KCalCore::Incidence::SecrecyPrivate)) { + && event->secrecy() == KCalendarCore::Incidence::SecrecyConfidential) + || (excludePrivate && event->secrecy() == KCalendarCore::Incidence::SecrecyPrivate)) { continue; } // skip items without times so that we do not adjust for all day items @@ -960,7 +960,7 @@ QList cells; - for (const KCalCore::Event::Ptr &event : qAsConst(events)) { + for (const KCalendarCore::Event::Ptr &event : qAsConst(events)) { if (event->allDay()) { continue; } @@ -991,7 +991,7 @@ const QDateTime &endPrintDate, float minlen, const QRect &box, bool includeDescription, bool excludeTime) { - KCalCore::Event::Ptr event = item->event(); + KCalendarCore::Event::Ptr event = item->event(); // start/end of print area for event QDateTime startTime = item->start(); @@ -1113,32 +1113,32 @@ p.setFont(QFont(QStringLiteral("sans-serif"), 10, QFont::Bold)); p.drawText(headerTextBox, Qt::AlignRight | Qt::AlignVCenter, dayNumStr); - const KCalCore::Event::List eventList + const KCalendarCore::Event::List eventList = mCalendar->events(qd, QTimeZone::systemTimeZone(), - KCalCore::EventSortStartDate, - KCalCore::SortDirectionAscending); + KCalendarCore::EventSortStartDate, + KCalendarCore::SortDirectionAscending); QString timeText; p.setFont(QFont(QStringLiteral("sans-serif"), 7)); int textY = mSubHeaderHeight; // gives the relative y-coord of the next printed entry unsigned int visibleEventsCounter = 0; - for (const KCalCore::Event::Ptr &currEvent : qAsConst(eventList)) { + for (const KCalendarCore::Event::Ptr &currEvent : qAsConst(eventList)) { Q_ASSERT(currEvent); if (!currEvent->allDay()) { if (currEvent->dtEnd().toLocalTime().time() <= myFromTime || currEvent->dtStart().toLocalTime().time() > myToTime) { continue; } } - if ((!printRecurDaily && currEvent->recurrenceType() == KCalCore::Recurrence::rDaily) + if ((!printRecurDaily && currEvent->recurrenceType() == KCalendarCore::Recurrence::rDaily) || (!printRecurWeekly - && currEvent->recurrenceType() == KCalCore::Recurrence::rWeekly)) { + && currEvent->recurrenceType() == KCalendarCore::Recurrence::rWeekly)) { continue; } if ((excludeConfidential - && currEvent->secrecy() == KCalCore::Incidence::SecrecyConfidential) - || (excludePrivate && currEvent->secrecy() == KCalCore::Incidence::SecrecyPrivate)) { + && currEvent->secrecy() == KCalendarCore::Incidence::SecrecyConfidential) + || (excludePrivate && currEvent->secrecy() == KCalendarCore::Incidence::SecrecyPrivate)) { continue; } if (currEvent->allDay() || currEvent->isMultiDay()) { @@ -1186,20 +1186,20 @@ } if (textY < box.height()) { - KCalCore::Todo::List todos = mCalendar->todos(qd); - for (const KCalCore::Todo::Ptr &todo : qAsConst(todos)) { + KCalendarCore::Todo::List todos = mCalendar->todos(qd); + for (const KCalendarCore::Todo::Ptr &todo : qAsConst(todos)) { if (!todo->allDay()) { if ((todo->hasDueDate() && todo->dtDue().toLocalTime().time() <= myFromTime) || (todo->hasStartDate() && todo->dtStart().toLocalTime().time() > myToTime)) { continue; } } - if ((!printRecurDaily && todo->recurrenceType() == KCalCore::Recurrence::rDaily) - || (!printRecurWeekly && todo->recurrenceType() == KCalCore::Recurrence::rWeekly)) { + if ((!printRecurDaily && todo->recurrenceType() == KCalendarCore::Recurrence::rDaily) + || (!printRecurWeekly && todo->recurrenceType() == KCalendarCore::Recurrence::rWeekly)) { continue; } - if ((excludeConfidential && todo->secrecy() == KCalCore::Incidence::SecrecyConfidential) - || (excludePrivate && todo->secrecy() == KCalCore::Incidence::SecrecyPrivate)) { + if ((excludeConfidential && todo->secrecy() == KCalendarCore::Incidence::SecrecyConfidential) + || (excludePrivate && todo->secrecy() == KCalendarCore::Incidence::SecrecyPrivate)) { continue; } if (todo->hasStartDate() && !todo->allDay()) { @@ -1443,9 +1443,9 @@ if (expandable) { QDate curDate(fromDate); while (curDate <= toDate) { - KCalCore::Event::List eventList + KCalendarCore::Event::List eventList = mCalendar->events(curDate, QTimeZone::systemTimeZone()); - for (const KCalCore::Event::Ptr &event : qAsConst(eventList)) { + for (const KCalendarCore::Event::Ptr &event : qAsConst(eventList)) { Q_ASSERT(event); if (event->allDay()) { continue; @@ -1486,9 +1486,9 @@ QRect dayBox(allDayBox); dayBox.setTop(tlBox.top()); dayBox.setBottom(box.bottom()); - KCalCore::Event::List eventList = mCalendar->events(curDate, QTimeZone::systemTimeZone(), - KCalCore::EventSortStartDate, - KCalCore::SortDirectionAscending); + KCalendarCore::Event::List eventList = mCalendar->events(curDate, QTimeZone::systemTimeZone(), + KCalendarCore::EventSortStartDate, + KCalendarCore::SortDirectionAscending); alldayHeight = drawAllDayBox(p, eventList, curDate, false, allDayBox, excludeConfidential, excludePrivate); @@ -1508,7 +1508,7 @@ { } - MonthEventStruct(const QDateTime &s, const QDateTime &e, const KCalCore::Event::Ptr &ev) + MonthEventStruct(const QDateTime &s, const QDateTime &e, const KCalendarCore::Event::Ptr &ev) { event = ev; start = s; @@ -1526,7 +1526,7 @@ QDateTime start; QDateTime end; - KCalCore::Event::Ptr event; + KCalendarCore::Event::Ptr event; }; void CalPrintPluginBase::drawMonth(QPainter &p, const QDate &dt, const QRect &box, int maxdays, @@ -1598,7 +1598,7 @@ QDate end = start.addMonths(1); end = end.addDays(-1); - const KCalCore::Event::List events = mCalendar->events(start, end); + const KCalendarCore::Event::List events = mCalendar->events(start, end); QMap textEvents; QList timeboxItems; @@ -1609,9 +1609,9 @@ // 3) Draw some kind of timeline showing free and busy times // Holidays - QList holidays; + QList holidays; for (QDate d(start); d <= end; d = d.addDays(1)) { - KCalCore::Event::Ptr e = holidayEvent(d); + KCalendarCore::Event::Ptr e = holidayEvent(d); if (e) { holidays.append(e); if (holidaysFlags & TimeBoxes) { @@ -1626,12 +1626,12 @@ QList monthentries; - for (const KCalCore::Event::Ptr &e : qAsConst(events)) { + for (const KCalendarCore::Event::Ptr &e : qAsConst(events)) { if (!e) { continue; } - if ((excludeConfidential && e->secrecy() == KCalCore::Incidence::SecrecyConfidential) - || (excludePrivate && e->secrecy() == KCalCore::Incidence::SecrecyPrivate)) { + if ((excludeConfidential && e->secrecy() == KCalendarCore::Incidence::SecrecyConfidential) + || (excludePrivate && e->secrecy() == KCalendarCore::Incidence::SecrecyPrivate)) { continue; } if (e->recurs()) { @@ -1649,12 +1649,12 @@ // begins on that day (don't use Event::recursOn, as that will // also return events that have started earlier. These start dates // however, have already been treated! - KCalCore::Recurrence *recur = e->recurrence(); + KCalendarCore::Recurrence *recur = e->recurrence(); QDate d1(start.addDays(1)); while (d1 <= end) { if (recur->recursOn(d1, QTimeZone::systemTimeZone())) { - KCalCore::TimeList times(recur->recurTimesOn(d1, QTimeZone::systemTimeZone())); - for (KCalCore::TimeList::ConstIterator it = times.constBegin(); + KCalendarCore::TimeList times(recur->recurTimesOn(d1, QTimeZone::systemTimeZone())); + for (KCalendarCore::TimeList::ConstIterator it = times.constBegin(); it != times.constEnd(); ++it) { QDateTime d1start(d1, *it, Qt::LocalTime); monthentries.append( @@ -1864,13 +1864,13 @@ } } -void CalPrintPluginBase::drawTodo(int &count, const KCalCore::Todo::Ptr &todo, QPainter &p, - KCalCore::TodoSortField sortField, - KCalCore::SortDirection sortDir, bool connectSubTodos, +void CalPrintPluginBase::drawTodo(int &count, const KCalendarCore::Todo::Ptr &todo, QPainter &p, + KCalendarCore::TodoSortField sortField, + KCalendarCore::SortDirection sortDir, bool connectSubTodos, bool strikeoutCompleted, bool desc, int posPriority, int posSummary, int posDueDt, int posPercentComplete, int level, int x, int &y, int width, int pageHeight, - const KCalCore::Todo::List &todoList, TodoParentStart *r, + const KCalendarCore::Todo::List &todoList, TodoParentStart *r, bool excludeConfidential, bool excludePrivate) { QString outStr; @@ -1989,24 +1989,24 @@ y += 10; // Make a list of all the sub-to-dos related to this to-do. - KCalCore::Todo::List t; - const KCalCore::Incidence::List relations = mCalendar->childIncidences(todo->uid()); + KCalendarCore::Todo::List t; + const KCalendarCore::Incidence::List relations = mCalendar->childIncidences(todo->uid()); - for (const KCalCore::Incidence::Ptr &incidence : relations) { + for (const KCalendarCore::Incidence::Ptr &incidence : relations) { // In the future, to-dos might also be related to events // Manually check if the sub-to-do is in the list of to-dos to print // The problem is that relations() does not apply filters, so // we need to compare manually with the complete filtered list! - KCalCore::Todo::Ptr subtodo = incidence.dynamicCast(); + KCalendarCore::Todo::Ptr subtodo = incidence.dynamicCast(); if (!subtodo) { continue; } #ifdef AKONADI_PORT_DISABLED if (subtodo && todoList.contains(subtodo)) { #else bool subtodoOk = false; if (subtodo) { - for (const KCalCore::Todo::Ptr &tt : qAsConst(todoList)) { + for (const KCalendarCore::Todo::Ptr &tt : qAsConst(todoList)) { if (tt == subtodo) { subtodoOk = true; break; @@ -2016,9 +2016,9 @@ if (subtodoOk) { #endif if ((excludeConfidential - && subtodo->secrecy() == KCalCore::Incidence::SecrecyConfidential) + && subtodo->secrecy() == KCalendarCore::Incidence::SecrecyConfidential) || (excludePrivate - && subtodo->secrecy() == KCalCore::Incidence::SecrecyPrivate)) { + && subtodo->secrecy() == KCalendarCore::Incidence::SecrecyPrivate)) { continue; } t.append(subtodo); @@ -2042,18 +2042,18 @@ // Sort the sub-to-dos and print them #ifdef AKONADI_PORT_DISABLED - KCalCore::Todo::List sl = mCalendar->sortTodos(&t, sortField, sortDir); + KCalendarCore::Todo::List sl = mCalendar->sortTodos(&t, sortField, sortDir); #else - KCalCore::Todo::List tl; + KCalendarCore::Todo::List tl; tl.reserve(t.count()); - for (const KCalCore::Todo::Ptr &todo : qAsConst(t)) { + for (const KCalendarCore::Todo::Ptr &todo : qAsConst(t)) { tl.append(todo); } - KCalCore::Todo::List sl = mCalendar->sortTodos(tl, sortField, sortDir); + KCalendarCore::Todo::List sl = mCalendar->sortTodos(tl, sortField, sortDir); #endif int subcount = 0; - for (const KCalCore::Todo::Ptr &isl : qAsConst(sl)) { + for (const KCalendarCore::Todo::Ptr &isl : qAsConst(sl)) { count++; if (++subcount == sl.size()) { startpt.mHasLine = false; @@ -2099,7 +2099,7 @@ } } -void CalPrintPluginBase::drawJournal(const KCalCore::Journal::Ptr &journal, QPainter &p, int x, +void CalPrintPluginBase::drawJournal(const KCalendarCore::Journal::Ptr &journal, QPainter &p, int x, int &y, int width, int pageHeight) { QFont oldFont(p.font()); diff --git a/src/printing/journalprint.cpp b/src/printing/journalprint.cpp --- a/src/printing/journalprint.cpp +++ b/src/printing/journalprint.cpp @@ -105,11 +105,11 @@ void CalPrintJournal::print(QPainter &p, int width, int height) { int x = 0, y = 0; - KCalCore::Journal::List journals(mCalendar->journals()); + KCalendarCore::Journal::List journals(mCalendar->journals()); if (mUseDateRange) { - const KCalCore::Journal::List allJournals = journals; + const KCalendarCore::Journal::List allJournals = journals; journals.clear(); - for (const KCalCore::Journal::Ptr &j : allJournals) { + for (const KCalendarCore::Journal::Ptr &j : allJournals) { const QDate dt = j->dtStart().date(); if (mFromDate <= dt && dt <= mToDate) { journals.append(j); @@ -124,7 +124,7 @@ drawHeader(p, i18n("Journal entries"), QDate(), QDate(), headerBox); y = headerHeight() + 15; - for (const KCalCore::Journal::Ptr &j : qAsConst(journals)) { + for (const KCalendarCore::Journal::Ptr &j : qAsConst(journals)) { drawJournal(j, p, x, y, width, height); } diff --git a/src/printing/printplugin.h b/src/printing/printplugin.h --- a/src/printing/printplugin.h +++ b/src/printing/printplugin.h @@ -24,7 +24,7 @@ #include -#include +#include #include #include @@ -85,12 +85,12 @@ mCalendar = cal; } - virtual void setSelectedIncidences(const KCalCore::Incidence::List &inc) + virtual void setSelectedIncidences(const KCalendarCore::Incidence::List &inc) { mSelectedIncidences = inc; } - virtual KCalCore::Incidence::List selectedIncidences() const + virtual KCalendarCore::Incidence::List selectedIncidences() const { return mSelectedIncidences; } @@ -206,7 +206,7 @@ of the selected plugin */ QPrinter *mPrinter = nullptr; Akonadi::ETMCalendar::Ptr mCalendar; - KCalCore::Incidence::List mSelectedIncidences; + KCalendarCore::Incidence::List mSelectedIncidences; KConfig *mConfig = nullptr; }; diff --git a/src/utils.h b/src/utils.h --- a/src/utils.h +++ b/src/utils.h @@ -30,15 +30,15 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -namespace KCalCore { +namespace KCalendarCore { class CalFilter; } @@ -57,43 +57,43 @@ /** * returns the incidence from an akonadi item, or a null pointer if the item has no such payload */ -CALENDARSUPPORT_EXPORT KCalCore::Incidence::Ptr incidence(const Akonadi::Item &item); +CALENDARSUPPORT_EXPORT KCalendarCore::Incidence::Ptr incidence(const Akonadi::Item &item); /** * returns the event from an akonadi item, or a null pointer if the item has no such payload */ -CALENDARSUPPORT_EXPORT KCalCore::Event::Ptr event(const Akonadi::Item &item); +CALENDARSUPPORT_EXPORT KCalendarCore::Event::Ptr event(const Akonadi::Item &item); /** * returns the event from an incidence, or a null pointer if the item has no such payload */ -CALENDARSUPPORT_EXPORT KCalCore::Event::Ptr event(const KCalCore::Incidence::Ptr &incidence); +CALENDARSUPPORT_EXPORT KCalendarCore::Event::Ptr event(const KCalendarCore::Incidence::Ptr &incidence); /** * returns incidence pointers from an akonadi item. */ -CALENDARSUPPORT_EXPORT KCalCore::Incidence::List incidencesFromItems( +CALENDARSUPPORT_EXPORT KCalendarCore::Incidence::List incidencesFromItems( const Akonadi::Item::List &items); /** * returns the todo from an akonadi item, or a null pointer if the item has no such payload */ -CALENDARSUPPORT_EXPORT KCalCore::Todo::Ptr todo(const Akonadi::Item &item); +CALENDARSUPPORT_EXPORT KCalendarCore::Todo::Ptr todo(const Akonadi::Item &item); /** * returns the todo from an incidence, or a null pointer if the item has no such payload */ -CALENDARSUPPORT_EXPORT KCalCore::Todo::Ptr todo(const KCalCore::Incidence::Ptr &incidence); +CALENDARSUPPORT_EXPORT KCalendarCore::Todo::Ptr todo(const KCalendarCore::Incidence::Ptr &incidence); /** * returns the journal from an akonadi item, or a null pointer if the item has no such payload */ -CALENDARSUPPORT_EXPORT KCalCore::Journal::Ptr journal(const Akonadi::Item &item); +CALENDARSUPPORT_EXPORT KCalendarCore::Journal::Ptr journal(const Akonadi::Item &item); /** * returns the journal from an incidence, or a null pointer if the item has no such payload */ -CALENDARSUPPORT_EXPORT KCalCore::Journal::Ptr journal(const KCalCore::Incidence::Ptr &incidence); +CALENDARSUPPORT_EXPORT KCalendarCore::Journal::Ptr journal(const KCalendarCore::Incidence::Ptr &incidence); /** * returns whether an Akonadi item contains an incidence @@ -108,7 +108,7 @@ /** * returns whether an incidence contains an event */ -CALENDARSUPPORT_EXPORT bool hasEvent(const KCalCore::Incidence::Ptr &incidence); +CALENDARSUPPORT_EXPORT bool hasEvent(const KCalendarCore::Incidence::Ptr &incidence); /** * returns whether an Akonadi item contains a todo @@ -118,7 +118,7 @@ /** * returns whether an incidence contains a todo */ -CALENDARSUPPORT_EXPORT bool hasTodo(const KCalCore::Incidence::Ptr &incidence); +CALENDARSUPPORT_EXPORT bool hasTodo(const KCalendarCore::Incidence::Ptr &incidence); /** * returns whether an Akonadi item contains a journal @@ -128,7 +128,7 @@ /** * returns whether an incidence contains a journal */ -CALENDARSUPPORT_EXPORT bool hasJournal(const KCalCore::Incidence::Ptr &incidence); +CALENDARSUPPORT_EXPORT bool hasJournal(const KCalendarCore::Incidence::Ptr &incidence); /** * returns @p true if the URL represents an Akonadi item and has one of the given mimetypes. @@ -152,9 +152,9 @@ CALENDARSUPPORT_EXPORT bool mimeDataHasIncidence(const QMimeData *mimeData); -CALENDARSUPPORT_EXPORT KCalCore::Todo::List todos(const QMimeData *mimeData); +CALENDARSUPPORT_EXPORT KCalendarCore::Todo::List todos(const QMimeData *mimeData); -CALENDARSUPPORT_EXPORT KCalCore::Incidence::List incidences(const QMimeData *mimeData); +CALENDARSUPPORT_EXPORT KCalendarCore::Incidence::List incidences(const QMimeData *mimeData); /** * creates mime data object for dragging an akonadi item containing an incidence @@ -180,14 +180,14 @@ /** Applies a filter to a list of items containing incidences. Items not containing incidences or not matching the filter are removed. - Helper method anologous to KCalCore::CalFilter::apply() - @see KCalCore::CalFilter::apply() + Helper method anologous to KCalendarCore::CalFilter::apply() + @see KCalendarCore::CalFilter::apply() @param items the list of items to filter @param filter the filter to apply to the list of items @return the filtered list of items */ CALENDARSUPPORT_EXPORT Akonadi::Item::List applyCalFilter(const Akonadi::Item::List &items, - const KCalCore::CalFilter *filter); + const KCalendarCore::CalFilter *filter); /** Shows a modal dialog that allows to select a collection. @@ -223,7 +223,7 @@ const Akonadi::Collection &coll); CALENDARSUPPORT_EXPORT QString subMimeTypeForIncidence( - const KCalCore::Incidence::Ptr &incidence); + const KCalendarCore::Incidence::Ptr &incidence); /** * Returns a list containing work days between @p start and @end. @@ -247,10 +247,10 @@ */ CALENDARSUPPORT_EXPORT QStringList holiday(const QDate &date); -CALENDARSUPPORT_EXPORT QStringList categories(const KCalCore::Incidence::List &incidences); +CALENDARSUPPORT_EXPORT QStringList categories(const KCalendarCore::Incidence::List &incidences); CALENDARSUPPORT_EXPORT bool mergeCalendar(const QString &srcFilename, - const KCalCore::Calendar::Ptr &destCalendar); + const KCalendarCore::Calendar::Ptr &destCalendar); } #endif diff --git a/src/utils.cpp b/src/utils.cpp --- a/src/utils.cpp +++ b/src/utils.cpp @@ -40,15 +40,15 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -74,146 +74,146 @@ using namespace CalendarSupport; using namespace KHolidays; -using namespace KCalCore; +using namespace KCalendarCore; -KCalCore::Incidence::Ptr CalendarSupport::incidence(const Akonadi::Item &item) +KCalendarCore::Incidence::Ptr CalendarSupport::incidence(const Akonadi::Item &item) { //relying on exception for performance reasons try { - return item.payload(); + return item.payload(); } catch (const Akonadi::PayloadException &) { - return KCalCore::Incidence::Ptr(); + return KCalendarCore::Incidence::Ptr(); } } -KCalCore::Event::Ptr CalendarSupport::event(const Akonadi::Item &item) +KCalendarCore::Event::Ptr CalendarSupport::event(const Akonadi::Item &item) { //relying on exception for performance reasons try { - KCalCore::Incidence::Ptr incidence = item.payload(); + KCalendarCore::Incidence::Ptr incidence = item.payload(); if (hasEvent(incidence)) { - return item.payload(); + return item.payload(); } } catch (const Akonadi::PayloadException &) { - return KCalCore::Event::Ptr(); + return KCalendarCore::Event::Ptr(); } - return KCalCore::Event::Ptr(); + return KCalendarCore::Event::Ptr(); } -KCalCore::Event::Ptr CalendarSupport::event(const KCalCore::Incidence::Ptr &incidence) +KCalendarCore::Event::Ptr CalendarSupport::event(const KCalendarCore::Incidence::Ptr &incidence) { if (hasEvent(incidence)) { - return incidence.staticCast(); + return incidence.staticCast(); } - return KCalCore::Event::Ptr(); + return KCalendarCore::Event::Ptr(); } -KCalCore::Incidence::List CalendarSupport::incidencesFromItems(const Akonadi::Item::List &items) +KCalendarCore::Incidence::List CalendarSupport::incidencesFromItems(const Akonadi::Item::List &items) { - KCalCore::Incidence::List incidences; + KCalendarCore::Incidence::List incidences; for (const Akonadi::Item &item : items) { - if (const KCalCore::Incidence::Ptr e = CalendarSupport::incidence(item)) { + if (const KCalendarCore::Incidence::Ptr e = CalendarSupport::incidence(item)) { incidences.push_back(e); } } return incidences; } -KCalCore::Todo::Ptr CalendarSupport::todo(const Akonadi::Item &item) +KCalendarCore::Todo::Ptr CalendarSupport::todo(const Akonadi::Item &item) { try { - KCalCore::Incidence::Ptr incidence = item.payload(); + KCalendarCore::Incidence::Ptr incidence = item.payload(); if (hasTodo(incidence)) { - return item.payload(); + return item.payload(); } } catch (const Akonadi::PayloadException &) { - return KCalCore::Todo::Ptr(); + return KCalendarCore::Todo::Ptr(); } - return KCalCore::Todo::Ptr(); + return KCalendarCore::Todo::Ptr(); } -KCalCore::Todo::Ptr CalendarSupport::todo(const KCalCore::Incidence::Ptr &incidence) +KCalendarCore::Todo::Ptr CalendarSupport::todo(const KCalendarCore::Incidence::Ptr &incidence) { if (hasTodo(incidence)) { - return incidence.staticCast(); + return incidence.staticCast(); } - return KCalCore::Todo::Ptr(); + return KCalendarCore::Todo::Ptr(); } -KCalCore::Journal::Ptr CalendarSupport::journal(const Akonadi::Item &item) +KCalendarCore::Journal::Ptr CalendarSupport::journal(const Akonadi::Item &item) { try { - KCalCore::Incidence::Ptr incidence = item.payload(); + KCalendarCore::Incidence::Ptr incidence = item.payload(); if (hasJournal(incidence)) { - return item.payload(); + return item.payload(); } } catch (const Akonadi::PayloadException &) { - return KCalCore::Journal::Ptr(); + return KCalendarCore::Journal::Ptr(); } - return KCalCore::Journal::Ptr(); + return KCalendarCore::Journal::Ptr(); } -KCalCore::Journal::Ptr CalendarSupport::journal(const KCalCore::Incidence::Ptr &incidence) +KCalendarCore::Journal::Ptr CalendarSupport::journal(const KCalendarCore::Incidence::Ptr &incidence) { if (hasJournal(incidence)) { - return incidence.staticCast(); + return incidence.staticCast(); } - return KCalCore::Journal::Ptr(); + return KCalendarCore::Journal::Ptr(); } bool CalendarSupport::hasIncidence(const Akonadi::Item &item) { - return item.hasPayload(); + return item.hasPayload(); } bool CalendarSupport::hasEvent(const Akonadi::Item &item) { - return item.hasPayload(); + return item.hasPayload(); } -bool CalendarSupport::hasEvent(const KCalCore::Incidence::Ptr &incidence) +bool CalendarSupport::hasEvent(const KCalendarCore::Incidence::Ptr &incidence) { - return incidence && incidence->type() == KCalCore::Incidence::TypeEvent; + return incidence && incidence->type() == KCalendarCore::Incidence::TypeEvent; } bool CalendarSupport::hasTodo(const Akonadi::Item &item) { - return item.hasPayload(); + return item.hasPayload(); } -bool CalendarSupport::hasTodo(const KCalCore::Incidence::Ptr &incidence) +bool CalendarSupport::hasTodo(const KCalendarCore::Incidence::Ptr &incidence) { - return incidence && incidence->type() == KCalCore::Incidence::TypeTodo; + return incidence && incidence->type() == KCalendarCore::Incidence::TypeTodo; } bool CalendarSupport::hasJournal(const Akonadi::Item &item) { - return item.hasPayload(); + return item.hasPayload(); } -bool CalendarSupport::hasJournal(const KCalCore::Incidence::Ptr &incidence) +bool CalendarSupport::hasJournal(const KCalendarCore::Incidence::Ptr &incidence) { - return incidence && incidence->type() == KCalCore::Incidence::TypeJournal; + return incidence && incidence->type() == KCalendarCore::Incidence::TypeJournal; } QMimeData *CalendarSupport::createMimeData(const Akonadi::Item::List &items) { if (items.isEmpty()) { return nullptr; } - KCalCore::MemoryCalendar::Ptr cal(new KCalCore::MemoryCalendar(QTimeZone::systemTimeZone())); + KCalendarCore::MemoryCalendar::Ptr cal(new KCalendarCore::MemoryCalendar(QTimeZone::systemTimeZone())); QList urls; int incidencesFound = 0; for (const Akonadi::Item &item : items) { - const KCalCore::Incidence::Ptr incidence(CalendarSupport::incidence(item)); + const KCalendarCore::Incidence::Ptr incidence(CalendarSupport::incidence(item)); if (!incidence) { continue; } ++incidencesFound; urls.push_back(item.url()); - KCalCore::Incidence::Ptr i(incidence->clone()); + KCalendarCore::Incidence::Ptr i(incidence->clone()); cal->addIncidence(i); } @@ -281,18 +281,18 @@ #endif -static bool itemMatches(const Akonadi::Item &item, const KCalCore::CalFilter *filter) +static bool itemMatches(const Akonadi::Item &item, const KCalendarCore::CalFilter *filter) { assert(filter); - KCalCore::Incidence::Ptr inc = CalendarSupport::incidence(item); + KCalendarCore::Incidence::Ptr inc = CalendarSupport::incidence(item); if (!inc) { return false; } return filter->filterIncidence(inc); } Akonadi::Item::List CalendarSupport::applyCalFilter(const Akonadi::Item::List &items_, - const KCalCore::CalFilter *filter) + const KCalendarCore::CalFilter *filter) { Q_ASSERT(filter); Akonadi::Item::List items(items_); @@ -319,10 +319,10 @@ bool CalendarSupport::isValidIncidenceItemUrl(const QUrl &url) { return isValidIncidenceItemUrl(url, - QStringList() << KCalCore::Event::eventMimeType() - << KCalCore::Todo::todoMimeType() - << KCalCore::Journal::journalMimeType() - << KCalCore::FreeBusy::freeBusyMimeType()); + QStringList() << KCalendarCore::Event::eventMimeType() + << KCalendarCore::Todo::todoMimeType() + << KCalendarCore::Journal::journalMimeType() + << KCalendarCore::FreeBusy::freeBusyMimeType()); } static bool containsValidIncidenceItemUrl(const QList &urls) @@ -363,7 +363,7 @@ const QList urlList = mimeData->urls(); for (const QUrl &i : urlList) { - if (isValidIncidenceItemUrl(i, QStringList() << KCalCore::Todo::todoMimeType())) { + if (isValidIncidenceItemUrl(i, QStringList() << KCalendarCore::Todo::todoMimeType())) { urls.push_back(i); } } @@ -376,35 +376,35 @@ || !incidences(mimeData).isEmpty(); } -KCalCore::Todo::List CalendarSupport::todos(const QMimeData *mimeData) +KCalendarCore::Todo::List CalendarSupport::todos(const QMimeData *mimeData) { - KCalCore::Todo::List todos; + KCalendarCore::Todo::List todos; #ifndef QT_NO_DRAGANDDROP - KCalCore::Calendar::Ptr cal(KCalUtils::DndFactory::createDropCalendar(mimeData)); + KCalendarCore::Calendar::Ptr cal(KCalUtils::DndFactory::createDropCalendar(mimeData)); if (cal) { - const KCalCore::Todo::List calTodos = cal->todos(); + const KCalendarCore::Todo::List calTodos = cal->todos(); todos.reserve(calTodos.count()); - for (const KCalCore::Todo::Ptr &i : calTodos) { - todos.push_back(KCalCore::Todo::Ptr(i->clone())); + for (const KCalendarCore::Todo::Ptr &i : calTodos) { + todos.push_back(KCalendarCore::Todo::Ptr(i->clone())); } } #endif return todos; } -KCalCore::Incidence::List CalendarSupport::incidences(const QMimeData *mimeData) +KCalendarCore::Incidence::List CalendarSupport::incidences(const QMimeData *mimeData) { - KCalCore::Incidence::List incidences; + KCalendarCore::Incidence::List incidences; #ifndef QT_NO_DRAGANDDROP - KCalCore::Calendar::Ptr cal(KCalUtils::DndFactory::createDropCalendar(mimeData)); + KCalendarCore::Calendar::Ptr cal(KCalUtils::DndFactory::createDropCalendar(mimeData)); if (cal) { - const KCalCore::Incidence::List calIncidences = cal->incidences(); + const KCalendarCore::Incidence::List calIncidences = cal->incidences(); incidences.reserve(calIncidences.count()); - for (const KCalCore::Incidence::Ptr &i : calIncidences) { - incidences.push_back(KCalCore::Incidence::Ptr(i->clone())); + for (const KCalendarCore::Incidence::Ptr &i : calIncidences) { + incidences.push_back(KCalendarCore::Incidence::Ptr(i->clone())); } } #endif @@ -708,7 +708,7 @@ return str; } -QString CalendarSupport::subMimeTypeForIncidence(const KCalCore::Incidence::Ptr &incidence) +QString CalendarSupport::subMimeTypeForIncidence(const KCalendarCore::Incidence::Ptr &incidence) { return incidence->mimeType(); } @@ -790,12 +790,12 @@ return hdays; } -QStringList CalendarSupport::categories(const KCalCore::Incidence::List &incidences) +QStringList CalendarSupport::categories(const KCalendarCore::Incidence::List &incidences) { QStringList cats, thisCats; // @TODO: For now just iterate over all incidences. In the future, // the list of categories should be built when reading the file. - for (const KCalCore::Incidence::Ptr &incidence : incidences) { + for (const KCalendarCore::Incidence::Ptr &incidence : incidences) { thisCats = incidence->categories(); const QStringList::ConstIterator send(thisCats.constEnd()); for (QStringList::ConstIterator si = thisCats.constBegin(); @@ -809,7 +809,7 @@ } bool CalendarSupport::mergeCalendar(const QString &srcFilename, - const KCalCore::Calendar::Ptr &destCalendar) + const KCalendarCore::Calendar::Ptr &destCalendar) { if (srcFilename.isEmpty()) { qCCritical(CALENDARSUPPORT_LOG) << "Empty filename."; @@ -822,7 +822,7 @@ // merge in a file destCalendar->startBatchAdding(); - KCalCore::FileStorage storage(destCalendar); + KCalendarCore::FileStorage storage(destCalendar); storage.setFileName(srcFilename); bool loadedSuccesfully = storage.load(); destCalendar->endBatchAdding();