diff options
author | Jędrzej Nowacki <jedrzej.nowacki@nokia.com> | 2012-03-23 17:14:52 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-03 03:29:55 +0200 |
commit | 4b023e248747a589f2402b03f1967b999e3bb3b8 (patch) | |
tree | 2da3714f8abfbdc8a22c06ccdd824a9937576009 /src/corelib/kernel/qvariant.cpp | |
parent | 97f251b8c3654ffdf0ea3df3c610935549a7eba9 (diff) |
Remove duplicated template code.
Unify TypeDefinitions specializations. I'm not aware of any reason why
QVariant should have a separate set of supported types during
bootstrapping phase. It would cause only crashes.
As a side effect the patch reduces size of core and gui libraries.
Change-Id: I5140d9d3daee39a0171bc718bf46dab6b28085ec
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Diffstat (limited to 'src/corelib/kernel/qvariant.cpp')
-rw-r--r-- | src/corelib/kernel/qvariant.cpp | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index b687c01238..da6017127f 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -100,40 +100,13 @@ public: } // namespace namespace { -template<typename T> -struct TypeDefinition { - static const bool IsAvailable = true; -}; - -// Ignore these types, as incomplete -#ifdef QT_BOOTSTRAPPED -template<> struct TypeDefinition<QEasingCurve> { static const bool IsAvailable = false; }; -template<> struct TypeDefinition<QModelIndex> { static const bool IsAvailable = false; }; -template<> struct TypeDefinition<QUrl> { static const bool IsAvailable = false; }; -template<> struct TypeDefinition<QRegularExpression> { static const bool IsAvailable = false; }; -template<> struct TypeDefinition<QJsonValue> { static const bool IsAvailable = false; }; -template<> struct TypeDefinition<QJsonObject> { static const bool IsAvailable = false; }; -template<> struct TypeDefinition<QJsonArray> { static const bool IsAvailable = false; }; -template<> struct TypeDefinition<QJsonDocument> { static const bool IsAvailable = false; }; -#endif -#ifdef QT_NO_GEOM_VARIANT -template<> struct TypeDefinition<QRect> { static const bool IsAvailable = false; }; -template<> struct TypeDefinition<QRectF> { static const bool IsAvailable = false; }; -template<> struct TypeDefinition<QSize> { static const bool IsAvailable = false; }; -template<> struct TypeDefinition<QSizeF> { static const bool IsAvailable = false; }; -template<> struct TypeDefinition<QLine> { static const bool IsAvailable = false; }; -template<> struct TypeDefinition<QLineF> { static const bool IsAvailable = false; }; -template<> struct TypeDefinition<QPoint> { static const bool IsAvailable = false; }; -template<> struct TypeDefinition<QPointF> { static const bool IsAvailable = false; }; -#endif - struct CoreTypesFilter { template<typename T> struct Acceptor { - static const bool IsAccepted = QTypeModuleInfo<T>::IsCore && TypeDefinition<T>::IsAvailable; + static const bool IsAccepted = QTypeModuleInfo<T>::IsCore && QtMetaTypePrivate::TypeDefinition<T>::IsAvailable; }; }; -} // annonymous used to hide TypeDefinition +} // annonymous namespace { // annonymous used to hide QVariant handlers |