aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmltypeloader.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-11-22 14:08:35 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-11-23 17:20:01 +0100
commit220c1031fc3e0957c4d94c42d30fb33d1e023929 (patch)
tree36cde144a554861eb1d2a28fbb304467ffe0f187 /src/qml/qml/qqmltypeloader.cpp
parent16683799681578d076c46b71f77d326ac304cc6e (diff)
QQmlTypeLoader: Don't parse qmldir content multiple times
The content of a qmldir file at a specific URL should really never change. If it does, we have bigger problems. In order to forget the qmldir contents we can already do QQmlTypeLoader::clearCache(). Fixes: QTBUG-30467 Change-Id: Ic1b3662695254d8be5beaa65ca9cd76eab56e2e2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmltypeloader.cpp')
-rw-r--r--src/qml/qml/qqmltypeloader.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index c6c3ee5523..6c12de926c 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -1116,7 +1116,8 @@ void QQmlTypeLoader::setQmldirContent(const QString &url, const QString &content
m_importQmlDirCache.insert(url, qmldir);
}
- qmldir->setContent(url, content);
+ if (!qmldir->hasContent())
+ qmldir->setContent(url, content);
}
/*!