summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2014-10-16 17:10:41 +0200
committerMilian Wolff <milian.wolff@kdab.com>2014-10-17 15:22:54 +0200
commit86d77a900852691267f556fbde98406a12ee4310 (patch)
tree9b5d132abb90d9a590b18625c16defa6bb712882
parentefbc8e0066f82ee530b4770e4484d6372e5e7cc1 (diff)
downloadqtwebchannel-86d77a900852691267f556fbde98406a12ee4310.tar.gz
Remove obsolete conversion work-around.5.4.0
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 <lars.knoll@digia.com>
-rw-r--r--src/webchannel/qmetaobjectpublisher.cpp19
-rw-r--r--src/webchannel/webchannel.pro1
2 files changed, 1 insertions, 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 <QJsonArray>
#include <QUuid>
-#if HAVE_QML
-#include <QtQml/QJSValue>
-#include <QtQml/QJSEngine>
-#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<QJSValue>()) {
- const QJSValue &jsValue = arg.value<QJSValue>();
- args.append(qjsvalue_cast<QJsonValue>(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 \