aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlmetatypedata_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-02-01 14:51:15 +0100
committerUlf Hermann <ulf.hermann@qt.io>2019-02-08 09:24:43 +0000
commit56a5103781a17a2ae0369bbd468d7103d8df6d6b (patch)
tree8c34822bbe2c332c6b6a57e968785a21ec8bbfc2 /src/qml/qml/qqmlmetatypedata_p.h
parent92f2447cf3850303f161271c049a5b8d0a55b9f5 (diff)
Move registration functions from qqmlimport.cpp to qqmlmetatype.cpp
These functions require the metatype data in multiple interdependent places. If they are executed concurrently data races are almost guaranteed. Move the functions to qqmlmetatype.cpp and keep the metatype mutex locked for their duration. Access to the internals of the metatype system also allows us to significantly simplify the logic. Additionally we can remove methods only used by those functions from the public interface of QQmlMetaType now. Task-number: QTBUG-73271 Change-Id: I1279259cca5cb5be63026d5b74f5d013e7a1ac5c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlmetatypedata_p.h')
-rw-r--r--src/qml/qml/qqmlmetatypedata_p.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/qml/qml/qqmlmetatypedata_p.h b/src/qml/qml/qqmlmetatypedata_p.h
index 17409ed51d..cde6294c37 100644
--- a/src/qml/qml/qqmlmetatypedata_p.h
+++ b/src/qml/qml/qqmlmetatypedata_p.h
@@ -115,20 +115,21 @@ struct QQmlMetaTypeData
QQmlPropertyCache *propertyCache(const QMetaObject *metaObject);
QQmlPropertyCache *propertyCache(const QQmlType &type, int minorVersion);
- void startRecordingTypeRegFailures(QStringList *storage)
- { typeRegistrationFailures = storage; }
- void stopRecordingTypeRegFailures()
- { startRecordingTypeRegFailures(nullptr); }
+ void setTypeRegistrationFailures(QStringList *failures)
+ {
+ m_typeRegistrationFailures = failures;
+ }
+
void recordTypeRegFailure(const QString &message)
{
- if (typeRegistrationFailures)
- typeRegistrationFailures->append(message);
+ if (m_typeRegistrationFailures)
+ m_typeRegistrationFailures->append(message);
else
qWarning("%s", message.toUtf8().constData());
}
private:
- QStringList *typeRegistrationFailures = nullptr;
+ QStringList *m_typeRegistrationFailures = nullptr;
};
inline uint qHash(const QQmlMetaTypeData::VersionedUri &v)