From 86d77a900852691267f556fbde98406a12ee4310 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Thu, 16 Oct 2014 17:10:41 +0200 Subject: Remove obsolete conversion work-around. The conversion from QJSValue to QJsonArray seems to work just fine with Qt 5.4. Originally, this work-around was introduced to fix the QML tests, which still pass without this code now. Change-Id: Id52a5a16ebe25914f01d597778152e0595c9f1f4 Reviewed-by: Lars Knoll --- src/webchannel/qmetaobjectpublisher.cpp | 19 +------------------ src/webchannel/webchannel.pro | 1 - 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/webchannel/qmetaobjectpublisher.cpp b/src/webchannel/qmetaobjectpublisher.cpp index 5201a4a..27eb134 100644 --- a/src/webchannel/qmetaobjectpublisher.cpp +++ b/src/webchannel/qmetaobjectpublisher.cpp @@ -43,11 +43,6 @@ #include #include -#if HAVE_QML -#include -#include -#endif - QT_BEGIN_NAMESPACE namespace { @@ -380,19 +375,7 @@ void QMetaObjectPublisher::signalEmitted(const QObject *object, const int signal message[KEY_SIGNAL] = signalIndex; if (!arguments.isEmpty()) { // TODO: wrap (new) objects on the fly - QJsonArray args; -#if HAVE_QML - foreach (const QVariant &arg, arguments) { - if (arg.canConvert()) { - const QJSValue &jsValue = arg.value(); - args.append(qjsvalue_cast(jsValue)); - } else { - args.append(QJsonValue::fromVariant(arg)); - } - } -#else - args = QJsonArray::fromVariantList(arguments); -#endif + QJsonArray args = QJsonArray::fromVariantList(arguments); message[KEY_ARGS] = args; } message[KEY_TYPE] = TypeSignal; diff --git a/src/webchannel/webchannel.pro b/src/webchannel/webchannel.pro index 024956e..eba8123 100644 --- a/src/webchannel/webchannel.pro +++ b/src/webchannel/webchannel.pro @@ -29,7 +29,6 @@ SOURCES += \ qtHaveModule(qml) { QT += qml - DEFINES += HAVE_QML=1 SOURCES += \ qqmlwebchannel.cpp \ -- cgit v1.2.1