diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-01-06 10:56:06 +1000 |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2011-01-06 10:56:06 +1000 |
commit | 5c11ca38c441dd0e4e105ca0b5372dc917cf31b1 (patch) | |
tree | 47a8fd4596d16b25d893052f6b13309f2594b687 | |
parent | c3a4ce70e588620393a9a4189f3e429622103406 (diff) |
Ensure QDeclarativePrivate::RegisterType version is updated and checked.
Also exclude from bic check since we expect its size to increase from
time to time.
Task-number: QTBUG-13451
Reviewed-by: Aaron Kennedy
-rw-r--r-- | src/declarative/qml/qdeclarative.h | 4 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativemetatype.cpp | 3 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeprivate.h | 1 | ||||
-rw-r--r-- | tests/auto/bic/tst_bic.cpp | 3 |
4 files changed, 8 insertions, 3 deletions
diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h index 8a6d06866a..cdd7202616 100644 --- a/src/declarative/qml/qdeclarative.h +++ b/src/declarative/qml/qdeclarative.h @@ -199,7 +199,7 @@ int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const c QByteArray listName("QDeclarativeListProperty<" + name + ">"); QDeclarativePrivate::RegisterType type = { - 1, + 2, qRegisterMetaType<T *>(pointerName.constData()), qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), @@ -233,7 +233,7 @@ int qmlRegisterRevision(const char *uri, int versionMajor, int versionMinor) QByteArray listName("QDeclarativeListProperty<" + name + ">"); QDeclarativePrivate::RegisterType type = { - 1, + 2, qRegisterMetaType<T *>(pointerName.constData()), qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()), diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp index 1f387c4256..e90fa40048 100644 --- a/src/declarative/qml/qdeclarativemetatype.cpp +++ b/src/declarative/qml/qdeclarativemetatype.cpp @@ -200,7 +200,8 @@ QDeclarativeType::QDeclarativeType(int index, const QDeclarativePrivate::Registe d->m_name = name; d->m_version_maj = type.versionMajor; d->m_version_min = type.versionMinor; - d->m_revision = type.revision; + if (type.version > 1) // revisions added in version 2 + d->m_revision = type.revision; d->m_typeId = type.typeId; d->m_listId = type.listId; d->m_allocationSize = type.objectSize; diff --git a/src/declarative/qml/qdeclarativeprivate.h b/src/declarative/qml/qdeclarativeprivate.h index a4fc4c1b36..981df7877c 100644 --- a/src/declarative/qml/qdeclarativeprivate.h +++ b/src/declarative/qml/qdeclarativeprivate.h @@ -215,6 +215,7 @@ namespace QDeclarativePrivate QDeclarativeCustomParser *customParser; int revision; + // If this is extended ensure "version" is bumped!!! }; struct RegisterInterface { diff --git a/tests/auto/bic/tst_bic.cpp b/tests/auto/bic/tst_bic.cpp index cd1d5ca750..74fa252445 100644 --- a/tests/auto/bic/tst_bic.cpp +++ b/tests/auto/bic/tst_bic.cpp @@ -135,6 +135,9 @@ tst_Bic::tst_Bic() /* This structure is semi-private and should never shrink */ bic.addBlacklistedClass(QLatin1String("QVFbHeader")); + + /* This structure has a version field that allows extension */ + bic.addBlacklistedClass(QLatin1String("QDeclarativePrivate::RegisterType")); } void tst_Bic::initTestCase_data() |