forked from qt-creator/qt-creator
qmljs: avoid reset if C++ types did not really change
Change-Id: I00b59a6b140eb33e2f3206f11e6ab0f9b470dff0 Reviewed-by: Marco Bubke <marco.bubke@digia.com>
This commit is contained in:
@@ -1250,8 +1250,20 @@ void ModelManagerInterface::updateCppQmlTypes(QFutureInterface<void> &interface,
|
|||||||
hasNewInfo = hasNewInfo || newData.remove(fileName) > 0;
|
hasNewInfo = hasNewInfo || newData.remove(fileName) > 0;
|
||||||
} else {
|
} else {
|
||||||
CppData &data = newData[fileName];
|
CppData &data = newData[fileName];
|
||||||
// currently we have no simple way to compare, so we assume the worse
|
if (!hasNewInfo && (data.exportedTypes.size() != exported.size()
|
||||||
hasNewInfo = true;
|
|| data.contextProperties != contextProperties))
|
||||||
|
hasNewInfo = true;
|
||||||
|
if (!hasNewInfo) {
|
||||||
|
QHash<QString, QByteArray> newFingerprints;
|
||||||
|
foreach (LanguageUtils::FakeMetaObject::ConstPtr newType, exported)
|
||||||
|
newFingerprints[newType->className()]=newType->fingerprint();
|
||||||
|
foreach (LanguageUtils::FakeMetaObject::ConstPtr oldType, data.exportedTypes) {
|
||||||
|
if (newFingerprints.value(oldType->className()) != oldType->fingerprint()) {
|
||||||
|
hasNewInfo = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
data.exportedTypes = exported;
|
data.exportedTypes = exported;
|
||||||
data.contextProperties = contextProperties;
|
data.contextProperties = contextProperties;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user