forked from qt-creator/qt-creator
Analyzer: Move non-static parts of IAnalyzerTool::start*Tool
... to user code. Change-Id: Ibe278134e39cfb3f90acedc976fab5e9dc019046 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -57,7 +57,10 @@
|
||||
|
||||
#include <cplusplus/LookupContext.h>
|
||||
#include <cplusplus/Overview.h>
|
||||
#include <cplusplus/Symbols.h>
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
#include <texteditor/texteditor.h>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -65,7 +68,9 @@
|
||||
#include <utils/styledbar.h>
|
||||
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/projecttree.h>
|
||||
#include <projectexplorer/session.h>
|
||||
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
@@ -87,9 +92,6 @@
|
||||
#include <QToolButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
// shared/cplusplus includes
|
||||
#include <cplusplus/Symbols.h>
|
||||
|
||||
using namespace Analyzer;
|
||||
using namespace Core;
|
||||
using namespace Valgrind::Callgrind;
|
||||
@@ -558,11 +560,18 @@ AnalyzerRunControl *CallgrindToolPrivate::createRunControl(const AnalyzerStartPa
|
||||
|
||||
void CallgrindTool::startTool(StartMode mode)
|
||||
{
|
||||
if (mode == StartLocal)
|
||||
startLocalTool(ReleaseMode, CallgrindRunMode);
|
||||
if (mode == StartRemote)
|
||||
startRemoteTool(CallgrindRunMode);
|
||||
d->setBusyCursor(true);
|
||||
if (mode == StartLocal && checkForLocalStart(ReleaseMode)) {
|
||||
Project *pro = SessionManager::startupProject();
|
||||
ProjectExplorerPlugin::instance()->runProject(pro, CallgrindRunMode);
|
||||
d->setBusyCursor(true);
|
||||
}
|
||||
|
||||
AnalyzerStartParameters sp;
|
||||
if (mode == StartRemote && checkForRemoteStart(&sp)) {
|
||||
AnalyzerRunControl *rc = createRunControl(sp, 0);
|
||||
ProjectExplorerPlugin::startRunControl(rc, CallgrindRunMode);
|
||||
d->setBusyCursor(true);
|
||||
}
|
||||
}
|
||||
|
||||
void CallgrindTool::handleShowCostsOfFunction()
|
||||
|
||||
@@ -599,10 +599,16 @@ void MemcheckTool::setBusyCursor(bool busy)
|
||||
|
||||
void MemcheckTool::startTool(StartMode mode)
|
||||
{
|
||||
if (mode == StartLocal)
|
||||
startLocalTool(DebugMode, MemcheckRunMode);
|
||||
if (mode == StartRemote)
|
||||
startRemoteTool(MemcheckRunMode);
|
||||
if (mode == StartLocal && checkForLocalStart(DebugMode)) {
|
||||
Project *pro = SessionManager::startupProject();
|
||||
ProjectExplorerPlugin::instance()->runProject(pro, MemcheckRunMode);
|
||||
}
|
||||
|
||||
AnalyzerStartParameters sp;
|
||||
if (mode == StartRemote && checkForRemoteStart(&sp)) {
|
||||
AnalyzerRunControl *rc = createRunControl(sp, 0);
|
||||
ProjectExplorerPlugin::startRunControl(rc, MemcheckRunMode);
|
||||
}
|
||||
}
|
||||
|
||||
MemcheckWithGdbTool::MemcheckWithGdbTool(QObject *parent) :
|
||||
@@ -613,10 +619,16 @@ MemcheckWithGdbTool::MemcheckWithGdbTool(QObject *parent) :
|
||||
|
||||
void MemcheckWithGdbTool::startTool(Analyzer::StartMode mode)
|
||||
{
|
||||
if (mode == StartLocal)
|
||||
startLocalTool(DebugMode, MemcheckWithGdbRunMode);
|
||||
if (mode == StartRemote)
|
||||
startRemoteTool(MemcheckWithGdbRunMode);
|
||||
if (mode == StartLocal && checkForLocalStart(DebugMode)) {
|
||||
Project *pro = SessionManager::startupProject();
|
||||
ProjectExplorerPlugin::instance()->runProject(pro, MemcheckWithGdbRunMode);
|
||||
}
|
||||
|
||||
AnalyzerStartParameters sp;
|
||||
if (mode == StartRemote && checkForRemoteStart(&sp)) {
|
||||
AnalyzerRunControl *rc = createRunControl(sp, 0);
|
||||
ProjectExplorerPlugin::startRunControl(rc, MemcheckWithGdbRunMode);
|
||||
}
|
||||
}
|
||||
|
||||
MemcheckRunControl *MemcheckWithGdbTool::createMemcheckRunControl(const AnalyzerStartParameters &sp,
|
||||
|
||||
@@ -103,14 +103,14 @@ private:
|
||||
QWidget *createWidgets();
|
||||
void setBusyCursor(bool busy);
|
||||
|
||||
Analyzer::AnalyzerRunControl *createRunControl(const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
||||
|
||||
void clearErrorView();
|
||||
void updateFromSettings();
|
||||
int updateUiAfterFinishedHelper();
|
||||
|
||||
protected:
|
||||
Analyzer::AnalyzerRunControl *createRunControl(const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
||||
|
||||
virtual MemcheckRunControl *createMemcheckRunControl(
|
||||
const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||
|
||||
Reference in New Issue
Block a user