Commit 00f940aa authored by Volker Krause's avatar Volker Krause
Browse files

Fix building with KF deprecation level 5.95 or higher

parent c1608ebf
Pipeline #257463 passed with stage
in 11 minutes and 22 seconds
......@@ -10,6 +10,7 @@
#include "timelinemodel.h"
#if HAVE_KHOLIDAYS
#include <kholidays_version.h>
#include <KHolidays/HolidayRegion>
#endif
......@@ -114,7 +115,11 @@ void TimelineSectionDelegateController::recheckHoliday()
const auto holidayRegion = KHolidays::HolidayRegion(holidayRegionCode);
if (holidayRegion.isValid()) {
#if KHOLIDAYS_VERSION < QT_VERSION_CHECK(5, 95, 0)
m_holidays = holidayRegion.holidays(m_date);
#else
m_holidays = holidayRegion.rawHolidaysWithAstroSeasons(m_date);
#endif
// prioritize non-workdays
std::sort(m_holidays.begin(), m_holidays.end(), [](const auto &lhs, const auto &rhs) {
return lhs.dayType() == KHolidays::Holiday::NonWorkday && rhs.dayType() == KHolidays::Holiday::Workday;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment