summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2013-11-20 14:27:53 +0100
committerMilian Wolff <milian.wolff@kdab.com>2013-12-05 16:22:52 +0100
commitf75499f5fa5605183d37ddcf1532f7a22e602f60 (patch)
treece07fe97b215cc167a0b1cf9a652c0ca59261aa1 /src
parent4a0d66958ab8c3785d82086d63c8eb441c95b7f1 (diff)
downloadqtwebchannel-f75499f5fa5605183d37ddcf1532f7a22e602f60.tar.gz
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 <pierre.rossi@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/MetaObjectPublisher.qml2
-rw-r--r--src/qobject.js5
-rw-r--r--src/webchannel.js5
3 files changed, 5 insertions, 7 deletions
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 = {};
};