2011-02-10 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>

        Reviewed by Andreas Kling.

        [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  Ademar de Souza Reis Jr  <ademar.reis@openbossa.org>

        Reviewed by Andreas Kling.

        [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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent aadac7bd
2011-02-10 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>
Reviewed by Andreas Kling.
[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 Nico Weber <thakis@chromium.org>
Reviewed by Darin Adler.
......@@ -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
......
......@@ -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()));
......
2011-02-10 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>
Reviewed by Andreas Kling.
[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 Robert Hogan <robert@webkit.org>
Reviewed by Laszlo Gombos.
......
......@@ -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;
}
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment