CppEditor: Merge AddIncludeForForwardDeclaration into AddIncludeForUndefinedIdentifier

* Fixes multiple addition of same include.
* Takes over the check of AddIncludeForForwardDeclaration for forward
  headers.

Task-number: QTCREATORBUG-9704
Change-Id: I84629d35ae433385942a9157e5d32ef04159d07f
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
Nikolai Kosjar
2014-10-08 15:41:02 +02:00
committed by Nikolai Kosjar
parent 65e9da282f
commit 7a3c942f35
6 changed files with 212 additions and 175 deletions

View File

@@ -62,7 +62,7 @@ namespace Internal {
void registerQuickFixes(ExtensionSystem::IPlugin *plugIn);
/*!
Adds an include for an undefined identifier.
Adds an include for an undefined identifier or only forward declared identifier.
Activates on: the undefined identifier
*/
@@ -84,17 +84,6 @@ private:
QString m_include;
};
/*!
Can be triggered on a class forward declaration to add the matching #include.
Activates on: the name of a forward-declared class or struct
*/
class AddIncludeForForwardDeclaration: public CppQuickFixFactory
{
public:
void match(const CppQuickFixInterface &interface, QuickFixOperations &result);
};
/*!
Rewrite
a op b