Commit b786ff50 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile without deprecated methods

parent 172aa1e0
Pipeline #181231 passed with stage
in 3 minutes and 17 seconds
......@@ -132,7 +132,7 @@ configure_file(src/config-kalarm.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kala
include_directories(${kalarm_SOURCE_DIR} ${kalarm_BINARY_DIR})
add_definitions(-DQT_MESSAGELOGCONTEXT)
ecm_set_disabled_deprecation_versions(QT 5.15.2 KF 5.94.0)
ecm_set_disabled_deprecation_versions(QT 5.15.2 KF 5.95.0)
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" OFF)
......
......@@ -22,6 +22,7 @@
#include "lib/synchtimer.h"
#include <KHolidays/HolidayRegion>
#include <kholidays_version.h>
#include <KLocalizedString>
#include <QMenu>
......@@ -194,7 +195,12 @@ void DayMatrix::updateView()
// Find which holidays occur for the dates in the matrix.
const KHolidays::HolidayRegion& region = Preferences::holidays();
#if KHOLIDAYS_VERSION < QT_VERSION_CHECK(5, 95, 0)
const KHolidays::Holiday::List list = region.holidays(mStartDate, mStartDate.addDays(NUMDAYS-1));
#else
const KHolidays::Holiday::List list = region.rawHolidaysWithAstroSeasons(mStartDate, mStartDate.addDays(NUMDAYS-1));
#endif
QHash<QDate, QStringList> holidaysByDate;
for (const KHolidays::Holiday& holiday : list)
if (!holiday.name().isEmpty())
......@@ -481,7 +487,11 @@ void DayMatrix::paintEvent(QPaintEvent*)
QSet<QDate> nonWorkHolidays;
{
const KHolidays::HolidayRegion& region = Preferences::holidays();
#if KHOLIDAYS_VERSION < QT_VERSION_CHECK(5, 95, 0)
const KHolidays::Holiday::List list = region.holidays(mStartDate, mStartDate.addDays(NUMDAYS-1));
#else
const KHolidays::Holiday::List list = region.rawHolidaysWithAstroSeasons(mStartDate, mStartDate.addDays(NUMDAYS-1));
#endif
for (const KHolidays::Holiday& holiday : list)
if (holiday.dayType() == KHolidays::Holiday::NonWorkday)
nonWorkHolidays += holiday.observedStartDate();
......
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