CppEditor: simplify CppQuickFixOperation interface

Change-Id: Ib3ed82c7f07f80027b18471ffb7b3055fa74eb52
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
hjk
2012-10-10 23:27:16 +02:00
parent 9f38f7bfbc
commit 438e4af735
20 changed files with 327 additions and 463 deletions

View File

@@ -173,8 +173,7 @@ public:
} // end of anonymous namespace
QList<QmlJSQuickFixOperation::Ptr> WrapInLoader::match(
const QSharedPointer<const QmlJSQuickFixAssistInterface> &interface)
void WrapInLoader::match(const QmlJSQuickFixInterface &interface, QuickFixOperations &result)
{
const int pos = interface->currentFile()->cursor().position();
@@ -183,13 +182,12 @@ QList<QmlJSQuickFixOperation::Ptr> WrapInLoader::match(
Node *node = path.at(i);
if (UiObjectDefinition *objDef = cast<UiObjectDefinition *>(node)) {
if (!interface->currentFile()->isCursorOn(objDef->qualifiedTypeNameId))
return noResult();
return;
// check that the node is not the root node
if (i > 0 && !cast<UiProgram*>(path.at(i - 1))) {
return singleResult(new Operation(interface, objDef));
result.append(QuickFixOperation::Ptr(new Operation(interface, objDef)));
return;
}
}
}
return noResult();
}