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

It compiles fine without foreach

parent 940e98bc
......@@ -33,6 +33,10 @@ include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(FeatureSummary)
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
if (${KF5Config_VERSION} STRGREATER "5.56.0")
add_definitions(-DQT_NO_FOREACH)
MESSAGE(STATUS "compile without foreach")
endif()
ADD_SUBDIRECTORY(doc)
ADD_SUBDIRECTORY(data)
......
......@@ -213,7 +213,7 @@ void TopLevel::setTeaList(const QList<Tea> &tealist) {
void TopLevel::loadTeaMenuItems() {
int i=0;
foreach(const Tea &t, m_tealist) {
for (const Tea &t : qAsConst(m_tealist)) {
QAction *a = contextMenu()->addAction(
i18nc( "%1 - name of the tea, %2 - the predefined time for "
"the tea", "%1 (%2)", t.name(), t.timeToString() )
......
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