diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2016-12-14 18:58:23 +0100 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2016-12-16 13:56:26 +0000 |
commit | bd66d5ac053db5f0b364d458e42f3c87432f8776 (patch) | |
tree | b9a16fb9393e3e3fbee6b68a0dab80e83f277fb1 /src/plugins/cpptools/baseeditordocumentparser.h | |
parent | 54216150703666a29a7f70060430370f7b15d4fa (diff) | |
download | qt-creator-bd66d5ac053db5f0b364d458e42f3c87432f8776.tar.gz |
CppTools: Remove some duplication
Change-Id: I8c84660b28c3e76b2cedd08ff3b44a38583f38a0
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/cpptools/baseeditordocumentparser.h')
-rw-r--r-- | src/plugins/cpptools/baseeditordocumentparser.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/plugins/cpptools/baseeditordocumentparser.h b/src/plugins/cpptools/baseeditordocumentparser.h index 056dca52a8..d41b0ed08f 100644 --- a/src/plugins/cpptools/baseeditordocumentparser.h +++ b/src/plugins/cpptools/baseeditordocumentparser.h @@ -52,6 +52,18 @@ public: ProjectPart::Ptr manuallySetProjectPart; }; + struct UpdateParams { + UpdateParams(const WorkingCopy &workingCopy, + const ProjectExplorer::Project *activeProject) + : workingCopy(workingCopy) + , activeProject(activeProject) + { + } + + WorkingCopy workingCopy; + const ProjectExplorer::Project *activeProject = nullptr; + }; + public: BaseEditorDocumentParser(const QString &filePath); virtual ~BaseEditorDocumentParser(); @@ -60,11 +72,8 @@ public: Configuration configuration() const; void setConfiguration(const Configuration &configuration); - void update(const WorkingCopy &workingCopy, - const ProjectExplorer::Project *activeProject); - void update(const QFutureInterface<void> &future, - const WorkingCopy &workingCopy, - const ProjectExplorer::Project *activeProject); + void update(const UpdateParams &updateParams); + void update(const QFutureInterface<void> &future, const UpdateParams &updateParams); ProjectPart::Ptr projectPart() const; @@ -85,8 +94,7 @@ protected: private: virtual void updateImpl(const QFutureInterface<void> &future, - const WorkingCopy &workingCopy, - const ProjectExplorer::Project *activeProject) = 0; + const UpdateParams &updateParams) = 0; const QString m_filePath; Configuration m_configuration; |