Commit d33773cc authored by John Layt's avatar John Layt

KF5::Holidays port to changed API

Port all kdepim apps to use the changed headers and api from the KF5
release of KHolidays.
parent bd2b7b5d
......@@ -35,7 +35,7 @@
#include <Akonadi/Calendar/PublishDialog>
#include <akonadi/calendar/calendarsettings.h>
#include <KHolidays/kholidays/Holidays>
#include <KHolidays/HolidayRegion>
#include <KIdentityManagement/IdentityManager>
......@@ -679,7 +679,7 @@ QList<QDate> CalendarSupport::workDays(const QDate &startDate,
for (int i = 0; i < listCount; ++i) {
const Holiday &h = list.at(i);
if (h.dayType() == Holiday::NonWorkday) {
result.removeAll(h.date());
result.removeAll(h.observedStartDate());
}
}
}
......@@ -696,7 +696,7 @@ QStringList CalendarSupport::holiday(const QDate &date)
const int listCount = list.count();
hdays.reserve(listCount);
for (int i = 0; i < listCount; ++i) {
hdays.append(list.at(i).text());
hdays.append(list.at(i).name());
}
return hdays;
}
......
......@@ -51,7 +51,7 @@
using namespace KCalCore;
#include <KIdentityManagement/kidentitymanagement/identitymanager.h>
#include <KIdentityManagement/kidentitymanagement/identity.h>
#include <KHolidays/kholidays/holidays.h>
#include <KHolidays/HolidayRegion>
#include <kconfiggroup.h>
#include <KSharedConfig>
......
......@@ -55,7 +55,7 @@
#include <kalarmcal/identities.h>
#include <KHolidays/kholidays/holidays.h>
#include <KHolidays/HolidayRegion>
using namespace KHolidays;
#include <kvbox.h>
......
......@@ -29,7 +29,7 @@
#include <KIdentityManagement/kidentitymanagement/identity.h>
#include <KIdentityManagement/kidentitymanagement/identitymanager.h>
#include <KHolidays/kholidays/holidays.h>
#include <KHolidays/HolidayRegion>
#include <kglobal.h>
#include <KSharedConfig>
......
......@@ -44,7 +44,7 @@
#include "reminderclient.h"
#include "kocheckableproxymodel.h"
#include <KHolidays/kholidays/Holidays>
#include <KHolidays/HolidayRegion>
#include <calendarsupport/collectionselection.h>
#include <calendarsupport/eventarchiver.h>
......@@ -1076,7 +1076,7 @@ void ActionManager::exportHTML(KOrg::HTMLExportSettings *settings, bool autoMode
KHolidays::Holiday::List holidays = KOGlobals::self()->holidays()->holidays(
settings->dateStart().date(), settings->dateEnd().date());
foreach (const KHolidays::Holiday &holiday, holidays) {
exportJob->addHoliday(holiday.date(), holiday.text());
exportJob->addHoliday(holiday.observedStartDate(), holiday.name());
}
}
......
......@@ -53,7 +53,7 @@
#include "korganizer_debug.h"
#include <incidenceeditor-ng/globalsettings.h>
#include <KHolidays/kholidays/Holidays>
#include <KHolidays/HolidayRegion>
#include <calendarsupport/collectiongeneralpage.h>
#include <calendarsupport/collectionselection.h>
#include <calendarsupport/kcalprefs.h>
......
......@@ -25,7 +25,7 @@
#include "koglobals.h"
#include "prefs/koprefs.h"
#include <KHolidays/kholidays/HolidayRegion>
#include <KHolidays/HolidayRegion>
#include <KIconLoader>
......@@ -87,7 +87,7 @@ QMap<QDate, QStringList> KOGlobals::holiday(const QDate &start, const QDate &end
const KHolidays::Holiday::List list = mHolidays->holidays(start, end);
for (int i = 0; i < list.count(); ++i) {
const KHolidays::Holiday &h = list.at(i);
holidaysByDate[h.date()].append(h.text());
holidaysByDate[h.observedStartDate()].append(h.name());
}
return holidaysByDate;
}
......@@ -111,9 +111,9 @@ QList<QDate> KOGlobals::workDays(const QDate &startDate,
const KHolidays::Holiday::List list = mHolidays->holidays(startDate, endDate);
for (int i = 0; i < list.count(); ++i) {
const KHolidays::Holiday &h = list.at(i);
const QString dateString = h.date().toString();
const QString dateString = h.observedStartDate().toString();
if (h.dayType() == KHolidays::Holiday::NonWorkday) {
result.removeAll(h.date());
result.removeAll(h.observedStartDate());
}
}
}
......
......@@ -46,7 +46,7 @@
#include <KIconLoader>
#include <KConfigGroup>
#include <QDesktopServices>
#include <KHolidays/kholidays/Holidays>
#include <KHolidays/HolidayRegion>
#include <QDate>
#include <QEvent>
......@@ -394,7 +394,7 @@ void SDSummaryWidget::createLabels()
entry.category = ((*it).dayType() == Holiday::NonWorkday) ?
CategoryHoliday : CategoryOther;
entry.date = dt;
entry.summary = (*it).text();
entry.summary = (*it).name();
dateDiff(dt, entry.daysTo, entry.yearsOld);
entry.yearsOld = -1; //ignore age of holidays
entry.span = 1;
......
......@@ -49,7 +49,7 @@
#include <KCalCore/Event>
#include <KCalCore/Journal>
#include <KHolidays/Holidays>
#include <KHolidays/HolidayRegion>
#include <MailTransport/TransportManagementWidget>
......
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