forked from qt-creator/qt-creator
QmlJS: Adjust existing code for updated QML parser.
Change-Id: I153723eeb9973be025daf47e317f7b9d076a3c72 Reviewed-on: http://codereview.qt-project.org/4733 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
@@ -452,11 +452,11 @@ IAssistProposal *QmlJSCompletionAssistProcessor::perform(const IAssistInterface
|
||||
break;
|
||||
const ObjectValue *newScopeType = qmlScopeType;
|
||||
for (AST::UiQualifiedId *it = objDef->qualifiedTypeNameId; it; it = it->next) {
|
||||
if (!newScopeType || !it->name) {
|
||||
if (!newScopeType || it->name.isEmpty()) {
|
||||
newScopeType = 0;
|
||||
break;
|
||||
}
|
||||
const Value *v = newScopeType->lookupMember(it->name->asString(), context);
|
||||
const Value *v = newScopeType->lookupMember(it->name.toString(), context);
|
||||
v = context->lookupReference(v);
|
||||
newScopeType = value_cast<const ObjectValue *>(v);
|
||||
}
|
||||
|
||||
@@ -57,9 +57,9 @@ static QString toString(Statement *statement)
|
||||
if (!expStmt)
|
||||
return QString();
|
||||
if (IdentifierExpression *idExp = cast<IdentifierExpression *>(expStmt->expression)) {
|
||||
return idExp->name->asString();
|
||||
return idExp->name.toString();
|
||||
} else if (StringLiteral *strExp = cast<StringLiteral *>(expStmt->expression)) {
|
||||
return strExp->value->asString();
|
||||
return strExp->value.toString();
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
@@ -75,10 +75,10 @@ static QString getIdProperty(UiObjectDefinition *def)
|
||||
continue;
|
||||
if (script->qualifiedId->next)
|
||||
continue;
|
||||
if (script->qualifiedId->name) {
|
||||
if (script->qualifiedId->name->asString() == QLatin1String("id"))
|
||||
if (!script->qualifiedId->name.isEmpty()) {
|
||||
if (script->qualifiedId->name == QLatin1String("id"))
|
||||
return toString(script->statement);
|
||||
if (script->qualifiedId->name->asString() == QLatin1String("objectName"))
|
||||
if (script->qualifiedId->name == QLatin1String("objectName"))
|
||||
objectName = toString(script->statement);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,8 +126,8 @@ protected:
|
||||
{
|
||||
QString text;
|
||||
for (; id; id = id->next) {
|
||||
if (id->name)
|
||||
text += id->name->asString();
|
||||
if (!id->name.isEmpty())
|
||||
text += id->name;
|
||||
else
|
||||
text += QLatin1Char('?');
|
||||
|
||||
@@ -149,8 +149,8 @@ protected:
|
||||
if (asString(node->qualifiedId) == QLatin1String("id")) {
|
||||
if (AST::ExpressionStatement *stmt = AST::cast<AST::ExpressionStatement*>(node->statement)) {
|
||||
if (AST::IdentifierExpression *idExpr = AST::cast<AST::IdentifierExpression *>(stmt->expression)) {
|
||||
if (idExpr->name) {
|
||||
const QString id = idExpr->name->asString();
|
||||
if (!idExpr->name.isEmpty()) {
|
||||
const QString &id = idExpr->name.toString();
|
||||
QList<AST::SourceLocation> *locs = &_ids[id];
|
||||
locs->append(idExpr->firstSourceLocation());
|
||||
locs->append(_maybeIds.value(id));
|
||||
@@ -168,8 +168,8 @@ protected:
|
||||
|
||||
virtual bool visit(AST::IdentifierExpression *node)
|
||||
{
|
||||
if (node->name) {
|
||||
const QString name = node->name->asString();
|
||||
if (!node->name.isEmpty()) {
|
||||
const QString &name = node->name.toString();
|
||||
|
||||
if (_ids.contains(name))
|
||||
_ids[name].append(node->identifierToken);
|
||||
@@ -206,8 +206,8 @@ protected:
|
||||
{
|
||||
QString text;
|
||||
for (; id; id = id->next) {
|
||||
if (id->name)
|
||||
text += id->name->asString();
|
||||
if (!id->name.isEmpty())
|
||||
text += id->name;
|
||||
else
|
||||
text += QLatin1Char('?');
|
||||
|
||||
@@ -320,19 +320,19 @@ protected:
|
||||
|
||||
virtual bool visit(AST::FunctionDeclaration *ast)
|
||||
{
|
||||
if (! ast->name)
|
||||
if (ast->name.isEmpty())
|
||||
return false;
|
||||
|
||||
Declaration decl;
|
||||
init(&decl, ast);
|
||||
|
||||
decl.text.fill(QLatin1Char(' '), _depth);
|
||||
decl.text += ast->name->asString();
|
||||
decl.text += ast->name;
|
||||
|
||||
decl.text += QLatin1Char('(');
|
||||
for (FormalParameterList *it = ast->formals; it; it = it->next) {
|
||||
if (it->name)
|
||||
decl.text += it->name->asString();
|
||||
if (!it->name.isEmpty())
|
||||
decl.text += it->name;
|
||||
|
||||
if (it->next)
|
||||
decl.text += QLatin1String(", ");
|
||||
@@ -347,12 +347,12 @@ protected:
|
||||
|
||||
virtual bool visit(AST::VariableDeclaration *ast)
|
||||
{
|
||||
if (! ast->name)
|
||||
if (ast->name.isEmpty())
|
||||
return false;
|
||||
|
||||
Declaration decl;
|
||||
decl.text.fill(QLatin1Char(' '), _depth);
|
||||
decl.text += ast->name->asString();
|
||||
decl.text += ast->name;
|
||||
|
||||
const SourceLocation first = ast->identifierToken;
|
||||
decl.startLine = first.startLine;
|
||||
@@ -568,8 +568,8 @@ QmlJS::AST::Node *SemanticInfo::declaringMemberNoProperties(int cursorPosition)
|
||||
AST::Node *node = rangeAt(cursorPosition);
|
||||
|
||||
if (UiObjectDefinition *objectDefinition = cast<UiObjectDefinition*>(node)) {
|
||||
QString name = objectDefinition->qualifiedTypeNameId->name->asString();
|
||||
if (!name.isNull() && name.at(0).isLower()) {
|
||||
const QString &name = objectDefinition->qualifiedTypeNameId->name.toString();
|
||||
if (!name.isEmpty() && name.at(0).isLower()) {
|
||||
QList<AST::Node *> path = rangePath(cursorPosition);
|
||||
if (path.size() > 1)
|
||||
return path.at(path.size() - 2);
|
||||
@@ -579,7 +579,7 @@ QmlJS::AST::Node *SemanticInfo::declaringMemberNoProperties(int cursorPosition)
|
||||
return path.at(path.size() - 3);
|
||||
}
|
||||
} else if (UiObjectBinding *objectBinding = cast<UiObjectBinding*>(node)) {
|
||||
QString name = objectBinding->qualifiedTypeNameId->name->asString();
|
||||
const QString &name = objectBinding->qualifiedTypeNameId->name.toString();
|
||||
if (name.contains("Gradient")) {
|
||||
QList<AST::Node *> path = rangePath(cursorPosition);
|
||||
if (path.size() > 1)
|
||||
@@ -1085,7 +1085,7 @@ protected:
|
||||
id = binding->qualifiedTypeNameId;
|
||||
|
||||
if (id) {
|
||||
QString name = id->name->asString();
|
||||
const QStringRef &name = id->name;
|
||||
if (!name.isEmpty() && name.at(0).isUpper()) {
|
||||
return true;
|
||||
}
|
||||
@@ -1108,12 +1108,12 @@ protected:
|
||||
if (UiScriptBinding *script = cast<UiScriptBinding *>(member)) {
|
||||
if (! script->qualifiedId)
|
||||
return false;
|
||||
else if (! script->qualifiedId->name)
|
||||
else if (script->qualifiedId->name.isEmpty())
|
||||
return false;
|
||||
else if (script->qualifiedId->next)
|
||||
return false;
|
||||
|
||||
const QString propertyName = script->qualifiedId->name->asString();
|
||||
const QStringRef &propertyName = script->qualifiedId->name;
|
||||
|
||||
if (propertyName == QLatin1String("id"))
|
||||
return true;
|
||||
@@ -1313,7 +1313,7 @@ TextEditor::BaseTextEditorWidget::Link QmlJSTextEditorWidget::findLinkAt(const Q
|
||||
|
||||
// string literals that could refer to a file link to them
|
||||
if (StringLiteral *literal = cast<StringLiteral *>(node)) {
|
||||
const QString text = literal->value->asString();
|
||||
const QString &text = literal->value.toString();
|
||||
BaseTextEditorWidget::Link link;
|
||||
link.begin = literal->literalToken.begin();
|
||||
link.end = literal->literalToken.end();
|
||||
|
||||
@@ -104,8 +104,7 @@ protected:
|
||||
|
||||
virtual bool visit(AST::UiPublicMember *node)
|
||||
{
|
||||
if (node->name
|
||||
&& node->name->asString() == _name
|
||||
if (node->name == _name
|
||||
&& _scopeChain.qmlScopeObjects().contains(_scope)) {
|
||||
_usages.append(node->identifierToken);
|
||||
}
|
||||
@@ -130,7 +129,7 @@ protected:
|
||||
{
|
||||
if (node->qualifiedId
|
||||
&& !node->qualifiedId->next
|
||||
&& node->qualifiedId->name->asString() == _name
|
||||
&& node->qualifiedId->name == _name
|
||||
&& checkQmlScope()) {
|
||||
_usages.append(node->qualifiedId->identifierToken);
|
||||
}
|
||||
@@ -145,7 +144,7 @@ protected:
|
||||
{
|
||||
if (node->qualifiedId
|
||||
&& !node->qualifiedId->next
|
||||
&& node->qualifiedId->name->asString() == _name
|
||||
&& node->qualifiedId->name == _name
|
||||
&& checkQmlScope()) {
|
||||
_usages.append(node->qualifiedId->identifierToken);
|
||||
}
|
||||
@@ -163,7 +162,7 @@ protected:
|
||||
{
|
||||
if (node->qualifiedId
|
||||
&& !node->qualifiedId->next
|
||||
&& node->qualifiedId->name->asString() == _name
|
||||
&& node->qualifiedId->name == _name
|
||||
&& checkQmlScope()) {
|
||||
_usages.append(node->qualifiedId->identifierToken);
|
||||
}
|
||||
@@ -172,7 +171,7 @@ protected:
|
||||
|
||||
virtual bool visit(AST::IdentifierExpression *node)
|
||||
{
|
||||
if (!node->name || node->name->asString() != _name)
|
||||
if (node->name.isEmpty() || node->name != _name)
|
||||
return false;
|
||||
|
||||
const ObjectValue *scope;
|
||||
@@ -203,7 +202,7 @@ protected:
|
||||
|
||||
virtual bool visit(AST::FieldMemberExpression *node)
|
||||
{
|
||||
if (!node->name || node->name->asString() != _name)
|
||||
if (node->name != _name)
|
||||
return true;
|
||||
|
||||
Evaluate evaluate(&_scopeChain);
|
||||
@@ -224,7 +223,7 @@ protected:
|
||||
|
||||
virtual bool visit(AST::FunctionExpression *node)
|
||||
{
|
||||
if (node->name && node->name->asString() == _name) {
|
||||
if (node->name == _name) {
|
||||
if (checkLookup())
|
||||
_usages.append(node->identifierToken);
|
||||
}
|
||||
@@ -237,7 +236,7 @@ protected:
|
||||
|
||||
virtual bool visit(AST::VariableDeclaration *node)
|
||||
{
|
||||
if (node->name && node->name->asString() == _name) {
|
||||
if (node->name == _name) {
|
||||
if (checkLookup())
|
||||
_usages.append(node->identifierToken);
|
||||
}
|
||||
@@ -330,7 +329,7 @@ protected:
|
||||
|
||||
virtual bool visit(AST::UiPublicMember *node)
|
||||
{
|
||||
if (node->memberType && node->memberType->asString() == _name){
|
||||
if (node->memberType == _name){
|
||||
const ObjectValue * tVal = _context->lookupType(_doc.data(), QStringList(_name));
|
||||
if (tVal == _typeValue)
|
||||
_usages.append(node->typeToken);
|
||||
@@ -376,7 +375,7 @@ protected:
|
||||
|
||||
virtual bool visit(AST::IdentifierExpression *node)
|
||||
{
|
||||
if (!node->name || node->name->asString() != _name)
|
||||
if (node->name != _name)
|
||||
return false;
|
||||
|
||||
const ObjectValue *scope;
|
||||
@@ -388,7 +387,7 @@ protected:
|
||||
|
||||
virtual bool visit(AST::FieldMemberExpression *node)
|
||||
{
|
||||
if (!node->name || node->name->asString() != _name)
|
||||
if (node->name != _name)
|
||||
return true;
|
||||
Evaluate evaluate(&_scopeChain);
|
||||
const Value *lhsValue = evaluate(node->base);
|
||||
@@ -422,7 +421,7 @@ protected:
|
||||
|
||||
virtual bool visit(UiImport *ast)
|
||||
{
|
||||
if (ast && ast->importId && ast->importId->asString() == _name) {
|
||||
if (ast && ast->importId == _name) {
|
||||
const Imports *imp = _context->imports(_doc.data());
|
||||
if (!imp)
|
||||
return false;
|
||||
@@ -437,7 +436,7 @@ private:
|
||||
bool checkTypeName(UiQualifiedId *id)
|
||||
{
|
||||
for (UiQualifiedId *att = id; att; att = att->next){
|
||||
if (att->name && att->name->asString() == _name) {
|
||||
if (att->name == _name) {
|
||||
const ObjectValue *objectValue = _context->lookupType(_doc.data(), id, att->next);
|
||||
if (_typeValue == objectValue){
|
||||
_usages.append(att->identifierToken);
|
||||
@@ -522,7 +521,7 @@ protected:
|
||||
virtual bool visit(IdentifierExpression *node)
|
||||
{
|
||||
if (containsOffset(node->identifierToken)) {
|
||||
_name = node->name->asString();
|
||||
_name = node->name.toString();
|
||||
if ((!_name.isEmpty()) && _name.at(0).isUpper()) {
|
||||
// a possible type
|
||||
_targetValue = _scopeChain->lookup(_name, &_scope);
|
||||
@@ -537,7 +536,7 @@ protected:
|
||||
{
|
||||
if (containsOffset(node->identifierToken)) {
|
||||
setScope(node->base);
|
||||
_name = node->name->asString();
|
||||
_name = node->name.toString();
|
||||
if ((!_name.isEmpty()) && _name.at(0).isUpper()) {
|
||||
// a possible type
|
||||
Evaluate evaluate(_scopeChain);
|
||||
@@ -592,8 +591,8 @@ protected:
|
||||
virtual bool visit(UiPublicMember *node)
|
||||
{
|
||||
if (containsOffset(node->typeToken)){
|
||||
if (node->memberType){
|
||||
_name = node->memberType->asString();
|
||||
if (!node->memberType.isEmpty()) {
|
||||
_name = node->memberType.toString();
|
||||
_targetValue = _scopeChain->context()->lookupType(_doc.data(), QStringList(_name));
|
||||
_scope = 0;
|
||||
_typeKind = TypeKind;
|
||||
@@ -601,7 +600,7 @@ protected:
|
||||
return false;
|
||||
} else if (containsOffset(node->identifierToken)) {
|
||||
_scope = _doc->bind()->findQmlObject(_objectNode);
|
||||
_name = node->name->asString();
|
||||
_name = node->name.toString();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -615,7 +614,7 @@ protected:
|
||||
virtual bool visit(FunctionExpression *node)
|
||||
{
|
||||
if (containsOffset(node->identifierToken)) {
|
||||
_name = node->name->asString();
|
||||
_name = node->name.toString();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -624,7 +623,7 @@ protected:
|
||||
virtual bool visit(VariableDeclaration *node)
|
||||
{
|
||||
if (containsOffset(node->identifierToken)) {
|
||||
_name = node->name->asString();
|
||||
_name = node->name.toString();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -643,9 +642,9 @@ private:
|
||||
|
||||
bool checkBindingName(UiQualifiedId *id)
|
||||
{
|
||||
if (id && id->name && !id->next && containsOffset(id->identifierToken)) {
|
||||
if (id && !id->name.isEmpty() && !id->next && containsOffset(id->identifierToken)) {
|
||||
_scope = _doc->bind()->findQmlObject(_objectNode);
|
||||
_name = id->name->asString();
|
||||
_name = id->name.toString();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -654,10 +653,10 @@ private:
|
||||
bool checkTypeName(UiQualifiedId *id)
|
||||
{
|
||||
for (UiQualifiedId *att = id; att; att = att->next) {
|
||||
if (att->name && containsOffset(att->identifierToken)) {
|
||||
if (!att->name.isEmpty() && containsOffset(att->identifierToken)) {
|
||||
_targetValue = _scopeChain->context()->lookupType(_doc.data(), id, att->next);
|
||||
_scope = 0;
|
||||
_name = att->name->asString();
|
||||
_name = att->name.toString();
|
||||
_typeKind = TypeKind;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -197,8 +197,8 @@ bool HoverHandler::matchColorItem(const ScopeChain &scopeChain,
|
||||
}
|
||||
} else if (const AST::UiPublicMember *publicMember =
|
||||
AST::cast<const AST::UiPublicMember *>(member)) {
|
||||
if (publicMember->name && posIsInSource(pos, publicMember->statement)) {
|
||||
value = scopeChain.lookup(publicMember->name->asString());
|
||||
if (!publicMember->name.isEmpty() && posIsInSource(pos, publicMember->statement)) {
|
||||
value = scopeChain.lookup(publicMember->name.toString());
|
||||
if (const Reference *ref = value->asReference())
|
||||
value = scopeChain.context()->lookupReference(ref);
|
||||
if (value && value->asColorValue()) {
|
||||
@@ -317,14 +317,14 @@ static const ObjectValue *isMember(const ScopeChain &scopeChain,
|
||||
{
|
||||
const ObjectValue *owningObject = 0;
|
||||
if (AST::IdentifierExpression *identExp = AST::cast<AST::IdentifierExpression *>(node)) {
|
||||
if (!identExp->name)
|
||||
if (identExp->name.isEmpty())
|
||||
return 0;
|
||||
*name = identExp->name->asString();
|
||||
*name = identExp->name.toString();
|
||||
scopeChain.lookup(*name, &owningObject);
|
||||
} else if (AST::FieldMemberExpression *fme = AST::cast<AST::FieldMemberExpression *>(node)) {
|
||||
if (!fme->base || !fme->name)
|
||||
if (!fme->base || fme->name.isEmpty())
|
||||
return 0;
|
||||
*name = fme->name->asString();
|
||||
*name = fme->name.toString();
|
||||
const Value *base = scopeChain.evaluate(fme->base);
|
||||
if (!base)
|
||||
return 0;
|
||||
@@ -332,17 +332,17 @@ static const ObjectValue *isMember(const ScopeChain &scopeChain,
|
||||
if (owningObject)
|
||||
owningObject->lookupMember(*name, scopeChain.context(), &owningObject);
|
||||
} else if (AST::UiQualifiedId *qid = AST::cast<AST::UiQualifiedId *>(node)) {
|
||||
if (!qid->name)
|
||||
if (qid->name.isEmpty())
|
||||
return 0;
|
||||
*name = qid->name->asString();
|
||||
*name = qid->name.toString();
|
||||
const Value *value = scopeChain.lookup(*name, &owningObject);
|
||||
for (AST::UiQualifiedId *it = qid->next; it; it = it->next) {
|
||||
if (!value)
|
||||
return 0;
|
||||
const ObjectValue *next = value->asObjectValue();
|
||||
if (!next || !it->name)
|
||||
if (!next || it->name.isEmpty())
|
||||
return 0;
|
||||
*name = it->name->asString();
|
||||
*name = it->name.toString();
|
||||
value = next->lookupMember(*name, scopeChain.context(), &owningObject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,19 +168,19 @@ protected:
|
||||
{
|
||||
if (!m_inStateType)
|
||||
return false;
|
||||
if (!ast->qualifiedId || ! ast->qualifiedId->name || ast->qualifiedId->next)
|
||||
if (!ast->qualifiedId || ast->qualifiedId->name.isEmpty() || ast->qualifiedId->next)
|
||||
return false;
|
||||
if (ast->qualifiedId->name->asString() != QLatin1String("name"))
|
||||
if (ast->qualifiedId->name != QLatin1String("name"))
|
||||
return false;
|
||||
|
||||
ExpressionStatement *expStmt = cast<ExpressionStatement *>(ast->statement);
|
||||
if (!expStmt)
|
||||
return false;
|
||||
StringLiteral *strLit = cast<StringLiteral *>(expStmt->expression);
|
||||
if (!strLit || !strLit->value)
|
||||
if (!strLit || strLit->value.isEmpty())
|
||||
return false;
|
||||
|
||||
m_stateNames += strLit->value->asString();
|
||||
m_stateNames += strLit->value.toString();
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -211,12 +211,12 @@ protected:
|
||||
m_scopeBuilder.pop();
|
||||
}
|
||||
|
||||
void processName(NameId *name, SourceLocation location)
|
||||
void processName(const QStringRef &name, SourceLocation location)
|
||||
{
|
||||
if (!name)
|
||||
if (name.isEmpty())
|
||||
return;
|
||||
|
||||
const QString nameStr = name->asString();
|
||||
const QString &nameStr = name.toString();
|
||||
const ObjectValue *scope = 0;
|
||||
const Value *value = m_scopeChain.lookup(nameStr, &scope);
|
||||
if (!value || !scope)
|
||||
@@ -299,10 +299,10 @@ protected:
|
||||
|
||||
bool visit(StringLiteral *ast)
|
||||
{
|
||||
if (!ast->value)
|
||||
if (ast->value.isEmpty())
|
||||
return false;
|
||||
|
||||
const QString value = ast->value->asString();
|
||||
const QString &value = ast->value.toString();
|
||||
if (m_stateNames.contains(value)) {
|
||||
addUse(ast->literalToken, SemanticHighlighter::LocalStateNameType);
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ private:
|
||||
AST::IdentifierExpression *lhsIdent = AST::cast<AST::IdentifierExpression *>(binExp->left);
|
||||
AST::ObjectLiteral *rhsObjLit = AST::cast<AST::ObjectLiteral *>(binExp->right);
|
||||
|
||||
if (lhsIdent && rhsObjLit && (lhsIdent->name->asString() == "testcase")
|
||||
if (lhsIdent && rhsObjLit && (lhsIdent->name == "testcase")
|
||||
&& (binExp->op == QSOperator::Assign)) {
|
||||
QModelIndex index = m_model->enterTestCase(rhsObjLit);
|
||||
m_nodeToIndex.insert(rhsObjLit, index);
|
||||
@@ -553,8 +553,8 @@ QModelIndex QmlOutlineModel::enterPublicMember(AST::UiPublicMember *publicMember
|
||||
{
|
||||
QMap<int, QVariant> objectData;
|
||||
|
||||
if (publicMember->name)
|
||||
objectData.insert(Qt::DisplayRole, publicMember->name->asString());
|
||||
if (!publicMember->name.isEmpty())
|
||||
objectData.insert(Qt::DisplayRole, publicMember->name.toString());
|
||||
objectData.insert(AnnotationRole, getAnnotation(publicMember->statement));
|
||||
objectData.insert(ItemTypeRole, NonElementBindingType);
|
||||
|
||||
@@ -572,7 +572,8 @@ QModelIndex QmlOutlineModel::enterFunctionDeclaration(AST::FunctionDeclaration *
|
||||
{
|
||||
QMap<int, QVariant> objectData;
|
||||
|
||||
objectData.insert(Qt::DisplayRole, functionDeclaration->name->asString());
|
||||
if (!functionDeclaration->name.isEmpty())
|
||||
objectData.insert(Qt::DisplayRole, functionDeclaration->name.toString());
|
||||
objectData.insert(ItemTypeRole, ElementBindingType);
|
||||
|
||||
QmlOutlineItem *item = enterNode(objectData, functionDeclaration, 0, m_icons->functionDeclarationIcon());
|
||||
@@ -606,7 +607,7 @@ QModelIndex QmlOutlineModel::enterTestCaseProperties(AST::PropertyNameAndValueLi
|
||||
{
|
||||
QMap<int, QVariant> objectData;
|
||||
if (AST::IdentifierPropertyName *propertyName = AST::cast<AST::IdentifierPropertyName *>(propertyNameAndValueList->name)) {
|
||||
objectData.insert(Qt::DisplayRole, propertyName->id->asString());
|
||||
objectData.insert(Qt::DisplayRole, propertyName->id.toString());
|
||||
objectData.insert(ItemTypeRole, ElementBindingType);
|
||||
QmlOutlineItem *item;
|
||||
if (propertyNameAndValueList->value->kind == AST::Node::Kind_FunctionExpression) {
|
||||
@@ -895,8 +896,8 @@ QString QmlOutlineModel::asString(AST::UiQualifiedId *id)
|
||||
{
|
||||
QString text;
|
||||
for (; id; id = id->next) {
|
||||
if (id->name)
|
||||
text += id->name->asString();
|
||||
if (!id->name.isEmpty())
|
||||
text += id->name;
|
||||
else
|
||||
text += QLatin1Char('?');
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ static inline const ObjectValue * getPropertyChangesTarget(Node *node, const Sco
|
||||
for (UiObjectMemberList *members = initializer->members; members; members = members->next) {
|
||||
if (UiScriptBinding *scriptBinding = cast<UiScriptBinding *>(members->member)) {
|
||||
if (scriptBinding->qualifiedId
|
||||
&& scriptBinding->qualifiedId->name->asString() == QLatin1String("target")
|
||||
&& scriptBinding->qualifiedId->name == QLatin1String("target")
|
||||
&& ! scriptBinding->qualifiedId->next) {
|
||||
Evaluate evaluator(&scopeChain);
|
||||
const Value *targetValue = evaluator(scriptBinding->statement);
|
||||
@@ -184,12 +184,12 @@ void QuickToolBar::apply(TextEditor::BaseTextEditor *editor, Document::Ptr docum
|
||||
quint32 end = 0;
|
||||
UiObjectInitializer *initializer = 0;
|
||||
if (objectDefinition) {
|
||||
name = objectDefinition->qualifiedTypeNameId->name->asString();
|
||||
name = objectDefinition->qualifiedTypeNameId->name.toString();
|
||||
initializer = objectDefinition->initializer;
|
||||
offset = objectDefinition->firstSourceLocation().offset;
|
||||
end = objectDefinition->lastSourceLocation().end();
|
||||
} else if (objectBinding) {
|
||||
name = objectBinding->qualifiedTypeNameId->name->asString();
|
||||
name = objectBinding->qualifiedTypeNameId->name.toString();
|
||||
initializer = objectBinding->initializer;
|
||||
offset = objectBinding->firstSourceLocation().offset;
|
||||
end = objectBinding->lastSourceLocation().end();
|
||||
@@ -274,10 +274,10 @@ bool QuickToolBar::isAvailable(TextEditor::BaseTextEditor *, Document::Ptr docum
|
||||
UiObjectDefinition *objectDefinition = cast<UiObjectDefinition*>(node);
|
||||
UiObjectBinding *objectBinding = cast<UiObjectBinding*>(node);
|
||||
if (objectDefinition) {
|
||||
name = objectDefinition->qualifiedTypeNameId->name->asString();
|
||||
name = objectDefinition->qualifiedTypeNameId->name.toString();
|
||||
|
||||
} else if (objectBinding) {
|
||||
name = objectBinding->qualifiedTypeNameId->name->asString();
|
||||
name = objectBinding->qualifiedTypeNameId->name.toString();
|
||||
}
|
||||
|
||||
QStringList prototypes;
|
||||
|
||||
Reference in New Issue
Block a user