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 (Function *function = symbol->type()->asFunctionType()) {
|
||||||
// If the member is a function, automatically place the opening parenthesis,
|
// If the member is a function, automatically place the opening parenthesis,
|
||||||
// except when it might take template parameters.
|
// 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
|
// Don't insert any magic, since the user might have just wanted to select the class
|
||||||
|
|
||||||
/// ### port me
|
/// ### port me
|
||||||
@@ -1764,10 +1766,13 @@ bool CppCompletionAssistProcessor::completeConstructorOrFunction(const QList<CPl
|
|||||||
|
|
||||||
if (Function *fun = asFunctionOrTemplateFunctionType(ty)) {
|
if (Function *fun = asFunctionOrTemplateFunctionType(ty)) {
|
||||||
|
|
||||||
if (! fun->name())
|
if (!fun->name()) {
|
||||||
continue;
|
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.
|
continue; // skip fun, it's an hidden declaration.
|
||||||
|
}
|
||||||
|
|
||||||
bool newOverload = true;
|
bool newOverload = true;
|
||||||
|
|
||||||
|
|||||||
@@ -188,8 +188,11 @@ static void find_helper(QFutureInterface<Usage> &future,
|
|||||||
const QString sourceFile = QString::fromUtf8(symbol->fileName(), symbol->fileNameLength());
|
const QString sourceFile = QString::fromUtf8(symbol->fileName(), symbol->fileNameLength());
|
||||||
QStringList files(sourceFile);
|
QStringList files(sourceFile);
|
||||||
|
|
||||||
if (symbol->isClass() || symbol->isForwardClassDeclaration() || (symbol->enclosingScope() && ! symbol->isStatic() &&
|
if (symbol->isClass()
|
||||||
symbol->enclosingScope()->isNamespace())) {
|
|| symbol->isForwardClassDeclaration()
|
||||||
|
|| (symbol->enclosingScope()
|
||||||
|
&& !symbol->isStatic()
|
||||||
|
&& symbol->enclosingScope()->isNamespace())) {
|
||||||
foreach (const Document::Ptr &doc, context.snapshot()) {
|
foreach (const Document::Ptr &doc, context.snapshot()) {
|
||||||
if (doc->fileName() == sourceFile)
|
if (doc->fileName() == sourceFile)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -174,8 +174,10 @@ Function *SymbolFinder::findMatchingDefinition(Symbol *declaration,
|
|||||||
Function *best = 0;
|
Function *best = 0;
|
||||||
|
|
||||||
foreach (Function *fun, viableFunctions) {
|
foreach (Function *fun, viableFunctions) {
|
||||||
if (! (fun->unqualifiedName() && fun->unqualifiedName()->isEqualTo(declaration->unqualifiedName())))
|
if (!(fun->unqualifiedName()
|
||||||
|
&& fun->unqualifiedName()->isEqualTo(declaration->unqualifiedName()))) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
if (fun->argumentCount() == declarationTy->argumentCount()) {
|
if (fun->argumentCount() == declarationTy->argumentCount()) {
|
||||||
if (!strict && !best)
|
if (!strict && !best)
|
||||||
best = fun;
|
best = fun;
|
||||||
|
|||||||
Reference in New Issue
Block a user