From: Kent Hansen Date: Fri, 27 Jan 2012 13:04:12 +0000 (+0100) Subject: Get rid of checks for Qt3 types X-Git-Tag: qt-v5.0.0-alpha1~1504 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=36c057787f8a94abbfd3796e5039cf4e2db3775a;p=profile%2Fivi%2Fqtbase.git Get rid of checks for Qt3 types These types don't exist anymore, so it's pointless to check for them. Also remove the dead types from uic's type-to-header map. Change-Id: I7f0af5c337859f3da1c103157a802bbe5372df9f Reviewed-by: Jędrzej Nowacki Reviewed-by: Jonas Gastal Reviewed-by: João Abecasis Reviewed-by: Olivier Goffart Reviewed-by: Thiago Macieira Reviewed-by: Lars Knoll --- diff --git a/src/corelib/kernel/qmetaobjectbuilder.cpp b/src/corelib/kernel/qmetaobjectbuilder.cpp index 49cc884..d685867 100644 --- a/src/corelib/kernel/qmetaobjectbuilder.cpp +++ b/src/corelib/kernel/qmetaobjectbuilder.cpp @@ -80,15 +80,6 @@ uint qvariant_nameToType(const char* name) if (!name) return 0; - if (strcmp(name, "QCString") == 0) - return QMetaType::QByteArray; - if (strcmp(name, "Q_LLONG") == 0) - return QMetaType::LongLong; - if (strcmp(name, "Q_ULLONG") == 0) - return QMetaType::ULongLong; - if (strcmp(name, "QIconSet") == 0) - return QMetaType::QIcon; - uint tp = QMetaType::type(name); return tp < QMetaType::User ? tp : 0; } diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 96c2e1f..05c6c3e 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -1608,14 +1608,6 @@ QVariant::Type QVariant::nameToType(const char *name) { if (!name || !*name) return Invalid; - if (strcmp(name, "Q3CString") == 0) - return ByteArray; - if (strcmp(name, "Q_LLONG") == 0) - return LongLong; - if (strcmp(name, "Q_ULLONG") == 0) - return ULongLong; - if (strcmp(name, "QIconSet") == 0) - return Icon; if (strcmp(name, "UserType") == 0) return UserType; diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index dc902ec..51afd6d 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -54,15 +54,6 @@ uint qvariant_nameToType(const char* name) if (!name) return 0; - if (strcmp(name, "QCString") == 0) - return QMetaType::QByteArray; - if (strcmp(name, "Q_LLONG") == 0) - return QMetaType::LongLong; - if (strcmp(name, "Q_ULLONG") == 0) - return QMetaType::ULongLong; - if (strcmp(name, "QIconSet") == 0) - return QMetaType::QIcon; - uint tp = QMetaType::type(name); return tp < QMetaType::User ? tp : 0; } diff --git a/src/tools/uic/qclass_lib_map.h b/src/tools/uic/qclass_lib_map.h index df953d6..71f8791 100644 --- a/src/tools/uic/qclass_lib_map.h +++ b/src/tools/uic/qclass_lib_map.h @@ -33,20 +33,8 @@ QT_CLASS_LIB(QIntegerForSize, QtCore, qglobal.h) QT_CLASS_LIB(QIntegerForSize, QtCore, qglobal.h) QT_CLASS_LIB(QIntegerForSize, QtCore, qglobal.h) QT_CLASS_LIB(QNoImplicitBoolCast, QtCore, qglobal.h) -QT_CLASS_LIB(Q_INT8, QtCore, qglobal.h) -QT_CLASS_LIB(Q_UINT8, QtCore, qglobal.h) -QT_CLASS_LIB(Q_INT16, QtCore, qglobal.h) -QT_CLASS_LIB(Q_UINT16, QtCore, qglobal.h) -QT_CLASS_LIB(Q_INT32, QtCore, qglobal.h) -QT_CLASS_LIB(Q_UINT32, QtCore, qglobal.h) QT_CLASS_LIB(Q_INT64, QtCore, qglobal.h) QT_CLASS_LIB(Q_UINT64, QtCore, qglobal.h) -QT_CLASS_LIB(Q_LLONG, QtCore, qglobal.h) -QT_CLASS_LIB(Q_ULLONG, QtCore, qglobal.h) -QT_CLASS_LIB(Q_LONG, QtCore, qglobal.h) -QT_CLASS_LIB(Q_ULONG, QtCore, qglobal.h) -QT_CLASS_LIB(Q_LONG, QtCore, qglobal.h) -QT_CLASS_LIB(Q_ULONG, QtCore, qglobal.h) QT_CLASS_LIB(QSysInfo, QtCore, qglobal.h) QT_CLASS_LIB(QtMsgHandler, QtCore, qglobal.h) QT_CLASS_LIB(QGlobalStatic, QtCore, qglobal.h) @@ -670,7 +658,6 @@ QT_CLASS_LIB(QGraphicsView, QtWidgets, qgraphicsview.h) QT_CLASS_LIB(QGraphicsWidget, QtWidgets, qgraphicswidget.h) QT_CLASS_LIB(QBitmap, QtGui, qbitmap.h) QT_CLASS_LIB(QIcon, QtWidgets, qicon.h) -QT_CLASS_LIB(QIconSet, QtWidgets, qicon.h) QT_CLASS_LIB(QIconEngine, QtWidgets, qiconengine.h) QT_CLASS_LIB(QIconEngineV2, QtWidgets, qiconengine.h) QT_CLASS_LIB(QIconEngineFactoryInterface, QtWidgets, qiconengineplugin.h) diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp index 27eaa69..1a2ad24 100644 --- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp +++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp @@ -1961,7 +1961,12 @@ void tst_QVariant::typeToName() QVERIFY( QVariant::nameToType( 0 ) == QVariant::Invalid ); QVERIFY( QVariant::nameToType( "" ) == QVariant::Invalid ); QVERIFY( QVariant::nameToType( "foo" ) == QVariant::Invalid ); - QCOMPARE(QVariant::nameToType("QIconSet"), QVariant::Icon); + + // We don't support these old (Qt3) types anymore. + QCOMPARE(QVariant::nameToType("QIconSet"), QVariant::Invalid); + QCOMPARE(QVariant::nameToType("Q3CString"), QVariant::Invalid); + QCOMPARE(QVariant::nameToType("Q_LLONG"), QVariant::Invalid); + QCOMPARE(QVariant::nameToType("Q_ULLONG"), QVariant::Invalid); } void tst_QVariant::streamInvalidVariant()