aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/qmljs/qmljsscopebuilder.cpp
diff options
context:
space:
mode:
authorRobert Loehning <[email protected]>2014-11-04 16:23:38 +0100
committerRobert Loehning <[email protected]>2014-11-04 16:46:45 +0100
commit4161e7f9d98f93000ee0528ef7fc4b80a05e09aa (patch)
treefde0457b036cf4458a9fe32d774108f9a1270071 /src/libs/qmljs/qmljsscopebuilder.cpp
parent826c43a337b0de06af74081b8471e2ee7a2fec29 (diff)
qmljsscopebuilder: avoid warning from clang
Change-Id: I7ea4b8cd971bee1368dec3ce92ef27bf45d4c88b Reviewed-by: Fawzi Mohamed <[email protected]>
Diffstat (limited to 'src/libs/qmljs/qmljsscopebuilder.cpp')
-rw-r--r--src/libs/qmljs/qmljsscopebuilder.cpp39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/libs/qmljs/qmljsscopebuilder.cpp b/src/libs/qmljs/qmljsscopebuilder.cpp
index 19628bae9af..7658bb27753 100644
--- a/src/libs/qmljs/qmljsscopebuilder.cpp
+++ b/src/libs/qmljs/qmljsscopebuilder.cpp
@@ -67,26 +67,27 @@ void ScopeBuilder::push(AST::Node *node)
// JS signal handler scope
if (UiScriptBinding *script = cast<UiScriptBinding *>(node)) {
QString name;
- if (script->qualifiedId)
+ if (script->qualifiedId) {
name = script->qualifiedId->name.toString();
- if (!_scopeChain->qmlScopeObjects().isEmpty()
- && name.startsWith(QLatin1String("on"))
- && !script->qualifiedId->next) {
- const ObjectValue *owner = 0;
- const Value *value = 0;
- // try to find the name on the scope objects
- foreach (const ObjectValue *scope, _scopeChain->qmlScopeObjects()) {
- value = scope->lookupMember(name, _scopeChain->context(), &owner);
- if (value)
- break;
- }
- // signals defined in QML
- if (const ASTSignal *astsig = value_cast<ASTSignal>(value)) {
- _scopeChain->appendJsScope(astsig->bodyScope());
- // signals defined in C++
- } else if (const CppComponentValue *qmlObject = value_cast<CppComponentValue>(owner)) {
- if (const ObjectValue *scope = qmlObject->signalScope(name))
- _scopeChain->appendJsScope(scope);
+ if (!_scopeChain->qmlScopeObjects().isEmpty()
+ && name.startsWith(QLatin1String("on"))
+ && !script->qualifiedId->next) {
+ const ObjectValue *owner = 0;
+ const Value *value = 0;
+ // try to find the name on the scope objects
+ foreach (const ObjectValue *scope, _scopeChain->qmlScopeObjects()) {
+ value = scope->lookupMember(name, _scopeChain->context(), &owner);
+ if (value)
+ break;
+ }
+ // signals defined in QML
+ if (const ASTSignal *astsig = value_cast<ASTSignal>(value)) {
+ _scopeChain->appendJsScope(astsig->bodyScope());
+ // signals defined in C++
+ } else if (const CppComponentValue *qmlObject = value_cast<CppComponentValue>(owner)) {
+ if (const ObjectValue *scope = qmlObject->signalScope(name))
+ _scopeChain->appendJsScope(scope);
+ }
}
}
}