From e3b1106afae5de6cd54ce627a0b11be041624591 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 24 Jul 2019 13:43:54 +0200 Subject: Compile fix with recent Qt dev The reasoning in 1b4766e26c6b did not take into account that the scope of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with f70905448f6 in Qt base. Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d Reviewed-by: Eike Ziller --- src/plugins/qmljseditor/qmljsfindreferences.cpp | 5 ++--- src/plugins/qmljseditor/qmljswrapinloader.cpp | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'src/plugins/qmljseditor') diff --git a/src/plugins/qmljseditor/qmljsfindreferences.cpp b/src/plugins/qmljseditor/qmljsfindreferences.cpp index 57796ea4bb..670fc69282 100644 --- a/src/plugins/qmljseditor/qmljsfindreferences.cpp +++ b/src/plugins/qmljseditor/qmljsfindreferences.cpp @@ -814,9 +814,8 @@ static void find_helper(QFutureInterface &future, // update snapshot from workingCopy to make sure it's up to date // ### remove? // ### this is a great candidate for map-reduce - QHashIterator< QString, QPair > it(workingCopy.all()); - while (it.hasNext()) { - it.next(); + const ModelManagerInterface::WorkingCopy::Table &all = workingCopy.all(); + for (auto it = all.cbegin(), end = all.cend(); it != end; ++it) { const QString fileName = it.key(); Document::Ptr oldDoc = snapshot.document(fileName); if (oldDoc && oldDoc->editorRevision() == it.value().second) diff --git a/src/plugins/qmljseditor/qmljswrapinloader.cpp b/src/plugins/qmljseditor/qmljswrapinloader.cpp index 3766dcdbbf..d83d34e23e 100644 --- a/src/plugins/qmljseditor/qmljswrapinloader.cpp +++ b/src/plugins/qmljseditor/qmljswrapinloader.cpp @@ -139,9 +139,7 @@ public: // handle inner ids QString innerIdForwarders; - QHashIterator it(innerIds); - while (it.hasNext()) { - it.next(); + for (auto it = innerIds.cbegin(), end = innerIds.cend(); it != end; ++it) { const QString innerId = it.key(); comment += tr("// Rename all outer uses of the id \"%1\" to \"%2.item.%1\".\n").arg( innerId, loaderId); -- cgit v1.2.1