Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit d1848f10 authored by Laurent Montel's avatar Laurent Montel 😁

Make it compile without foreach

parent 3978394f
......@@ -91,7 +91,11 @@ install(
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
if (${KF5Config_VERSION} STRGREATER "5.56.0")
add_definitions(-DQT_NO_FOREACH)
MESSAGE(STATUS "compile without foreach")
endif()
add_subdirectory(src)
......@@ -99,3 +103,5 @@ install(
FILES calendarsupport.categories calendarsupport.renamecategories
DESTINATION ${KDE_INSTALL_CONFDIR}
)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
......@@ -728,7 +728,7 @@ QList<QDate> CalendarSupport::workDays(const QDate &startDate, const QDate &endD
}
if (KCalPrefs::instance()->mExcludeHolidays) {
foreach (const QString &regionStr, KCalPrefs::instance()->mHolidays) {
for (const QString &regionStr : qAsConst(KCalPrefs::instance()->mHolidays)) {
KHolidays::HolidayRegion region(regionStr);
if (region.isValid()) {
const KHolidays::Holiday::List list = region.holidays(startDate, endDate);
......@@ -751,7 +751,7 @@ QStringList CalendarSupport::holiday(const QDate &date)
QStringList hdays;
bool showCountryCode = (KCalPrefs::instance()->mHolidays.count() > 1);
foreach (const QString &regionStr, KCalPrefs::instance()->mHolidays) {
for (const QString &regionStr : qAsConst(KCalPrefs::instance()->mHolidays)) {
KHolidays::HolidayRegion region(regionStr);
if (region.isValid()) {
const Holiday::List list = region.holidays(date);
......
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