summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2018-01-22 12:23:09 +0100
committerChristian Stenger <christian.stenger@qt.io>2018-01-22 13:58:57 +0000
commit3e81fe628a5e7787ef015616754b2f3a79bceb41 (patch)
treef40cb498cc28c37c0abf1985fc0b2eb1d64286c7 /src/plugins
parente8d7a1f21eaead61459f2970e59178099da6f8ff (diff)
downloadqt-creator-3e81fe628a5e7787ef015616754b2f3a79bceb41.tar.gz
QmlJSEditor: Avoid detaching of containers
Change-Id: I52bb5b073793c11cf157cb72244ba3552ca1ac72 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/qmljseditor/qmljseditordocument.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/qmljseditor/qmljseditordocument.cpp b/src/plugins/qmljseditor/qmljseditordocument.cpp
index 79c348ecc4..66fa6da393 100644
--- a/src/plugins/qmljseditor/qmljseditordocument.cpp
+++ b/src/plugins/qmljseditor/qmljseditordocument.cpp
@@ -43,6 +43,8 @@
#include <qmljstools/qmljsmodelmanager.h>
#include <qmljstools/qmljsqtstylecodeformatter.h>
+#include <utils/asconst.h>
+
using namespace QmlJSEditor;
using namespace QmlJS;
using namespace QmlJS::AST;
@@ -625,13 +627,13 @@ void QmlJSEditorDocumentPrivate::createTextMarks(const SemanticInfo &info)
m_semanticMarks.removeAll(mark);
delete mark;
};
- for (const DiagnosticMessage &diagnostic : info.semanticMessages) {
+ for (const DiagnosticMessage &diagnostic : Utils::asConst(info.semanticMessages)) {
auto mark = new QmlJSTextMark(q->filePath().toString(),
diagnostic, onMarkRemoved);
m_semanticMarks.append(mark);
q->addMark(mark);
}
- for (const QmlJS::StaticAnalysis::Message &message : info.staticAnalysisMessages) {
+ for (const QmlJS::StaticAnalysis::Message &message : Utils::asConst(info.staticAnalysisMessages)) {
auto mark = new QmlJSTextMark(q->filePath().toString(),
message, onMarkRemoved);
m_semanticMarks.append(mark);