forked from qt-creator/qt-creator
Fix coding style for else statements
Change-Id: I1309db70e98d678e150388c76ce665e988fdf081 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
c67f7f6349
commit
ad9e7ccab6
@@ -905,7 +905,7 @@ bool Lexer::scanRegExp(RegExpBodyPrefix prefix)
|
||||
while (! _char.isNull() && ! isLineTerminator()) {
|
||||
if (_char == QLatin1Char(']'))
|
||||
break;
|
||||
else if (_char == QLatin1Char('\\')) {
|
||||
if (_char == QLatin1Char('\\')) {
|
||||
// regular expression backslash sequence
|
||||
_tokenText += _char;
|
||||
scanChar();
|
||||
|
||||
@@ -154,9 +154,9 @@ ObjectValue *Bind::bindObject(UiQualifiedId *qualifiedTypeNameId, UiObjectInitia
|
||||
|
||||
parentObjectValue = switchObjectValue(objectValue);
|
||||
|
||||
if (parentObjectValue)
|
||||
if (parentObjectValue) {
|
||||
objectValue->setMember(QLatin1String("parent"), parentObjectValue);
|
||||
else if (!_rootObjectValue) {
|
||||
} else if (!_rootObjectValue) {
|
||||
_rootObjectValue = objectValue;
|
||||
_rootObjectValue->setClassName(_doc->componentName());
|
||||
}
|
||||
|
||||
@@ -255,14 +255,13 @@ protected:
|
||||
qreal result = badnessFromSplits;
|
||||
foreach (const QString &line, lines) {
|
||||
// really long lines should be avoided at all cost
|
||||
if (line.size() > strongMaxLineLength)
|
||||
if (line.size() > strongMaxLineLength) {
|
||||
result += 50 + (line.size() - strongMaxLineLength);
|
||||
// having long lines is bad
|
||||
else if (line.size() > maxLineLength) {
|
||||
} else if (line.size() > maxLineLength) {
|
||||
result += 3 + (line.size() - maxLineLength);
|
||||
}
|
||||
// and even ok-sized lines should have a cost
|
||||
else {
|
||||
} else {
|
||||
result += 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -282,9 +282,8 @@ void Rewriter::changeBinding(UiObjectInitializer *ast,
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
// for grouped properties:
|
||||
else if (!prefix.isEmpty()) {
|
||||
} else if (!prefix.isEmpty()) {
|
||||
if (UiObjectDefinition *def = cast<UiObjectDefinition *>(member)) {
|
||||
if (toString(def->qualifiedTypeNameId) == prefix)
|
||||
changeBinding(def->initializer, suffix, newValue, binding);
|
||||
@@ -384,10 +383,10 @@ void Rewriter::removeBindingByName(UiObjectInitializer *ast, const QString &prop
|
||||
UiObjectMember *member = it->member;
|
||||
|
||||
// run full name match (for ungrouped properties):
|
||||
if (isMatchingPropertyMember(propertyName, member))
|
||||
if (isMatchingPropertyMember(propertyName, member)) {
|
||||
removeMember(member);
|
||||
// check for grouped properties:
|
||||
else if (!prefix.isEmpty()) {
|
||||
} else if (!prefix.isEmpty()) {
|
||||
if (UiObjectDefinition *def = cast<UiObjectDefinition *>(member)) {
|
||||
if (toString(def->qualifiedTypeNameId) == prefix)
|
||||
removeGroupedProperty(def, propertyName);
|
||||
|
||||
@@ -80,10 +80,10 @@ void ScopeBuilder::push(AST::Node *node)
|
||||
break;
|
||||
}
|
||||
// signals defined in QML
|
||||
if (const ASTSignal *astsig = value_cast<ASTSignal>(value))
|
||||
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)) {
|
||||
} else if (const CppComponentValue *qmlObject = value_cast<CppComponentValue>(owner)) {
|
||||
if (const ObjectValue *scope = qmlObject->signalScope(name))
|
||||
_scopeChain->appendJsScope(scope);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user