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 7b85b62c authored by Laurent Montel's avatar Laurent Montel 😁

Make it compile without foreach

parent 22c5e014
......@@ -35,6 +35,7 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX KMBOX
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
add_definitions(-DQT_NO_FOREACH)
########### Targets ###########
add_subdirectory(src)
......
......@@ -68,7 +68,8 @@ void MBoxBenchmark::testNoLockPerformance()
mbox2.setLockType(MBox::None);
mbox2.setUnlockTimeout(5000);
mbox2.load(fileName());
foreach (const MBoxEntry &entry, mbox2.entries()) {
const auto lst = mbox2.entries();
for (const MBoxEntry &entry : lst) {
mbox2.readMessage(entry);
}
}
......@@ -95,7 +96,8 @@ void MBoxBenchmark::testProcfileLockPerformance()
mbox2.load(fileName());
mbox2.setUnlockTimeout(5000); // Keep the mbox locked for five seconds.
foreach (const MBoxEntry &entry, mbox2.entries()) {
const auto lst = mbox2.entries();
for (const MBoxEntry &entry : lst) {
mbox2.readMessage(entry);
}
}
......
......@@ -195,8 +195,8 @@ void MboxTest::testAppend()
QCOMPARE(mbox.entries().last().messageSize(), static_cast<quint64>(sEntry2.size()));
// check if appended entries can be read
MBoxEntry::List list = mbox.entries();
foreach (const MBoxEntry &msgInfo, list) {
const MBoxEntry::List list = mbox.entries();
for (const MBoxEntry &msgInfo : list) {
const QByteArray header = mbox.readMessageHeaders(msgInfo);
QVERIFY(!header.isEmpty());
......@@ -433,7 +433,7 @@ void MboxTest::testHeaders()
const MBoxEntry::List list = mbox.entries();
foreach (const MBoxEntry &msgInfo, list) {
for (const MBoxEntry &msgInfo : list) {
const QByteArray header = mbox.readMessageHeaders(msgInfo);
QVERIFY(!header.isEmpty());
......
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