summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@nokia.com>2012-02-03 12:54:25 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-07 08:53:18 +0100
commitb8cf1d6bdcaefaa610014a742808af3ab2c6fe06 (patch)
tree39d3acf1f3469b52024dff2cc159f7fe90ad9637 /src
parent56265031b763736163f1a229a7e7e6b7aaec8a36 (diff)
Remove QMetaType::unregisterType().
The function hasn't been working properly. It was not well tested, for example it is undefined how QVariant should behave if it contains an instance of an unregistered type. Concept of unregistering types was inspired by plug-in system, but in most supported platforms we do not unload plug-ins. Idea of type unregistering may block optimizations in meta object system, because it would be not possible to cache a type id. QMetaType::type() could return different ids for the same name. Currently QMetaType::unregisterType() is not used in Qt. Change-Id: I878b6e8d91de99f9bcefeab73af2e2ba0bd0cba0 Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qmetatype.cpp30
-rw-r--r--src/corelib/kernel/qmetatype.h1
2 files changed, 0 insertions, 31 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 50b11e0e98..b31bece376 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -532,36 +532,6 @@ int QMetaType::registerTypedef(const char* typeName, int aliasId)
}
/*!
- \since 4.4
-
- Unregisters a user type, with \a typeName.
-
- \sa type(), typeName()
- */
-void QMetaType::unregisterType(const char *typeName)
-{
- QVector<QCustomTypeInfo> *ct = customTypes();
- if (!ct || !typeName)
- return;
-
-#ifdef QT_NO_QOBJECT
- NS(QByteArray) normalizedTypeName = typeName;
-#else
- NS(QByteArray) normalizedTypeName = QMetaObject::normalizedType(typeName);
-#endif
- QWriteLocker locker(customTypesLock());
- for (int v = 0; v < ct->count(); ++v) {
- if (ct->at(v).typeName == typeName) {
- QCustomTypeInfo &inf = (*ct)[v];
- inf.typeName.clear();
- inf.creator = 0;
- inf.deleter = 0;
- inf.alias = -1;
- }
- }
-}
-
-/*!
Returns true if the datatype with ID \a type is registered;
otherwise returns false.
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 0ea9d26394..e99c93c372 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -247,7 +247,6 @@ public:
static void destroy(int type, void *data);
static void *construct(int type, void *where, const void *copy);
static void destruct(int type, void *where);
- static void unregisterType(const char *typeName);
#ifndef QT_NO_DATASTREAM
static bool save(QDataStream &stream, int type, const void *data);