diff options
author | hjk <hjk@qt.io> | 2017-04-27 17:23:28 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2017-05-02 07:46:29 +0000 |
commit | d8bacfe9af1082ce6a12ec418be430b5bee65efa (patch) | |
tree | 3b3f78e0f1f8e2d9816393b4f3bdb4e8c15a3c28 /src/plugins/valgrind/memchecktool.cpp | |
parent | 6e990f96c66b40fcf73db65a857f20f8a1dc4389 (diff) |
Valgrind: Move to new target/tool split for local setups
Change-Id: I1167fdc147600c36149c13731d0680b858acf4fb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/valgrind/memchecktool.cpp')
-rw-r--r-- | src/plugins/valgrind/memchecktool.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index aab1a8c24e..4c8d421a6c 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -251,7 +251,7 @@ private: void settingsDestroyed(QObject *settings); void maybeActiveRunConfigurationChanged(); - void engineStarting(const MemcheckRunControl *engine); + void engineStarting(const MemcheckToolRunner *engine); void engineFinished(); void loadingExternalXmlLogFileFinished(); @@ -565,18 +565,20 @@ RunControl *MemcheckTool::createRunControl(RunConfiguration *runConfiguration, C m_errorModel.setRelevantFrameFinder(makeFrameFinder(runConfiguration ? runConfiguration->target()->project()->files(Project::AllFiles) : QStringList())); - MemcheckRunControl *runControl = 0; + auto runControl = new RunControl(runConfiguration, runMode); + MemcheckToolRunner *runTool = 0; if (runMode == MEMCHECK_RUN_MODE) - runControl = new MemcheckRunControl(runConfiguration, runMode); + runTool = new MemcheckToolRunner(runControl); else - runControl = new MemcheckWithGdbRunControl(runConfiguration, runMode); - connect(runControl, &MemcheckRunControl::starting, - this, [this, runControl]() { engineStarting(runControl); }); - connect(runControl, &MemcheckRunControl::parserError, this, &MemcheckTool::parserError); - connect(runControl, &MemcheckRunControl::internalParserError, this, &MemcheckTool::internalParserError); - connect(runControl, &MemcheckRunControl::finished, this, &MemcheckTool::engineFinished); + runTool = new MemcheckWithGdbToolRunner(runControl); - connect(m_stopAction, &QAction::triggered, runControl, [runControl] { runControl->stop(); }); + connect(runTool, &MemcheckToolRunner::starting, + this, [this, runTool] { engineStarting(runTool); }); + connect(runTool, &MemcheckToolRunner::parserError, this, &MemcheckTool::parserError); + connect(runTool, &MemcheckToolRunner::internalParserError, this, &MemcheckTool::internalParserError); + connect(runControl, &RunControl::finished, this, &MemcheckTool::engineFinished); + + connect(m_stopAction, &QAction::triggered, runControl, &RunControl::stop); m_toolBusy = true; updateRunActions(); @@ -584,21 +586,21 @@ RunControl *MemcheckTool::createRunControl(RunConfiguration *runConfiguration, C return runControl; } -void MemcheckTool::engineStarting(const MemcheckRunControl *runControl) +void MemcheckTool::engineStarting(const MemcheckToolRunner *runTool) { setBusyCursor(true); clearErrorView(); m_loadExternalLogFile->setDisabled(true); QString dir; - if (RunConfiguration *rc = runControl->runConfiguration()) + if (RunConfiguration *rc = runTool->runControl()->runConfiguration()) dir = rc->target()->project()->projectDirectory().toString() + QLatin1Char('/'); - const QString name = Utils::FileName::fromString(runControl->executable()).fileName(); + const QString name = Utils::FileName::fromString(runTool->executable()).fileName(); m_errorView->setDefaultSuppressionFile(dir + name + QLatin1String(".supp")); - foreach (const QString &file, runControl->suppressionFiles()) { + foreach (const QString &file, runTool->suppressionFiles()) { QAction *action = m_filterMenu->addAction(Utils::FileName::fromString(file).fileName()); action->setToolTip(file); connect(action, &QAction::triggered, this, [this, file]() { |