CppTools: Do not try to find definitions of generated symbols

This speeds up the quick fix InsertDefFromDecl on function declarations
in classes containing Q_OBJECT.

Task-number: QTCREATORBUG-9877

Change-Id: I0af16f17f40735040b7158a3191c13db3433edf9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Lorenz Haas <lykurg@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
Nikolai Kosjar
2013-07-24 14:41:01 +02:00
parent 11d2d74476
commit 83bbd534e5
3 changed files with 59 additions and 2 deletions

View File

@@ -498,8 +498,7 @@ static InsertionLocation nextToSurroundingDefinitions(Symbol *declaration,
Declaration *surroundingFunctionDecl = 0;
for (int i = declIndex - 1; i >= 0; --i) {
Symbol *s = klass->memberAt(i);
surroundingFunctionDecl = isNonVirtualFunctionDeclaration(s);
if (!surroundingFunctionDecl)
if (s->isGenerated() || !(surroundingFunctionDecl = isNonVirtualFunctionDeclaration(s)))
continue;
if ((definitionFunction = symbolFinder.findMatchingDefinition(surroundingFunctionDecl,
changes.snapshot())))