Commit 83d42687 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile without foreach

parent 61a14566
......@@ -47,6 +47,10 @@ find_package(KF5IdentityManagement ${IDENTITYMANAGER_LIB_VERSION} CONFIG REQUIRE
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
add_definitions(-DTRANSLATION_DOMAIN=\"libkalarmcal5\")
if (${KF5Config_VERSION} STRGREATER "5.56.0")
add_definitions(-DQT_NO_FOREACH)
MESSAGE(STATUS "compile without foreach")
endif()
########### Targets ###########
......
......@@ -2355,7 +2355,7 @@ KADateTime KADateTime::fromString(const QString &string, const QString &format,
// abbreviation applies at the specified date/time.
bool useUtcOffset = false;
const QList<QByteArray> zoneIds = QTimeZone::availableTimeZoneIds();
Q_FOREACH(const QByteArray& zoneId, zoneIds) {
for (const QByteArray& zoneId : zoneIds) {
const QTimeZone z(zoneId);
qdt.setTimeZone(z);
if (z.abbreviation(qdt) == zoneAbbrev) {
......@@ -2393,7 +2393,7 @@ KADateTime KADateTime::fromString(const QString &string, const QString &format,
dtUTC.setTimeSpec(Qt::UTC);
dtUTC = dtUTC.addSecs(-utcOffset);
const QList<QByteArray> zoneIds = QTimeZone::availableTimeZoneIds();
Q_FOREACH(const QByteArray& zoneId, zoneIds) {
for (const QByteArray& zoneId : zoneIds) {
const QTimeZone z(zoneId);
if (z.offsetFromUtc(dtUTC) == utcOffset) {
// Found a time zone which uses this offset at the specified time
......
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