WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
patch
0001-Remove-the-use-of-deprecated-qVariant.patch (text/plain), 14.88 KB, created by
Ademar Reis
on 2011-02-10 12:33:03 PST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Ademar Reis
Created:
2011-02-10 12:33:03 PST
Size:
14.88 KB
patch
obsolete
>From dff713638c56929ee0bb0af9250ed6b593d526fb Mon Sep 17 00:00:00 2001 >From: Ademar de Souza Reis Jr <ademar.reis@openbossa.org> >Date: Thu, 10 Feb 2011 16:21:58 -0300 >Subject: [PATCH] Remove the use of deprecated qVariant* > >This was applied on the Qt repository and affects QtWebKit there. >(633f3f45e5420663cf4ceadea79e62fea44cd2eb) > >The side effect of this change is that we won't be able to build >QtWebKit with MSVC 6, as it doesn't support member template functions >(not sure if it's possible today anyway). > >Original patch from Olivier Goffart <olivier.goffart@nokia.com>, with >review reported as being from the mailing list. > >The changes are result of the following commands: > > git grep -O"sed -i 's/qVariantValue</qvariant_cast</'" qVariantValue > git grep -O"sed -i 's/qVariantSetValue(\([^&*\(),]*\), */\\1.setValue(/'" qVariantSetValue > git grep -O"sed -i 's/qVariantSetValue *<\([^>]*\)> *(\([^&*\(),]*\), */\\2.setValue<\\1>(/'" qVariantSetValue > git grep -O"sed -i 's/qVariantCanConvert *<\([^>]*\)> *(\([^&*\(),]*\))/\\2.canConvert<\\1>()/g'" qVariantCanConvert > git grep -O"sed -i 's/qVariantCanConvert *<\([^>]*\)> *(\([^&*\(),]*([^&*\(),]*)\))/\\2.canConvert<\\1>()/g'" qVariantCanConvert > git grep -O"sed -i 's/qVariantFromValue\( *[(<]\)/QVariant::fromValue\\1/'" qVariantFromValue >--- > Source/WebCore/ChangeLog | 31 +++++++++++++++ > Source/WebCore/bridge/qt/qt_runtime.cpp | 12 +++--- > .../platform/graphics/qt/MediaPlayerPrivateQt.cpp | 2 +- > Source/WebKit/qt/ChangeLog | 41 ++++++++++++++++++++ > .../qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp | 4 +- > Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp | 28 +++++++------- > 6 files changed, 95 insertions(+), 23 deletions(-) > >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c2cc8f3..ce87aca 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,34 @@ >+2011-02-10 Ademar de Souza Reis Jr <ademar.reis@openbossa.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ [Qt] Remove the use of deprecated qVariant* >+ https://bugs.webkit.org/show_bug.cgi?id=54229 >+ >+ This was applied on the Qt repository and affects QtWebKit there. >+ (633f3f45e5420663cf4ceadea79e62fea44cd2eb) >+ >+ The side effect of this change is that we won't be able to build >+ QtWebKit with MSVC 6, as it doesn't support member template functions >+ (not sure if it's possible today anyway). >+ >+ Original patch from Olivier Goffart <olivier.goffart@nokia.com>, with >+ review reported as being from the mailing list. >+ >+ The changes are result of the following commands: >+ >+ git grep -O"sed -i 's/qVariantValue</qvariant_cast</'" qVariantValue >+ git grep -O"sed -i 's/qVariantSetValue(\([^&*\(),]*\), */\\1.setValue(/'" qVariantSetValue >+ git grep -O"sed -i 's/qVariantSetValue *<\([^>]*\)> *(\([^&*\(),]*\), */\\2.setValue<\\1>(/'" qVariantSetValue >+ git grep -O"sed -i 's/qVariantCanConvert *<\([^>]*\)> *(\([^&*\(),]*\))/\\2.canConvert<\\1>()/g'" qVariantCanConvert >+ git grep -O"sed -i 's/qVariantCanConvert *<\([^>]*\)> *(\([^&*\(),]*([^&*\(),]*)\))/\\2.canConvert<\\1>()/g'" qVariantCanConvert >+ git grep -O"sed -i 's/qVariantFromValue\( *[(<]\)/QVariant::fromValue\\1/'" qVariantFromValue >+ >+ * bridge/qt/qt_runtime.cpp: >+ (JSC::Bindings::convertValueToQVariant): >+ * platform/graphics/qt/MediaPlayerPrivateQt.cpp: >+ (WebCore::MediaPlayerPrivateQt::commitLoad): >+ > 2011-02-10 Alexis Menard <alexis.menard@nokia.com> > > Reviewed by Andreas Kling. >diff --git a/Source/WebCore/bridge/qt/qt_runtime.cpp b/Source/WebCore/bridge/qt/qt_runtime.cpp >index 48a5a05..5507fc9 100644 >--- a/Source/WebCore/bridge/qt/qt_runtime.cpp >+++ b/Source/WebCore/bridge/qt/qt_runtime.cpp >@@ -587,7 +587,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type > if (qstring.mid(lastSlash + 1).contains(QLatin1Char('i'))) > realRe.setCaseSensitivity(Qt::CaseInsensitive); > >- ret = qVariantFromValue(realRe); >+ ret = QVariant::fromValue(realRe); > dist = 0; > } else { > qConvDebug() << "couldn't parse a JS regexp"; >@@ -598,7 +598,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type > > QRegExp re(qstring); > if (re.isValid()) { >- ret = qVariantFromValue(re); >+ ret = QVariant::fromValue(re); > dist = 10; > } > } >@@ -610,7 +610,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type > if (qtinst) { > if (qtinst->getObject()) { > qConvDebug() << "found instance, with object:" << (void*) qtinst->getObject(); >- ret = qVariantFromValue(qtinst->getObject()); >+ ret = QVariant::fromValue(qtinst->getObject()); > qConvDebug() << ret; > dist = 0; > } else { >@@ -621,7 +621,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type > } > } else if (type == Null) { > QObject* nullobj = 0; >- ret = qVariantFromValue(nullobj); >+ ret = QVariant::fromValue(nullobj); > dist = 0; > } else { > qConvDebug() << "previous type was not an object:" << type; >@@ -634,7 +634,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type > if (qtinst) { > if (qtinst->getObject()) { > qConvDebug() << "found instance, with object:" << (void*) qtinst->getObject(); >- ret = qVariantFromValue((void *)qtinst->getObject()); >+ ret = QVariant::fromValue((void *)qtinst->getObject()); > qConvDebug() << ret; > dist = 0; > } else { >@@ -644,7 +644,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type > qConvDebug() << "wasn't a qtinstance"; > } > } else if (type == Null) { >- ret = qVariantFromValue((void*)0); >+ ret = QVariant::fromValue((void*)0); > dist = 0; > } else if (type == Number) { > // I don't think that converting a double to a pointer is a wise >diff --git a/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp b/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp >index 64a83ce..caf9c2d 100644 >--- a/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp >+++ b/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp >@@ -215,7 +215,7 @@ void MediaPlayerPrivateQt::commitLoad(const String& url) > // Don't set the header if there are no cookies. > // This prevents a warning from being emitted. > if (!cookies.isEmpty()) >- request.setHeader(QNetworkRequest::CookieHeader, qVariantFromValue(cookies)); >+ request.setHeader(QNetworkRequest::CookieHeader, QVariant::fromValue(cookies)); > > // Set the refferer, but not when requesting insecure content from a secure page > QUrl documentUrl = QUrl(QString(document->documentURI())); >diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog >index 229f6ed..a99e444 100644 >--- a/Source/WebKit/qt/ChangeLog >+++ b/Source/WebKit/qt/ChangeLog >@@ -1,3 +1,44 @@ >+2011-02-10 Ademar de Souza Reis Jr <ademar.reis@openbossa.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ [Qt] Remove the use of deprecated qVariant* >+ https://bugs.webkit.org/show_bug.cgi?id=54229 >+ >+ This was applied on the Qt repository and affects QtWebKit there. >+ (633f3f45e5420663cf4ceadea79e62fea44cd2eb) >+ >+ The side effect of this change is that we won't be able to build >+ QtWebKit with MSVC 6, as it doesn't support member template functions >+ (not sure if it's possible today anyway). >+ >+ Original patch from Olivier Goffart <olivier.goffart@nokia.com>, with >+ review reported as being from the mailing list. >+ >+ The changes are result of the following commands: >+ >+ git grep -O"sed -i 's/qVariantValue</qvariant_cast</'" qVariantValue >+ git grep -O"sed -i 's/qVariantSetValue(\([^&*\(),]*\), */\\1.setValue(/'" qVariantSetValue >+ git grep -O"sed -i 's/qVariantSetValue *<\([^>]*\)> *(\([^&*\(),]*\), */\\2.setValue<\\1>(/'" qVariantSetValue >+ git grep -O"sed -i 's/qVariantCanConvert *<\([^>]*\)> *(\([^&*\(),]*\))/\\2.canConvert<\\1>()/g'" qVariantCanConvert >+ git grep -O"sed -i 's/qVariantCanConvert *<\([^>]*\)> *(\([^&*\(),]*([^&*\(),]*)\))/\\2.canConvert<\\1>()/g'" qVariantCanConvert >+ git grep -O"sed -i 's/qVariantFromValue\( *[(<]\)/QVariant::fromValue\\1/'" qVariantFromValue >+ >+ >+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp: >+ (DumpRenderTreeSupportQt::nodesFromRect): >+ * tests/qwebframe/tst_qwebframe.cpp: >+ (MyQObject::myInvokableWithQObjectListArg): >+ (MyQObject::myInvokableWithListOfIntArg): >+ (MyQObject::myInvokableWithQObjectStarArg): >+ (MyQObject::myInvokableWithQBrushArg): >+ (MyQObject::myInvokableWithBrushStyleArg): >+ (MyQObject::myInvokableWithVoidStarArg): >+ (MyQObject::myInvokableWithAmbiguousArg): >+ (MyQObject::myInvokableWithDefaultArgs): >+ (MyQObject::myInvokableWithPointArg): >+ (MyQObject::myOverloadedSlot): >+ > 2011-02-10 Alexis Menard <alexis.menard@nokia.com> > > Reviewed by Andreas Kling. >diff --git a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp >index 36d172e..e6e6310 100644 >--- a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp >+++ b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp >@@ -897,9 +897,9 @@ QVariantList DumpRenderTreeSupportQt::nodesFromRect(const QWebElement& document, > for (int i = 0; i < nodes->length(); i++) { > // QWebElement will be null if the Node is not an HTML Element > if (nodes->item(i)->isHTMLElement()) >- res << qVariantFromValue(QWebElement(nodes->item(i))); >+ res << QVariant::fromValue(QWebElement(nodes->item(i))); > else >- res << qVariantFromValue(QDRTNode(nodes->item(i))); >+ res << QVariant::fromValue(QDRTNode(nodes->item(i))); > } > return res; > } >diff --git a/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp >index df7a3e1..3c47d1c 100644 >--- a/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp >+++ b/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp >@@ -308,7 +308,7 @@ public: > } > Q_INVOKABLE QObjectList myInvokableWithQObjectListArg(const QObjectList &lst) { > m_qtFunctionInvoked = 14; >- m_actuals << qVariantFromValue(lst); >+ m_actuals << QVariant::fromValue(lst); > return lst; > } > Q_INVOKABLE QVariant myInvokableWithVariantArg(const QVariant &v) { >@@ -323,38 +323,38 @@ public: > } > Q_INVOKABLE QList<int> myInvokableWithListOfIntArg(const QList<int> &lst) { > m_qtFunctionInvoked = 17; >- m_actuals << qVariantFromValue(lst); >+ m_actuals << QVariant::fromValue(lst); > return lst; > } > Q_INVOKABLE QObject* myInvokableWithQObjectStarArg(QObject* obj) { > m_qtFunctionInvoked = 18; >- m_actuals << qVariantFromValue(obj); >+ m_actuals << QVariant::fromValue(obj); > return obj; > } > Q_INVOKABLE QBrush myInvokableWithQBrushArg(const QBrush &brush) { > m_qtFunctionInvoked = 19; >- m_actuals << qVariantFromValue(brush); >+ m_actuals << QVariant::fromValue(brush); > return brush; > } > Q_INVOKABLE void myInvokableWithBrushStyleArg(Qt::BrushStyle style) { > m_qtFunctionInvoked = 43; >- m_actuals << qVariantFromValue(style); >+ m_actuals << QVariant::fromValue(style); > } > Q_INVOKABLE void myInvokableWithVoidStarArg(void* arg) { > m_qtFunctionInvoked = 44; >- m_actuals << qVariantFromValue(arg); >+ m_actuals << QVariant::fromValue(arg); > } > Q_INVOKABLE void myInvokableWithAmbiguousArg(int arg) { > m_qtFunctionInvoked = 45; >- m_actuals << qVariantFromValue(arg); >+ m_actuals << QVariant::fromValue(arg); > } > Q_INVOKABLE void myInvokableWithAmbiguousArg(uint arg) { > m_qtFunctionInvoked = 46; >- m_actuals << qVariantFromValue(arg); >+ m_actuals << QVariant::fromValue(arg); > } > Q_INVOKABLE void myInvokableWithDefaultArgs(int arg1, const QString &arg2 = "") { > m_qtFunctionInvoked = 47; >- m_actuals << qVariantFromValue(arg1) << qVariantFromValue(arg2); >+ m_actuals << QVariant::fromValue(arg1) << qVariantFromValue(arg2); > } > Q_INVOKABLE QObject& myInvokableReturningRef() { > m_qtFunctionInvoked = 48; >@@ -366,11 +366,11 @@ public: > } > Q_INVOKABLE void myInvokableWithPointArg(const QPoint &arg) { > const_cast<MyQObject*>(this)->m_qtFunctionInvoked = 50; >- m_actuals << qVariantFromValue(arg); >+ m_actuals << QVariant::fromValue(arg); > } > Q_INVOKABLE void myInvokableWithPointArg(const QPointF &arg) { > const_cast<MyQObject*>(this)->m_qtFunctionInvoked = 51; >- m_actuals << qVariantFromValue(arg); >+ m_actuals << QVariant::fromValue(arg); > } > Q_INVOKABLE void myInvokableWithBoolArg(bool arg) { > m_qtFunctionInvoked = 52; >@@ -418,7 +418,7 @@ public Q_SLOTS: > } > void myOverloadedSlot(QObject* arg) { > m_qtFunctionInvoked = 41; >- m_actuals << qVariantFromValue(arg); >+ m_actuals << QVariant::fromValue(arg); > } > void myOverloadedSlot(bool arg) { > m_qtFunctionInvoked = 25; >@@ -843,7 +843,7 @@ void tst_QWebFrame::getSetStaticProperty() > QCOMPARE(evalJS("myObject.variantProperty === 'bar'"), sTrue); > m_myObject->setVariantProperty(42); > QCOMPARE(evalJS("myObject.variantProperty === 42"), sTrue); >- m_myObject->setVariantProperty(qVariantFromValue(QBrush())); >+ m_myObject->setVariantProperty(QVariant::fromValue(QBrush())); > //XFAIL > // QCOMPARE(evalJS("typeof myObject.variantProperty"), sVariant); > >@@ -1265,7 +1265,7 @@ void tst_QWebFrame::callQtInvokable() > /* XFAIL - variant support > m_myObject->resetQtFunctionInvoked(); > { >- m_myObject->setVariantProperty(qVariantFromValue(QBrush())); >+ m_myObject->setVariantProperty(QVariant::fromValue(QBrush())); > QVariant ret = evalJS("myObject.myInvokableWithVariantArg(myObject.variantProperty)"); > QVERIFY(ret.isVariant()); > QCOMPARE(m_myObject->qtFunctionInvoked(), 15); >-- >1.7.3.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 54229
: 82026