Qml token manager removed unuseful debug message

This commit is contained in:
Gioacchino Mazzurco 2018-02-01 14:59:08 +01:00
parent 2d00532e00
commit 6e093c74c0

View File

@ -35,29 +35,7 @@ QtObject
return return
} }
if (Array.isArray(tokens[token])) if (Array.isArray(tokens[token])) tokens[token].push(callback)
{
if(QT_DEBUG)
{
/* Haven't properly investigated yet if it may happen in normal
* situations that a callback is registered more then once, so
* if we are in a debug session and that happens print warning
* and stacktrace */
var arrLen = tokens[token].length
for(var i=0; i<arrLen; ++i)
{
if(callback === tokens[token][i])
{
console.warn("tokensManager.registerToken(token," +
" callback) Attempt to register same" +
" callback twice for:",
i, token, callback.name)
console.trace()
}
}
}
tokens[token].push(callback)
}
else tokens[token] = [callback] else tokens[token] = [callback]
} }
function unRegisterToken(token, callback) function unRegisterToken(token, callback)