aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlmetatype_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/qqmlmetatype_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/qqmlmetatype_p.h')
-rw-r--r--src/qml/qml/qqmlmetatype_p.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/qml/qml/qqmlmetatype_p.h b/src/qml/qml/qqmlmetatype_p.h
index 5ba13ff4ee..2d22eb519f 100644
--- a/src/qml/qml/qqmlmetatype_p.h
+++ b/src/qml/qml/qqmlmetatype_p.h
@@ -59,6 +59,7 @@ QT_BEGIN_NAMESPACE
class QQmlTypeModule;
class QMutex;
+class QQmlError;
class Q_QML_PRIVATE_EXPORT QQmlMetaType
{
@@ -68,6 +69,12 @@ public:
static QQmlType registerSingletonType(const QQmlPrivate::RegisterSingletonType &type);
static QQmlType registerCompositeSingletonType(const QQmlPrivate::RegisterCompositeSingletonType &type);
static QQmlType registerCompositeType(const QQmlPrivate::RegisterCompositeType &type);
+ static bool registerPluginTypes(QObject *instance, const QString &basePath,
+ const QString &uri, const QString &typeNamespace, int vmaj,
+ QList<QQmlError> *errors);
+ static QQmlType typeForUrl(const QString &urlString, const QHashedStringRef& typeName,
+ bool isCompositeSingleton, QList<QQmlError> *errors,
+ int majorVersion = -1, int minorVersion = -1);
static void unregisterType(int type);
@@ -145,12 +152,6 @@ public:
static void prependCachedUnitLookupFunction(QQmlPrivate::QmlUnitCacheLookupFunction handler);
static void removeCachedUnitLookupFunction(QQmlPrivate::QmlUnitCacheLookupFunction handler);
- static bool namespaceContainsRegistrations(const QString &, int majorVersion);
-
- static void protectNamespace(const QString &);
-
- static void setTypeRegistrationNamespace(const QString &);
-
static QMutex *typeRegistrationLock();
static QString prettyTypeName(const QObject *object);
@@ -171,9 +172,6 @@ public:
static int registerUnitCacheHook(const QQmlPrivate::RegisterQmlUnitCacheHook &hookRegistration);
static void clearTypeRegistrations();
- static void startRecordingTypeRegFailures(QStringList *failures);
- static void stopRecordingTypeRegFailures();
-
static QList<QQmlProxyMetaObject::ProxyData> proxyData(const QMetaObject *mo,
const QMetaObject *baseMetaObject,
QMetaObject *lastMetaObject);