diff options
author | Chris Adams <christopher.adams@nokia.com> | 2012-05-14 13:01:29 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-12 15:40:13 +0200 |
commit | 3c0973b75a8ea8ac3339ec00f7d4c09f0ae8983f (patch) | |
tree | e5722ec40ad1450a37d698d6062515fb4328b502 /src/qml | |
parent | 41e8b0e0d990f34913449de6456a13371f4f9297 (diff) |
Remove non-templated qobject module api registration function
Previously, both templated and non-templated qobject module api
registration functions were provided as public API. The non-templated
version is identical to the templated version, except that bindings
which access properties of module apis registered with that function
cannot be optimized with v4.
This commit removes the non-templated version of the function.
Change-Id: Ic417aa241f1172bf6d055bdc7f528d7e9304097b
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/doc/src/qtqml.qdoc | 9 | ||||
-rw-r--r-- | src/qml/qml/qqml.h | 14 | ||||
-rw-r--r-- | src/qml/qml/qqmlmetatype.cpp | 3 |
3 files changed, 0 insertions, 26 deletions
diff --git a/src/qml/doc/src/qtqml.qdoc b/src/qml/doc/src/qtqml.qdoc index 7bd797e8d0..915f54e22c 100644 --- a/src/qml/doc/src/qtqml.qdoc +++ b/src/qml/doc/src/qtqml.qdoc @@ -279,15 +279,6 @@ */ /*! - \internal - \fn int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMinor, QObject *(*callback)(QQmlEngine *, QJSEngine *)) - \deprecated - - Any uses of a module API in a binding where that module API was registered with this - function instead of the template version will result in suboptimal binding generation. - */ - -/*! \fn template<typename T> int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMinor, QObject *(*callback)(QQmlEngine *, QJSEngine *)) \relates QQmlEngine diff --git a/src/qml/qml/qqml.h b/src/qml/qml/qqml.h index fedd0e417a..c7092a6c76 100644 --- a/src/qml/qml/qqml.h +++ b/src/qml/qml/qqml.h @@ -416,20 +416,6 @@ inline int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMi return QQmlPrivate::qmlregister(QQmlPrivate::ModuleApiRegistration, &api); } -inline int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMinor, - QObject *(*callback)(QQmlEngine *, QJSEngine *)) -{ - QQmlPrivate::RegisterModuleApi api = { - 0, - - uri, versionMajor, versionMinor, - - 0, callback, 0 // unknown QObject instance type - }; - - return QQmlPrivate::qmlregister(QQmlPrivate::ModuleApiRegistration, &api); -} - template <typename T> inline int qmlRegisterModuleApi(const char *uri, int versionMajor, int versionMinor, QObject *(*callback)(QQmlEngine *, QJSEngine *)) diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index 416caa9c63..80fb3edac0 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -909,9 +909,6 @@ int registerModuleApi(const QQmlPrivate::RegisterModuleApi &api) import.qobject = api.qobjectApi; import.instanceMetaObject = (api.qobjectApi && api.version >= 1) ? api.instanceMetaObject : 0; // BC with version 0. - if (import.qobject && !import.instanceMetaObject) // BC - check import.iMO rather than api.iMO. - qWarning() << "qmlRegisterModuleApi(): sub-optimal: use the templated version of this function instead!"; - int index = data->moduleApiCount++; QQmlMetaTypeData::ModuleApiList *apiList = data->moduleApis.value(uri); |