forked from qt-creator/qt-creator
qmljsscopebuilder: avoid warning from clang
Change-Id: I7ea4b8cd971bee1368dec3ce92ef27bf45d4c88b Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
@@ -67,26 +67,27 @@ void ScopeBuilder::push(AST::Node *node)
|
|||||||
// JS signal handler scope
|
// JS signal handler scope
|
||||||
if (UiScriptBinding *script = cast<UiScriptBinding *>(node)) {
|
if (UiScriptBinding *script = cast<UiScriptBinding *>(node)) {
|
||||||
QString name;
|
QString name;
|
||||||
if (script->qualifiedId)
|
if (script->qualifiedId) {
|
||||||
name = script->qualifiedId->name.toString();
|
name = script->qualifiedId->name.toString();
|
||||||
if (!_scopeChain->qmlScopeObjects().isEmpty()
|
if (!_scopeChain->qmlScopeObjects().isEmpty()
|
||||||
&& name.startsWith(QLatin1String("on"))
|
&& name.startsWith(QLatin1String("on"))
|
||||||
&& !script->qualifiedId->next) {
|
&& !script->qualifiedId->next) {
|
||||||
const ObjectValue *owner = 0;
|
const ObjectValue *owner = 0;
|
||||||
const Value *value = 0;
|
const Value *value = 0;
|
||||||
// try to find the name on the scope objects
|
// try to find the name on the scope objects
|
||||||
foreach (const ObjectValue *scope, _scopeChain->qmlScopeObjects()) {
|
foreach (const ObjectValue *scope, _scopeChain->qmlScopeObjects()) {
|
||||||
value = scope->lookupMember(name, _scopeChain->context(), &owner);
|
value = scope->lookupMember(name, _scopeChain->context(), &owner);
|
||||||
if (value)
|
if (value)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// signals defined in QML
|
// signals defined in QML
|
||||||
if (const ASTSignal *astsig = value_cast<ASTSignal>(value)) {
|
if (const ASTSignal *astsig = value_cast<ASTSignal>(value)) {
|
||||||
_scopeChain->appendJsScope(astsig->bodyScope());
|
_scopeChain->appendJsScope(astsig->bodyScope());
|
||||||
// signals defined in C++
|
// signals defined in C++
|
||||||
} else if (const CppComponentValue *qmlObject = value_cast<CppComponentValue>(owner)) {
|
} else if (const CppComponentValue *qmlObject = value_cast<CppComponentValue>(owner)) {
|
||||||
if (const ObjectValue *scope = qmlObject->signalScope(name))
|
if (const ObjectValue *scope = qmlObject->signalScope(name))
|
||||||
_scopeChain->appendJsScope(scope);
|
_scopeChain->appendJsScope(scope);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user