From f75499f5fa5605183d37ddcf1532f7a22e602f60 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Wed, 20 Nov 2013 14:27:53 +0100 Subject: Cleanup code a bit. The map-initializations are not required anymore, as the properties are now properly initialized. Furthermore, Qt.Debug messages are only handled by the MetaObjectPublisher, thus the webChannel.debug message should only be available to HTML clients which use qobject.js. Change-Id: Iae11a73d33d5eec3a90a264bf0418a5781523a22 Reviewed-by: Pierre Rossi --- src/MetaObjectPublisher.qml | 2 -- src/qobject.js | 5 +++++ src/webchannel.js | 5 ----- 3 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/MetaObjectPublisher.qml b/src/MetaObjectPublisher.qml index 5c3cfca..8d93fc4 100644 --- a/src/MetaObjectPublisher.qml +++ b/src/MetaObjectPublisher.qml @@ -159,7 +159,6 @@ MetaObjectPublisherImpl } if (payload.type === "Qt.connectToSignal") { if (object.hasOwnProperty(payload.signal)) { - subscriberCountMap = subscriberCountMap || {}; subscriberCountMap[payload.object] = subscriberCountMap[payload.object] || {}; // if no one is connected, connect. @@ -192,7 +191,6 @@ MetaObjectPublisherImpl if (!object.hasOwnProperty(payload.signal)) { return false; } - subscriberCountMap = subscriberCountMap || {}; subscriberCountMap[payload.object] = subscriberCountMap[payload.object] || {}; if (!subscriberCountMap[payload.object].hasOwnProperty(payload.signal)) { diff --git a/src/qobject.js b/src/qobject.js index e6513d5..27cb1e5 100644 --- a/src/qobject.js +++ b/src/qobject.js @@ -292,4 +292,9 @@ window.setupQObjectWebChannel = function(webChannel, doneCallback) ); webChannel.exec({type:"Qt.init"}); + + webChannel.debug = function(message) + { + webChannel.send({"data" : {"type" : "Qt.Debug", "message" : message}}); + }; }; diff --git a/src/webchannel.js b/src/webchannel.js index 10a9594..f29bafc 100644 --- a/src/webchannel.js +++ b/src/webchannel.js @@ -127,10 +127,5 @@ var QWebChannel = function(baseUrl, initCallback) channel.send({"id": [channel.id, id], "data": data}); }; - this.debug = function(message) - { - channel.send({"data" : {"type" : "Qt.Debug", "message" : message}}); - }; - this.objectMap = {}; }; -- cgit v1.2.1