Commit 566c3a86 authored by Volker Krause's avatar Volker Krause
Browse files

Use QMultiMapIterator when iterating over a QMultiMap with Qt 6

Doesn't compile with QMapIterator there anymore.
parent 31bb2ada
Pipeline #247286 passed with stage
in 31 minutes and 42 seconds
......@@ -61,7 +61,11 @@ void RemoveCollectionRecursiveTask::onMailBoxesReceived(const QList<KIMAP::MailB
mFolderFound = true;
// Now start the actual deletion work
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
mFolderIterator.reset(new QMapIterator<int, KIMAP::MailBoxDescriptor>(foldersToDelete));
#else
mFolderIterator.reset(new QMultiMapIterator<int, KIMAP::MailBoxDescriptor>(foldersToDelete));
#endif
mFolderIterator->toBack(); // we start with largest nesting value first
deleteNextMailbox();
......
......@@ -32,5 +32,9 @@ private:
KIMAP::Session *mSession = nullptr;
bool mFolderFound = false;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QScopedPointer<QMapIterator<int, KIMAP::MailBoxDescriptor>> mFolderIterator;
#else
QScopedPointer<QMultiMapIterator<int, KIMAP::MailBoxDescriptor>> mFolderIterator;
#endif
};
Supports Markdown
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