Commit 5331a865 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

It compiles without foreach:

parent 20b4ef97
......@@ -68,6 +68,10 @@ if (${Qt5Widgets_VERSION} STRGREATER "5.13")
else()
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
endif()
if (${KF5Config_VERSION} STRGREATER "5.56.0")
add_definitions(-DQT_NO_FOREACH)
MESSAGE(STATUS "compile without foreach")
endif()
add_subdirectory(libfollowupreminder)
add_subdirectory(libkdepimdbusinterfaces)
......
......@@ -481,7 +481,8 @@ QString GrantleeContactFormatter::toHtml(HtmlForm form) const
bool addUrl = false;
// check whether it is a custom local field
foreach (const QVariantMap &description, customFieldDescriptions()) {
for (int i = 0; i < customFieldDescriptions().size(); ++i) {
const QVariantMap description = customFieldDescriptions().at(i);
if (description.value(QStringLiteral("key")).toString() == key) {
key = description.value(QStringLiteral("title")).toString();
const QString descriptionType = description.value(QStringLiteral("type")).toString();
......
......@@ -169,7 +169,8 @@ QString GrantleeContactGroupFormatter::toHtml(HtmlForm form) const
// Additional fields
QVariantList fields;
foreach (const QVariantMap &field, additionalFields()) {
for (int i = 0; i < additionalFields().size(); ++i) {
const QVariantMap field = additionalFields().at(i);
QVariantHash fieldObject;
setHashField(fieldObject, QStringLiteral("key"),
field.value(QStringLiteral("key")).toString());
......
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