Hello community,
here is the log from the commit of package libqt5-qtwebchannel for
openSUSE:Factory checked in at 2016-05-17 17:06:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libqt5-qtwebchannel (Old)
and /work/SRC/openSUSE:Factory/.libqt5-qtwebchannel.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libqt5-qtwebchannel"
Changes:
--------
--- /work/SRC/openSUSE:Factory/libqt5-qtwebchannel/libqt5-qtwebchannel.changes
2015-10-19 22:46:12.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.libqt5-qtwebchannel.new/libqt5-qtwebchannel.changes
2016-05-17 17:06:01.000000000 +0200
@@ -1,0 +2,8 @@
+Fri Mar 18 19:03:31 UTC 2016 - [email protected]
+
+- Update to 5.6.0
+ * For more details please see:
+ http://blog.qt.io/blog/2016/03/16/qt-5-6-released/
+ and https://wiki.qt.io/New_Features_in_Qt_5.6
+
+-------------------------------------------------------------------
Old:
----
qtwebchannel-opensource-src-5.5.1.tar.xz
New:
----
qtwebchannel-opensource-src-5.6.0.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libqt5-qtwebchannel.spec ++++++
--- /var/tmp/diff_new_pack.itW0nc/_old 2016-05-17 17:06:02.000000000 +0200
+++ /var/tmp/diff_new_pack.itW0nc/_new 2016-05-17 17:06:02.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package libqt5-qtwebchannel
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,11 +19,11 @@
%define qt5_snapshot 0
%define libname libQt5WebChannel5
%define base_name libqt5
-%define real_version 5.5.1
-%define so_version 5.5.1
+%define real_version 5.6.0
+%define so_version 5.6.0
%define tar_version qtwebchannel-opensource-src-%{real_version}
Name: libqt5-qtwebchannel
-Version: 5.5.1
+Version: 5.6.0
Release: 0
Summary: Qt 5 WebChannel Addon
License: SUSE-LGPL-2.1-with-digia-exception-1.1 or GPL-3.0
++++++ qtwebchannel-opensource-src-5.5.1.tar.xz ->
qtwebchannel-opensource-src-5.6.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtwebchannel-opensource-src-5.5.1/.qmake.conf
new/qtwebchannel-opensource-src-5.6.0/.qmake.conf
--- old/qtwebchannel-opensource-src-5.5.1/.qmake.conf 2015-10-13
06:36:57.000000000 +0200
+++ new/qtwebchannel-opensource-src-5.6.0/.qmake.conf 2016-02-09
08:15:31.000000000 +0100
@@ -1,4 +1,4 @@
load(qt_build_config)
CONFIG += qt_example_installs warning_clean
-MODULE_VERSION = 5.5.1
+MODULE_VERSION = 5.6.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtwebchannel-opensource-src-5.5.1/.tag
new/qtwebchannel-opensource-src-5.6.0/.tag
--- old/qtwebchannel-opensource-src-5.5.1/.tag 2015-10-13 06:36:57.000000000
+0200
+++ new/qtwebchannel-opensource-src-5.6.0/.tag 2016-02-09 08:15:31.000000000
+0100
@@ -1 +1 @@
-6a7de61bc15d0cde3a3c91c58f45ba10957aa39b
+92d903d92b430222cd3f89eab08d61d947e5abea
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/examples/webchannel/shared/websockettransport.cpp
new/qtwebchannel-opensource-src-5.6.0/examples/webchannel/shared/websockettransport.cpp
---
old/qtwebchannel-opensource-src-5.5.1/examples/webchannel/shared/websockettransport.cpp
2015-10-13 06:36:57.000000000 +0200
+++
new/qtwebchannel-opensource-src-5.6.0/examples/webchannel/shared/websockettransport.cpp
2016-02-09 08:15:31.000000000 +0100
@@ -60,6 +60,8 @@
{
connect(socket, &QWebSocket::textMessageReceived,
this, &WebSocketTransport::textMessageReceived);
+ connect(socket, &QWebSocket::disconnected,
+ this, &WebSocketTransport::deleteLater);
}
/*!
@@ -67,7 +69,7 @@
*/
WebSocketTransport::~WebSocketTransport()
{
-
+ m_socket->deleteLater();
}
/*!
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/examples/webchannel/standalone/index.html
new/qtwebchannel-opensource-src-5.6.0/examples/webchannel/standalone/index.html
---
old/qtwebchannel-opensource-src-5.5.1/examples/webchannel/standalone/index.html
2015-10-13 06:36:57.000000000 +0200
+++
new/qtwebchannel-opensource-src-5.6.0/examples/webchannel/standalone/index.html
2016-02-09 08:15:31.000000000 +0100
@@ -11,7 +11,11 @@
output.innerHTML = output.innerHTML + message + "\n";
}
window.onload = function() {
- var baseUrl =
(/[?&]webChannelBaseUrl=([A-Za-z0-9\-:/\.]+)/.exec(location.search)[1]);
+ if (location.search != "")
+ var baseUrl =
(/[?&]webChannelBaseUrl=([A-Za-z0-9\-:/\.]+)/.exec(location.search)[1]);
+ else
+ var baseUrl = "ws://localhost:12345";
+
output("Connecting to WebSocket server at " + baseUrl + ".");
var socket = new WebSocket(baseUrl);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/examples/webchannel/standalone/main.cpp
new/qtwebchannel-opensource-src-5.6.0/examples/webchannel/standalone/main.cpp
---
old/qtwebchannel-opensource-src-5.5.1/examples/webchannel/standalone/main.cpp
2015-10-13 06:36:57.000000000 +0200
+++
new/qtwebchannel-opensource-src-5.6.0/examples/webchannel/standalone/main.cpp
2016-02-09 08:15:31.000000000 +0100
@@ -38,8 +38,8 @@
#include <QVariantMap>
#include <QDesktopServices>
#include <QUrl>
-#include <QDebug>
-
+#include <QDir>
+#include <QFileInfo>
#include <QtWebSockets/QWebSocketServer>
#include "../shared/websocketclientwrapper.h"
@@ -111,6 +111,11 @@
{
QApplication app(argc, argv);
+ QFileInfo jsFileInfo(QDir::currentPath() + "/qwebchannel.js");
+
+ if (!jsFileInfo.exists())
+
QFile::copy(":/qtwebchannel/qwebchannel.js",jsFileInfo.absoluteFilePath());
+
// setup the QWebSocketServer
QWebSocketServer server(QStringLiteral("QWebChannel Standalone Example
Server"), QWebSocketServer::NonSecureMode);
if (!server.listen(QHostAddress::LocalHost, 12345)) {
@@ -132,7 +137,6 @@
// open a browser window with the client HTML page
QUrl url = QUrl::fromLocalFile(BUILD_DIR "/index.html");
- url.setQuery(QStringLiteral("webChannelBaseUrl=") +
server.serverUrl().toString());
QDesktopServices::openUrl(url);
dialog.displayMessage(QObject::tr("Initialization complete, opening
browser at %1.").arg(url.toDisplayString()));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.5.1/QtWebChannel/private/qmetaobjectpublisher_p.h
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.5.1/QtWebChannel/private/qmetaobjectpublisher_p.h
---
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.5.1/QtWebChannel/private/qmetaobjectpublisher_p.h
2015-10-13 06:36:57.000000000 +0200
+++
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.5.1/QtWebChannel/private/qmetaobjectpublisher_p.h
1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-#include "../../../../../src/webchannel/qmetaobjectpublisher_p.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.5.1/QtWebChannel/private/qqmlwebchannelattached_p.h
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.5.1/QtWebChannel/private/qqmlwebchannelattached_p.h
---
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.5.1/QtWebChannel/private/qqmlwebchannelattached_p.h
2015-10-13 06:36:57.000000000 +0200
+++
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.5.1/QtWebChannel/private/qqmlwebchannelattached_p.h
1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-#include "../../../../../src/webchannel/qqmlwebchannelattached_p.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.5.1/QtWebChannel/private/qwebchannel_p.h
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.5.1/QtWebChannel/private/qwebchannel_p.h
---
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.5.1/QtWebChannel/private/qwebchannel_p.h
2015-10-13 06:36:57.000000000 +0200
+++
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.5.1/QtWebChannel/private/qwebchannel_p.h
1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-#include "../../../../../src/webchannel/qwebchannel_p.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.5.1/QtWebChannel/private/signalhandler_p.h
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.5.1/QtWebChannel/private/signalhandler_p.h
---
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.5.1/QtWebChannel/private/signalhandler_p.h
2015-10-13 06:36:57.000000000 +0200
+++
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.5.1/QtWebChannel/private/signalhandler_p.h
1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-#include "../../../../../src/webchannel/signalhandler_p.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.5.1/QtWebChannel/private/variantargument_p.h
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.5.1/QtWebChannel/private/variantargument_p.h
---
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.5.1/QtWebChannel/private/variantargument_p.h
2015-10-13 06:36:57.000000000 +0200
+++
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.5.1/QtWebChannel/private/variantargument_p.h
1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-#include "../../../../../src/webchannel/variantargument_p.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.6.0/QtWebChannel/private/qmetaobjectpublisher_p.h
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.6.0/QtWebChannel/private/qmetaobjectpublisher_p.h
---
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.6.0/QtWebChannel/private/qmetaobjectpublisher_p.h
1970-01-01 01:00:00.000000000 +0100
+++
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.6.0/QtWebChannel/private/qmetaobjectpublisher_p.h
2016-02-09 08:15:31.000000000 +0100
@@ -0,0 +1 @@
+#include "../../../../../src/webchannel/qmetaobjectpublisher_p.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.6.0/QtWebChannel/private/qqmlwebchannelattached_p.h
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.6.0/QtWebChannel/private/qqmlwebchannelattached_p.h
---
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.6.0/QtWebChannel/private/qqmlwebchannelattached_p.h
1970-01-01 01:00:00.000000000 +0100
+++
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.6.0/QtWebChannel/private/qqmlwebchannelattached_p.h
2016-02-09 08:15:31.000000000 +0100
@@ -0,0 +1 @@
+#include "../../../../../src/webchannel/qqmlwebchannelattached_p.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.6.0/QtWebChannel/private/qwebchannel_p.h
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.6.0/QtWebChannel/private/qwebchannel_p.h
---
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.6.0/QtWebChannel/private/qwebchannel_p.h
1970-01-01 01:00:00.000000000 +0100
+++
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.6.0/QtWebChannel/private/qwebchannel_p.h
2016-02-09 08:15:31.000000000 +0100
@@ -0,0 +1 @@
+#include "../../../../../src/webchannel/qwebchannel_p.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.6.0/QtWebChannel/private/signalhandler_p.h
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.6.0/QtWebChannel/private/signalhandler_p.h
---
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.6.0/QtWebChannel/private/signalhandler_p.h
1970-01-01 01:00:00.000000000 +0100
+++
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.6.0/QtWebChannel/private/signalhandler_p.h
2016-02-09 08:15:31.000000000 +0100
@@ -0,0 +1 @@
+#include "../../../../../src/webchannel/signalhandler_p.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.6.0/QtWebChannel/private/variantargument_p.h
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.6.0/QtWebChannel/private/variantargument_p.h
---
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/5.6.0/QtWebChannel/private/variantargument_p.h
1970-01-01 01:00:00.000000000 +0100
+++
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/5.6.0/QtWebChannel/private/variantargument_p.h
2016-02-09 08:15:31.000000000 +0100
@@ -0,0 +1 @@
+#include "../../../../../src/webchannel/variantargument_p.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/qtwebchannelversion.h
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/qtwebchannelversion.h
---
old/qtwebchannel-opensource-src-5.5.1/include/QtWebChannel/qtwebchannelversion.h
2015-10-13 06:36:57.000000000 +0200
+++
new/qtwebchannel-opensource-src-5.6.0/include/QtWebChannel/qtwebchannelversion.h
2016-03-13 17:25:49.000000000 +0100
@@ -2,8 +2,8 @@
#ifndef QT_QTWEBCHANNEL_VERSION_H
#define QT_QTWEBCHANNEL_VERSION_H
-#define QTWEBCHANNEL_VERSION_STR "5.5.1"
+#define QTWEBCHANNEL_VERSION_STR "5.6.0"
-#define QTWEBCHANNEL_VERSION 0x050501
+#define QTWEBCHANNEL_VERSION 0x050600
#endif // QT_QTWEBCHANNEL_VERSION_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/src/webchannel/doc/qtwebchannel.qdocconf
new/qtwebchannel-opensource-src-5.6.0/src/webchannel/doc/qtwebchannel.qdocconf
---
old/qtwebchannel-opensource-src-5.5.1/src/webchannel/doc/qtwebchannel.qdocconf
2015-10-13 06:36:57.000000000 +0200
+++
new/qtwebchannel-opensource-src-5.6.0/src/webchannel/doc/qtwebchannel.qdocconf
2016-02-09 08:15:31.000000000 +0100
@@ -4,7 +4,7 @@
description = Qt WebChannel Reference
Documentation
version = $QT_VERSION
-examplesinstallpath = webchannel
+examplesinstallpath = qtwebchannel/webchannel
qhp.projects = QtWebChannel
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/src/webchannel/qmetaobjectpublisher.cpp
new/qtwebchannel-opensource-src-5.6.0/src/webchannel/qmetaobjectpublisher.cpp
---
old/qtwebchannel-opensource-src-5.5.1/src/webchannel/qmetaobjectpublisher.cpp
2015-10-13 06:36:57.000000000 +0200
+++
new/qtwebchannel-opensource-src-5.6.0/src/webchannel/qmetaobjectpublisher.cpp
2016-02-09 08:15:31.000000000 +0100
@@ -41,7 +41,9 @@
#include <QDebug>
#include <QJsonObject>
#include <QJsonArray>
+#ifndef QT_NO_JSVALUE
#include <QJSValue>
+#endif
#include <QUuid>
QT_BEGIN_NAMESPACE
@@ -449,16 +451,18 @@
{
if (QObject *object = result.value<QObject *>()) {
QString id = registeredObjectIds.value(object);
+
QJsonObject classInfo;
if (id.isEmpty()) {
// neither registered, nor wrapped, do so now
id = QUuid::createUuid().toString();
- Q_ASSERT(!registeredObjects.contains(id));
+ // store ID before the call to classInfoForObject()
+ // in case of self-contained objects it avoids
+ // infinite loops
+ registeredObjectIds[object] = id;
classInfo = classInfoForObject(object, transport);
- registeredObjectIds[object] = id;
-
ObjectInfo oi(object, classInfo);
if (transport) {
oi.transports.append(transport);
@@ -485,13 +489,16 @@
objectInfo[KEY_ID] = id;
if (!classInfo.isEmpty())
objectInfo[KEY_DATA] = classInfo;
+
return objectInfo;
+#ifndef QT_NO_JSVALUE
} else if (result.canConvert<QJSValue>()) {
// Workaround for keeping QJSValues from QVariant.
// Calling QJSValue::toVariant() converts JS-objects/arrays to
QVariantMap/List
// instead of stashing a QJSValue itself into a variant.
// TODO: Improve QJSValue-QJsonValue conversion in Qt.
return wrapResult(result.value<QJSValue>().toVariant(), transport,
parentObjectId);
+#endif
} else if (result.canConvert<QVariantList>()) {
// recurse and potentially wrap contents of the array
return wrapList(result.toList(), transport);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/src/webchannel/qmetaobjectpublisher_p.h
new/qtwebchannel-opensource-src-5.6.0/src/webchannel/qmetaobjectpublisher_p.h
---
old/qtwebchannel-opensource-src-5.5.1/src/webchannel/qmetaobjectpublisher_p.h
2015-10-13 06:36:57.000000000 +0200
+++
new/qtwebchannel-opensource-src-5.6.0/src/webchannel/qmetaobjectpublisher_p.h
2016-02-09 08:15:31.000000000 +0100
@@ -34,6 +34,17 @@
#ifndef QMETAOBJECTPUBLISHER_P_H
#define QMETAOBJECTPUBLISHER_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "variantargument_p.h"
#include "signalhandler_p.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/src/webchannel/qqmlwebchannelattached_p.h
new/qtwebchannel-opensource-src-5.6.0/src/webchannel/qqmlwebchannelattached_p.h
---
old/qtwebchannel-opensource-src-5.5.1/src/webchannel/qqmlwebchannelattached_p.h
2015-10-13 06:36:57.000000000 +0200
+++
new/qtwebchannel-opensource-src-5.6.0/src/webchannel/qqmlwebchannelattached_p.h
2016-02-09 08:15:31.000000000 +0100
@@ -34,6 +34,17 @@
#ifndef QQMLWEBCHANNELATTACHED_H
#define QQMLWEBCHANNELATTACHED_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QObject>
#include "qwebchannelglobal.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/src/webchannel/qwebchannel.h
new/qtwebchannel-opensource-src-5.6.0/src/webchannel/qwebchannel.h
--- old/qtwebchannel-opensource-src-5.5.1/src/webchannel/qwebchannel.h
2015-10-13 06:36:57.000000000 +0200
+++ new/qtwebchannel-opensource-src-5.6.0/src/webchannel/qwebchannel.h
2016-02-09 08:15:31.000000000 +0100
@@ -35,8 +35,8 @@
#ifndef QWEBCHANNEL_H
#define QWEBCHANNEL_H
-#include <QObject>
-#include <QJsonValue>
+#include <QtCore/QObject>
+#include <QtCore/QJsonValue>
#include <QtWebChannel/qwebchannelglobal.h>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/src/webchannel/qwebchannel.js
new/qtwebchannel-opensource-src-5.6.0/src/webchannel/qwebchannel.js
--- old/qtwebchannel-opensource-src-5.5.1/src/webchannel/qwebchannel.js
2015-10-13 06:36:57.000000000 +0200
+++ new/qtwebchannel-opensource-src-5.6.0/src/webchannel/qwebchannel.js
2016-02-09 08:15:31.000000000 +0100
@@ -193,7 +193,7 @@
}
if (!response
|| !response["__QObject*__"]
- || response["id"] === undefined) {
+ || response.id === undefined) {
return response;
}
@@ -365,6 +365,7 @@
}
Object.defineProperty(object, propertyName, {
+ configurable: true,
get: function () {
var propertyValue = object.__propertyCache__[propertyIndex];
if (propertyValue === undefined) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/src/webchannel/qwebchannel_p.h
new/qtwebchannel-opensource-src-5.6.0/src/webchannel/qwebchannel_p.h
--- old/qtwebchannel-opensource-src-5.5.1/src/webchannel/qwebchannel_p.h
2015-10-13 06:36:57.000000000 +0200
+++ new/qtwebchannel-opensource-src-5.6.0/src/webchannel/qwebchannel_p.h
2016-02-09 08:15:31.000000000 +0100
@@ -34,6 +34,17 @@
#ifndef QWEBCHANNEL_P_H
#define QWEBCHANNEL_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qwebchannelglobal.h"
#include <private/qobject_p.h>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/src/webchannel/qwebchannelabstracttransport.h
new/qtwebchannel-opensource-src-5.6.0/src/webchannel/qwebchannelabstracttransport.h
---
old/qtwebchannel-opensource-src-5.5.1/src/webchannel/qwebchannelabstracttransport.h
2015-10-13 06:36:57.000000000 +0200
+++
new/qtwebchannel-opensource-src-5.6.0/src/webchannel/qwebchannelabstracttransport.h
2016-02-09 08:15:31.000000000 +0100
@@ -34,7 +34,7 @@
#ifndef QWEBCHANNELABSTRACTTRANSPORT_H
#define QWEBCHANNELABSTRACTTRANSPORT_H
-#include <QObject>
+#include <QtCore/QObject>
#include <QtWebChannel/qwebchannelglobal.h>
QT_BEGIN_NAMESPACE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/src/webchannel/signalhandler_p.h
new/qtwebchannel-opensource-src-5.6.0/src/webchannel/signalhandler_p.h
--- old/qtwebchannel-opensource-src-5.5.1/src/webchannel/signalhandler_p.h
2015-10-13 06:36:57.000000000 +0200
+++ new/qtwebchannel-opensource-src-5.6.0/src/webchannel/signalhandler_p.h
2016-02-09 08:15:31.000000000 +0100
@@ -34,6 +34,17 @@
#ifndef SIGNALHANDLER_H
#define SIGNALHANDLER_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QObject>
#include <QHash>
#include <QVector>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/src/webchannel/variantargument_p.h
new/qtwebchannel-opensource-src-5.6.0/src/webchannel/variantargument_p.h
--- old/qtwebchannel-opensource-src-5.5.1/src/webchannel/variantargument_p.h
2015-10-13 06:36:57.000000000 +0200
+++ new/qtwebchannel-opensource-src-5.6.0/src/webchannel/variantargument_p.h
2016-02-09 08:15:31.000000000 +0100
@@ -34,6 +34,17 @@
#ifndef VARIANTARGUMENT_H
#define VARIANTARGUMENT_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QVariant>
QT_BEGIN_NAMESPACE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/src/webchannel/webchannel.pro
new/qtwebchannel-opensource-src-5.6.0/src/webchannel/webchannel.pro
--- old/qtwebchannel-opensource-src-5.5.1/src/webchannel/webchannel.pro
2015-10-13 06:36:57.000000000 +0200
+++ new/qtwebchannel-opensource-src-5.6.0/src/webchannel/webchannel.pro
2016-02-09 08:15:31.000000000 +0100
@@ -39,6 +39,8 @@
PRIVATE_HEADERS += \
qqmlwebchannelattached_p.h
+} else {
+ DEFINES += QT_NO_JSVALUE
}
HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/tests/auto/webchannel/tst_webchannel.cpp
new/qtwebchannel-opensource-src-5.6.0/tests/auto/webchannel/tst_webchannel.cpp
---
old/qtwebchannel-opensource-src-5.5.1/tests/auto/webchannel/tst_webchannel.cpp
2015-10-13 06:36:57.000000000 +0200
+++
new/qtwebchannel-opensource-src-5.6.0/tests/auto/webchannel/tst_webchannel.cpp
2016-02-09 08:15:31.000000000 +0100
@@ -38,9 +38,156 @@
#include <qmetaobjectpublisher_p.h>
#include <QtTest>
+#ifdef WEBCHANNEL_TESTS_CAN_USE_JS_ENGINE
+#include <QJSEngine>
+#endif
QT_USE_NAMESPACE
+#ifdef WEBCHANNEL_TESTS_CAN_USE_JS_ENGINE
+class TestJSEngine;
+
+class TestEngineTransport : public QWebChannelAbstractTransport
+{
+ Q_OBJECT
+public:
+ TestEngineTransport(TestJSEngine *);
+ void sendMessage(const QJsonObject &message) Q_DECL_OVERRIDE;
+
+ Q_INVOKABLE void channelSetupReady();
+ Q_INVOKABLE void send(const QByteArray &message);
+private:
+ TestJSEngine *m_testEngine;
+};
+
+class ConsoleLogger : public QObject
+{
+ Q_OBJECT
+public:
+ ConsoleLogger(QObject *parent = 0);
+
+ Q_INVOKABLE void log(const QString &text);
+ Q_INVOKABLE void error(const QString &text);
+
+ int errorCount() const { return m_errCount; }
+ int logCount() const { return m_logCount; }
+ QString lastError() const { return m_lastError; }
+
+private:
+ int m_errCount;
+ int m_logCount;
+ QString m_lastError;
+
+};
+
+
+
+ConsoleLogger::ConsoleLogger(QObject *parent)
+ : QObject(parent)
+ , m_errCount(0)
+ , m_logCount(0)
+{
+}
+
+void ConsoleLogger::log(const QString &text)
+{
+ m_logCount++;
+ qDebug("LOG: %s", qPrintable(text));
+}
+
+void ConsoleLogger::error(const QString &text)
+{
+ m_errCount++;
+ m_lastError = text;
+ qWarning("ERROR: %s", qPrintable(text));
+}
+
+
+// A test JS engine with convenience integration with WebChannel.
+class TestJSEngine : public QJSEngine
+{
+ Q_OBJECT
+public:
+ TestJSEngine();
+
+ TestEngineTransport *transport() const;
+ ConsoleLogger *logger() const;
+ void initWebChannelJS();
+
+signals:
+ void channelSetupReady(TestEngineTransport *transport);
+
+private:
+ TestEngineTransport *m_transport;
+ ConsoleLogger *m_logger;
+};
+
+TestEngineTransport::TestEngineTransport(TestJSEngine *engine)
+ : QWebChannelAbstractTransport(engine)
+ , m_testEngine(engine)
+{
+}
+
+void TestEngineTransport::sendMessage(const QJsonObject &message)
+{
+ QByteArray json = QJsonDocument(message).toJson(QJsonDocument::Compact);
+ QJSValue callback =
m_testEngine->evaluate(QStringLiteral("transport.onmessage"));
+ Q_ASSERT(callback.isCallable());
+ QJSValue arg = m_testEngine->newObject();
+ QJSValue data =
m_testEngine->evaluate(QString::fromLatin1("JSON.parse('%1');").arg(QString::fromUtf8(json)));
+ Q_ASSERT(!data.isError());
+ arg.setProperty(QStringLiteral("data"), data);
+ QJSValue val = callback.call((QJSValueList() << arg));
+ Q_ASSERT(!val.isError());
+}
+
+void TestEngineTransport::channelSetupReady()
+{
+ emit m_testEngine->channelSetupReady(m_testEngine->transport());
+}
+
+void TestEngineTransport::send(const QByteArray &message)
+{
+ QJsonDocument doc(QJsonDocument::fromJson(message));
+ emit messageReceived(doc.object(), this);
+}
+
+
+TestJSEngine::TestJSEngine()
+ : m_transport(new TestEngineTransport(this))
+ , m_logger(new ConsoleLogger(this))
+{
+ globalObject().setProperty("transport", newQObject(m_transport));
+ globalObject().setProperty("console", newQObject(m_logger));
+
+ QString webChannelJSPath(QStringLiteral(":/qtwebchannel/qwebchannel.js"));
+ QFile webChannelJS(webChannelJSPath);
+ if (!webChannelJS.open(QFile::ReadOnly))
+ qFatal("Error opening qwebchannel.js");
+ QString source(QString::fromUtf8(webChannelJS.readAll()));
+ evaluate(source, webChannelJSPath);
+}
+
+TestEngineTransport *TestJSEngine::transport() const
+{
+ return m_transport;
+}
+
+ConsoleLogger *TestJSEngine::logger() const
+{
+ return m_logger;
+}
+
+void TestJSEngine::initWebChannelJS()
+{
+ globalObject().setProperty(QStringLiteral("channel"), newObject());
+ QJSValue channel = evaluate(QStringLiteral("channel = new
QWebChannel(transport, function(channel) { transport.channelSetupReady();});"));
+ Q_ASSERT(!channel.isError());
+}
+
+#endif // WEBCHANNEL_TESTS_CAN_USE_JS_ENGINE
+
+
TestWebChannel::TestWebChannel(QObject *parent)
: QObject(parent)
, m_dummyTransport(new DummyTransport(this))
@@ -148,6 +295,12 @@
}
{
QJsonArray method;
+ method.append(QStringLiteral("setObjectProperty"));
+
method.append(obj.metaObject()->indexOfMethod("setObjectProperty(QObject*)"));
+ expected.append(method);
+ }
+ {
+ QJsonArray method;
method.append(QStringLiteral("method1"));
method.append(obj.metaObject()->indexOfMethod("method1()"));
expected.append(method);
@@ -230,6 +383,19 @@
property.append(obj.bar());
expected.append(property);
}
+ {
+ QJsonArray property;
+
property.append(obj.metaObject()->indexOfProperty("objectProperty"));
+ property.append(QStringLiteral("objectProperty"));
+ {
+ QJsonArray signal;
+ signal.append(1);
+
signal.append(obj.metaObject()->indexOfMethod("objectPropertyChanged()"));
+ property.append(signal);
+ }
+
property.append(QJsonValue::fromVariant(QVariant::fromValue(obj.objectProperty())));
+ expected.append(property);
+ }
QCOMPARE(info["properties"].toArray(), expected);
}
}
@@ -270,6 +436,43 @@
m_dummyTransport->emitMessageReceived(QJsonObject());
}
+void TestWebChannel::testWrapRegisteredObject()
+{
+ QWebChannel channel;
+ TestObject obj;
+ obj.setObjectName("myTestObject");
+
+ channel.registerObject(obj.objectName(), &obj);
+ channel.connectTo(m_dummyTransport);
+ channel.d_func()->publisher->initializeClient(m_dummyTransport);
+
+ QJsonObject objectInfo =
channel.d_func()->publisher->wrapResult(QVariant::fromValue(&obj),
m_dummyTransport).toObject();
+
+ QCOMPARE(2, objectInfo.length());
+ QVERIFY(objectInfo.contains("id"));
+ QVERIFY(objectInfo.contains("__QObject*__"));
+ QVERIFY(objectInfo.value("__QObject*__").isBool() &&
objectInfo.value("__QObject*__").toBool());
+
+ QString returnedId = objectInfo.value("id").toString();
+
+ QCOMPARE(&obj,
channel.d_func()->publisher->registeredObjects.value(obj.objectName()));
+ QCOMPARE(obj.objectName(),
channel.d_func()->publisher->registeredObjectIds.value(&obj));
+ QCOMPARE(obj.objectName(), returnedId);
+}
+
+void TestWebChannel::testInfiniteRecursion()
+{
+ QWebChannel channel;
+ TestObject obj;
+ obj.setObjectProperty(&obj);
+ obj.setObjectName("myTestObject");
+
+ channel.connectTo(m_dummyTransport);
+ channel.d_func()->publisher->initializeClient(m_dummyTransport);
+
+ QJsonObject objectInfo =
channel.d_func()->publisher->wrapResult(QVariant::fromValue(&obj),
m_dummyTransport).toObject();
+}
+
static QHash<QString, QObject*> createObjects(QObject *parent)
{
const int num = 100;
@@ -352,5 +555,63 @@
channel.registerObjects(objects);
}
}
+#ifdef WEBCHANNEL_TESTS_CAN_USE_JS_ENGINE
+class SubclassedTestObject : public TestObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString bar READ bar WRITE setBar NOTIFY theBarHasChanged)
+public:
+ void setBar(const QString &newBar);
+signals:
+ void theBarHasChanged();
+};
+
+void SubclassedTestObject::setBar(const QString &newBar)
+{
+ if (!newBar.isNull())
+ emit theBarHasChanged();
+}
+
+class TestSubclassedFunctor {
+public:
+ TestSubclassedFunctor(TestJSEngine *engine)
+ : m_engine(engine)
+ {
+ }
+
+ void operator()() {
+ QCOMPARE(m_engine->logger()->errorCount(), 0);
+ }
+
+private:
+ TestJSEngine *m_engine;
+};
+#endif // WEBCHANNEL_TESTS_CAN_USE_JS_ENGINE
+
+void TestWebChannel::qtbug46548_overriddenProperties()
+{
+#ifndef WEBCHANNEL_TESTS_CAN_USE_JS_ENGINE
+ QSKIP("A JS engine is required for this test to make sense.");
+#else
+ SubclassedTestObject obj;
+ obj.setObjectName("subclassedTestObject");
+
+ QWebChannel webChannel;
+ webChannel.registerObject(obj.objectName(), &obj);
+ TestJSEngine engine;
+ webChannel.connectTo(engine.transport());
+ QSignalSpy spy(&engine, &TestJSEngine::channelSetupReady);
+ connect(&engine, &TestJSEngine::channelSetupReady,
TestSubclassedFunctor(&engine));
+ engine.initWebChannelJS();
+ if (!spy.count())
+ spy.wait();
+ QCOMPARE(spy.count(), 1);
+ QJSValue subclassedTestObject =
engine.evaluate("channel.objects[\"subclassedTestObject\"]");
+ QVERIFY(subclassedTestObject.isObject());
+
+#endif // WEBCHANNEL_TESTS_CAN_USE_JS_ENGINE
+}
QTEST_MAIN(TestWebChannel)
+
+#include "tst_webchannel.moc"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/tests/auto/webchannel/tst_webchannel.h
new/qtwebchannel-opensource-src-5.6.0/tests/auto/webchannel/tst_webchannel.h
---
old/qtwebchannel-opensource-src-5.5.1/tests/auto/webchannel/tst_webchannel.h
2015-10-13 06:36:57.000000000 +0200
+++
new/qtwebchannel-opensource-src-5.6.0/tests/auto/webchannel/tst_webchannel.h
2016-02-09 08:15:31.000000000 +0100
@@ -69,9 +69,12 @@
Q_PROPERTY(Foo foo READ foo CONSTANT)
Q_PROPERTY(int asdf READ asdf NOTIFY asdfChanged)
Q_PROPERTY(QString bar READ bar NOTIFY theBarHasChanged)
+ Q_PROPERTY(QObject * objectProperty READ objectProperty WRITE
setObjectProperty NOTIFY objectPropertyChanged)
+
public:
explicit TestObject(QObject *parent = 0)
: QObject(parent)
+ , mObjectProperty(0)
{ }
enum Foo {
@@ -83,6 +86,11 @@
int asdf() const {return 42;}
QString bar() const {return QString();}
+ QObject *objectProperty() const
+ {
+ return mObjectProperty;
+ }
+
Q_INVOKABLE void method1() {}
protected:
@@ -96,16 +104,26 @@
void sig2(const QString&);
void asdfChanged();
void theBarHasChanged();
+ void objectPropertyChanged();
public slots:
void slot1() {}
void slot2(const QString&) {}
+ void setObjectProperty(QObject *object)
+ {
+ mObjectProperty = object;
+ emit objectPropertyChanged();
+ }
+
protected slots:
void slot3() {}
private slots:
void slot4() {}
+
+public:
+ QObject *mObjectProperty;
};
class BenchObject : public QObject
@@ -218,12 +236,16 @@
void testInfoForObject();
void testInvokeMethodConversion();
void testDisconnect();
+ void testWrapRegisteredObject();
+ void testInfiniteRecursion();
void benchClassInfo();
void benchInitializeClients();
void benchPropertyUpdates();
void benchRegisterObjects();
+ void qtbug46548_overriddenProperties();
+
private:
DummyTransport *m_dummyTransport;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtwebchannel-opensource-src-5.5.1/tests/auto/webchannel/webchannel.pro
new/qtwebchannel-opensource-src-5.6.0/tests/auto/webchannel/webchannel.pro
--- old/qtwebchannel-opensource-src-5.5.1/tests/auto/webchannel/webchannel.pro
2015-10-13 06:36:57.000000000 +0200
+++ new/qtwebchannel-opensource-src-5.6.0/tests/auto/webchannel/webchannel.pro
2016-02-09 08:15:31.000000000 +0100
@@ -12,3 +12,8 @@
HEADERS += \
tst_webchannel.h
+
+qtHaveModule(qml) {
+ DEFINES += WEBCHANNEL_TESTS_CAN_USE_JS_ENGINE
+ QT += qml
+}