qwebchannel
Advanced tools
Comparing version 5.15.0 to 6.2.0
{ | ||
"name": "qwebchannel", | ||
"version": "5.15.0", | ||
"version": "6.2.0", | ||
"description": "Asynchronous QObject communication", | ||
@@ -5,0 +5,0 @@ "main": "qwebchannel.js", |
@@ -276,9 +276,7 @@ /**************************************************************************** | ||
} | ||
object.__objectSignals__[signalIndex] = object.__objectSignals__[signalIndex] || []; | ||
var idx = object.__objectSignals__[signalIndex].indexOf(callback); | ||
if (idx === -1) { | ||
console.error("Cannot find connection of signal " + signalName + " to " + callback.name); | ||
return; | ||
} | ||
object.__objectSignals__[signalIndex].splice(idx, 1); | ||
// This makes a new list. This is important because it won't interfere with | ||
// signal processing if a disconnection happens while emittig a signal | ||
object.__objectSignals__[signalIndex] = (object.__objectSignals__[signalIndex] || []).filter(function(c) { | ||
return c != callback; | ||
}); | ||
if (!isPropertyNotifySignal && object.__objectSignals__[signalIndex].length === 0) { | ||
@@ -345,6 +343,2 @@ // only required for "pure" signals, handled separately for properties in propertyUpdate | ||
callback = argument; | ||
else if (argument instanceof QObject && webChannel.objects[argument.__id__] !== undefined) | ||
args.push({ | ||
"id": argument.__id__ | ||
}); | ||
else | ||
@@ -421,4 +415,2 @@ args.push(argument); | ||
var valueToSend = value; | ||
if (valueToSend instanceof QObject && webChannel.objects[valueToSend.__id__] !== undefined) | ||
valueToSend = { "id": valueToSend.__id__ }; | ||
webChannel.exec({ | ||
@@ -446,2 +438,10 @@ "type": QWebChannelMessageTypes.setProperty, | ||
QObject.prototype.toJSON = function() { | ||
if (this.__id__ === undefined) return {}; | ||
return { | ||
id: this.__id__, | ||
"__QObject*__": true | ||
}; | ||
}; | ||
//required for use with nodejs | ||
@@ -448,0 +448,0 @@ if (typeof module === 'object') { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18611
394