diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2016-01-22 17:08:50 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2016-01-22 17:26:17 +0000 |
commit | a1dd1e4c5bf4d3c5fe50f7b89a6f185ad4a622b0 (patch) | |
tree | 7af169437d46d48e05c1661fda7a38e98afe315a /src/plugins/clangstaticanalyzer/clangstaticanalyzertool.cpp | |
parent | 0f4db8a32fc5665bdc4f40999b2741932f0b051b (diff) | |
download | qt-creator-a1dd1e4c5bf4d3c5fe50f7b89a6f185ad4a622b0.tar.gz |
Add runConfiguration to remote tool starters
Most of them need a run configuration. It's better to pass the
right one than to use various hacky ways to work around it.
Change-Id: Ic21b0ef33bdd79b526b1e1a1ead5ca87d9f32c4d
Reviewed-by: hjk <hjk@theqtcompany.com>
Diffstat (limited to 'src/plugins/clangstaticanalyzer/clangstaticanalyzertool.cpp')
-rw-r--r-- | src/plugins/clangstaticanalyzer/clangstaticanalyzertool.cpp | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzertool.cpp b/src/plugins/clangstaticanalyzer/clangstaticanalyzertool.cpp index 9fe109d63d..b1a3a1e9fb 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzertool.cpp +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzertool.cpp @@ -58,22 +58,6 @@ using namespace ProjectExplorer; namespace ClangStaticAnalyzer { namespace Internal { -class DummyRunConfiguration : public RunConfiguration -{ - Q_OBJECT - -public: - DummyRunConfiguration(Target *parent) - : RunConfiguration(parent, "ClangStaticAnalyzer.DummyRunConfig") - { - setDefaultDisplayName(tr("Clang Static Analyzer")); - addExtraAspects(); - } - -private: - QWidget *createConfigurationWidget() override { return 0; } -}; - ClangStaticAnalyzerTool::ClangStaticAnalyzerTool(QObject *parent) : QObject(parent) , m_diagnosticModel(0) @@ -225,7 +209,7 @@ static bool dontStartAfterHintForDebugMode(Project *project) return false; } -void ClangStaticAnalyzerTool::startTool() +void ClangStaticAnalyzerTool::startTool(ProjectExplorer::RunConfiguration *runConfiguration) { AnalyzerManager::showMode(); @@ -243,21 +227,8 @@ void ClangStaticAnalyzerTool::startTool() m_running = true; handleStateUpdate(); - Target * const target = project->activeTarget(); - QTC_ASSERT(target, return); - DummyRunConfiguration *& rc = m_runConfigs[target]; - if (!rc) { - rc = new DummyRunConfiguration(target); - connect(project, &Project::aboutToRemoveTarget, this, - [this](Target *t) { m_runConfigs.remove(t); }); - const auto onProjectRemoved = [this](Project *p) { - foreach (Target * const t, p->targets()) - m_runConfigs.remove(t); - }; - connect(SessionManager::instance(), &SessionManager::aboutToRemoveProject, this, - onProjectRemoved, Qt::UniqueConnection); - } - ProjectExplorerPlugin::runRunConfiguration(rc, Constants::CLANGSTATICANALYZER_RUN_MODE); + ProjectExplorerPlugin::runRunConfiguration(runConfiguration, + Constants::CLANGSTATICANALYZER_RUN_MODE); } CppTools::ProjectInfo ClangStaticAnalyzerTool::projectInfoBeforeBuild() const @@ -328,5 +299,3 @@ void ClangStaticAnalyzerTool::handleStateUpdate() } // namespace Internal } // namespace ClangStaticAnalyzer - -#include "clangstaticanalyzertool.moc" |