summaryrefslogtreecommitdiff
path: root/src/MetaObjectPublisher.qml
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2013-11-13 17:52:18 +0100
committerMilian Wolff <milian.wolff@kdab.com>2013-11-22 17:29:55 +0100
commit223baa1ad7f90e5fe4e61101e7cb1f6a2887d6f5 (patch)
treeeff4c888646be1ff3618dd4ed2965d90ff5db87b /src/MetaObjectPublisher.qml
parentd08ec6ff4a6adb47590d657616fe04d007d8ce66 (diff)
downloadqtwebchannel-223baa1ad7f90e5fe4e61101e7cb1f6a2887d6f5.tar.gz
Cleanup QML code.
Instead of initializing the property maps in Component.onCompleted, use "var foo: ({})" instead. This looks suprising, but the "var foo: {}" syntax won't work - it's an empty binding expression closur, not a map. Change-Id: I9edeeeeeabb3a871a46d8bb8a991a4155040497a Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'src/MetaObjectPublisher.qml')
-rw-r--r--src/MetaObjectPublisher.qml15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/MetaObjectPublisher.qml b/src/MetaObjectPublisher.qml
index 935e913..1d8222c 100644
--- a/src/MetaObjectPublisher.qml
+++ b/src/MetaObjectPublisher.qml
@@ -55,16 +55,16 @@ MetaObjectPublisherImpl
/**
* This map contains the registered objects indexed by their name.
*/
- property variant registeredObjects
- property var subscriberCountMap
+ property variant registeredObjects: ({})
+ property var subscriberCountMap: ({})
// Map of object names to maps of signal names to an array of all their properties.
// The last value is an array as a signal can be the notify signal of multiple properties.
- property var signalToPropertyMap
+ property var signalToPropertyMap: ({})
// Objects that changed their properties and are waiting for idle client.
// map of object name to map of signal name to arguments
- property var pendingPropertyUpdates
+ property var pendingPropertyUpdates: ({})
// true when the client is idle, false otherwise
property bool clientIsIdle: false
@@ -320,13 +320,6 @@ MetaObjectPublisherImpl
}
}
- Component.onCompleted: {
- // Initializing this in the property declaration is not possible and yields to "undefined"
- signalToPropertyMap = {}
- pendingPropertyUpdates = {}
- registeredObjects = {}
- }
-
onBlockUpdatesChanged: {
if (blockUpdates) {
return;