diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2011-09-09 15:27:36 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-24 16:30:58 +0100 |
commit | 6ab6b0fc1c594a589d96d17b5ab7bdc237290f6e (patch) | |
tree | 32aeee16ce365def37daec8da690650758479556 /src | |
parent | 5e0406cbdf60302379fec092c0bac8f1745b62df (diff) |
Disable QUrl support in QVariant in bootstrapped mode
The only use of QUrl in qmake, moc, uic and rcc is due to QVariant's
internals, so let's disable it. This means those binaries are now
probably a lot smaller since the parsing and IDNA code don't need to
be present.
Change-Id: Ie156b0817d119b2ba5d3dcb9712a9fea2ee7d4a1
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qurl.cpp | 4 | ||||
-rw-r--r-- | src/corelib/io/qurl.h | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qvariant.cpp | 9 | ||||
-rw-r--r-- | src/corelib/kernel/qvariant.h | 4 | ||||
-rw-r--r-- | src/tools/bootstrap/bootstrap.pro | 1 |
5 files changed, 11 insertions, 9 deletions
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index 9b15c1fd98..1629f5745d 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -201,9 +201,7 @@ #include "qstack.h" #include "qvarlengtharray.h" #include "qdebug.h" -#ifndef QT_BOOTSTRAPPED #include "qtldurl_p.h" -#endif #if defined(Q_OS_WINCE_WM) #pragma optimize("g", off) #endif @@ -5569,12 +5567,10 @@ bool QUrl::hasFragment() const URL does not contain a valid TLD, in which case the function returns an empty string. */ -#ifndef QT_BOOTSTRAPPED QString QUrl::topLevelDomain() const { return qTopLevelDomain(host()); } -#endif /*! Returns the result of the merge of this URL with \a relative. This diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h index fc49231594..33fac9db57 100644 --- a/src/corelib/io/qurl.h +++ b/src/corelib/io/qurl.h @@ -175,9 +175,7 @@ public: void setEncodedFragment(const QByteArray &fragment); QByteArray encodedFragment() const; bool hasFragment() const; -#ifndef QT_BOOTSTRAPPED QString topLevelDomain() const; -#endif QUrl resolved(const QUrl &relative) const; diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 19b999a1e2..b687c01238 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -109,6 +109,7 @@ struct TypeDefinition { #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; }; @@ -297,6 +298,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) ok = &dummy; switch (uint(t)) { +#ifndef QT_BOOTSTRAPPED case QVariant::Url: switch (d->type) { case QVariant::String: @@ -306,6 +308,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) return false; } break; +#endif case QVariant::String: { QString *str = static_cast<QString *>(result); switch (d->type) { @@ -355,9 +358,11 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) if (v_cast<QStringList>(d)->count() == 1) *str = v_cast<QStringList>(d)->at(0); break; +#ifndef QT_BOOTSTRAPPED case QVariant::Url: *str = v_cast<QUrl>(d)->toString(); break; +#endif case QVariant::Uuid: *str = v_cast<QUuid>(d)->toString(); break; @@ -1449,7 +1454,9 @@ QVariant::QVariant(const QRect &r) { d.is_null = false; d.type = Rect; v_constru QVariant::QVariant(const QSize &s) { d.is_null = false; d.type = Size; v_construct<QSize>(&d, s); } QVariant::QVariant(const QSizeF &s) { d.is_null = false; d.type = SizeF; v_construct<QSizeF>(&d, s); } #endif +#ifndef QT_BOOTSTRAPPED QVariant::QVariant(const QUrl &u) { d.is_null = false; d.type = Url; v_construct<QUrl>(&d, u); } +#endif QVariant::QVariant(const QLocale &l) { d.is_null = false; d.type = Locale; v_construct<QLocale>(&d, l); } #ifndef QT_NO_REGEXP QVariant::QVariant(const QRegExp ®Exp) { d.is_null = false; d.type = RegExp; v_construct<QRegExp>(&d, regExp); } @@ -2094,6 +2101,7 @@ QPointF QVariant::toPointF() const #endif // QT_NO_GEOM_VARIANT +#ifndef QT_BOOTSTRAPPED /*! \fn QUrl QVariant::toUrl() const @@ -2106,6 +2114,7 @@ QUrl QVariant::toUrl() const { return qVariantToHelper<QUrl>(d, handlerManager); } +#endif /*! \fn QLocale QVariant::toLocale() const diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index cc502d93a7..fb0e059f45 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -237,7 +237,6 @@ class Q_CORE_EXPORT QVariant QVariant(const QRect &rect); QVariant(const QRectF &rect); #endif - QVariant(const QUrl &url); QVariant(const QLocale &locale); #ifndef QT_NO_REGEXP QVariant(const QRegExp ®Exp); @@ -246,6 +245,7 @@ class Q_CORE_EXPORT QVariant #endif // QT_BOOTSTRAPPED #endif // QT_NO_REGEXP #ifndef QT_BOOTSTRAPPED + QVariant(const QUrl &url); QVariant(const QEasingCurve &easing); #endif QVariant(Qt::GlobalColor color); @@ -303,7 +303,6 @@ class Q_CORE_EXPORT QVariant QLineF toLineF() const; QRectF toRectF() const; #endif - QUrl toUrl() const; QLocale toLocale() const; #ifndef QT_NO_REGEXP QRegExp toRegExp() const; @@ -312,6 +311,7 @@ class Q_CORE_EXPORT QVariant #endif // QT_BOOTSTRAPPED #endif // QT_NO_REGEXP #ifndef QT_BOOTSTRAPPED + QUrl toUrl() const; QEasingCurve toEasingCurve() const; #endif diff --git a/src/tools/bootstrap/bootstrap.pro b/src/tools/bootstrap/bootstrap.pro index 813882b6f6..2fd98071fc 100644 --- a/src/tools/bootstrap/bootstrap.pro +++ b/src/tools/bootstrap/bootstrap.pro @@ -65,7 +65,6 @@ SOURCES += \ ../../corelib/io/qfiledevice.cpp \ ../../corelib/io/qtemporaryfile.cpp \ ../../corelib/io/qtextstream.cpp \ - ../../corelib/io/qurl.cpp \ ../../corelib/kernel/qmetatype.cpp \ ../../corelib/kernel/qvariant.cpp \ ../../corelib/kernel/qsystemerror.cpp \ |