forked from qt-creator/qt-creator
CppTools: Fix "! condition" coding style
Change-Id: Ic7e634e4249fb64edbc2daceb65ec8e9b5f0f8b9 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
This commit is contained in:
@@ -218,7 +218,9 @@ void CppAssistProposalItem::applyContextualContent(TextEditor::BaseTextEditor *e
|
||||
if (Function *function = symbol->type()->asFunctionType()) {
|
||||
// If the member is a function, automatically place the opening parenthesis,
|
||||
// except when it might take template parameters.
|
||||
if (! function->hasReturnType() && (function->unqualifiedName() && !function->unqualifiedName()->isDestructorNameId())) {
|
||||
if (!function->hasReturnType()
|
||||
&& (function->unqualifiedName()
|
||||
&& !function->unqualifiedName()->isDestructorNameId())) {
|
||||
// Don't insert any magic, since the user might have just wanted to select the class
|
||||
|
||||
/// ### port me
|
||||
@@ -1764,10 +1766,13 @@ bool CppCompletionAssistProcessor::completeConstructorOrFunction(const QList<CPl
|
||||
|
||||
if (Function *fun = asFunctionOrTemplateFunctionType(ty)) {
|
||||
|
||||
if (! fun->name())
|
||||
if (!fun->name()) {
|
||||
continue;
|
||||
else if (! functions.isEmpty() && enclosingNonTemplateScope(functions.first()) != enclosingNonTemplateScope(fun))
|
||||
} else if (!functions.isEmpty()
|
||||
&& enclosingNonTemplateScope(functions.first())
|
||||
!= enclosingNonTemplateScope(fun)) {
|
||||
continue; // skip fun, it's an hidden declaration.
|
||||
}
|
||||
|
||||
bool newOverload = true;
|
||||
|
||||
|
||||
@@ -188,8 +188,11 @@ static void find_helper(QFutureInterface<Usage> &future,
|
||||
const QString sourceFile = QString::fromUtf8(symbol->fileName(), symbol->fileNameLength());
|
||||
QStringList files(sourceFile);
|
||||
|
||||
if (symbol->isClass() || symbol->isForwardClassDeclaration() || (symbol->enclosingScope() && ! symbol->isStatic() &&
|
||||
symbol->enclosingScope()->isNamespace())) {
|
||||
if (symbol->isClass()
|
||||
|| symbol->isForwardClassDeclaration()
|
||||
|| (symbol->enclosingScope()
|
||||
&& !symbol->isStatic()
|
||||
&& symbol->enclosingScope()->isNamespace())) {
|
||||
foreach (const Document::Ptr &doc, context.snapshot()) {
|
||||
if (doc->fileName() == sourceFile)
|
||||
continue;
|
||||
|
||||
@@ -174,8 +174,10 @@ Function *SymbolFinder::findMatchingDefinition(Symbol *declaration,
|
||||
Function *best = 0;
|
||||
|
||||
foreach (Function *fun, viableFunctions) {
|
||||
if (! (fun->unqualifiedName() && fun->unqualifiedName()->isEqualTo(declaration->unqualifiedName())))
|
||||
if (!(fun->unqualifiedName()
|
||||
&& fun->unqualifiedName()->isEqualTo(declaration->unqualifiedName()))) {
|
||||
continue;
|
||||
}
|
||||
if (fun->argumentCount() == declarationTy->argumentCount()) {
|
||||
if (!strict && !best)
|
||||
best = fun;
|
||||
|
||||
Reference in New Issue
Block a user