Analyzer: Move runMode member from IAnalyzerTool to AnalyzerAction

Slim down tool before dissolving.

Change-Id: I502aaa8860293acf8bfd93f541b751d5b96a9563
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2015-02-18 11:05:22 +01:00
parent f160d2b8f5
commit 35d3088252
9 changed files with 40 additions and 28 deletions

View File

@@ -502,7 +502,6 @@ CallgrindTool::CallgrindTool(QObject *parent)
{
d = new CallgrindToolPrivate(this);
setObjectName(QLatin1String("CallgrindTool"));
setRunMode(CallgrindRunMode);
setToolMode(ReleaseMode);
connect(EditorManager::instance(), &EditorManager::editorOpened,
@@ -561,9 +560,9 @@ AnalyzerRunControl *CallgrindToolPrivate::createRunControl(const AnalyzerStartPa
void CallgrindTool::startTool(StartMode mode)
{
if (mode == StartLocal)
startLocalTool();
startLocalTool(CallgrindRunMode);
if (mode == StartRemote)
startRemoteTool();
startRemoteTool(CallgrindRunMode);
d->setBusyCursor(true);
}

View File

@@ -196,7 +196,6 @@ MemcheckTool::MemcheckTool(QObject *parent)
m_filterMenu = 0;
setObjectName(QLatin1String("MemcheckTool"));
setRunMode(MemcheckRunMode);
setToolMode(DebugMode);
m_filterProjectAction = new QAction(tr("External Errors"), this);
@@ -602,18 +601,27 @@ void MemcheckTool::setBusyCursor(bool busy)
void MemcheckTool::startTool(StartMode mode)
{
if (mode == StartLocal)
startLocalTool();
startLocalTool(MemcheckRunMode);
if (mode == StartRemote)
startRemoteTool();
startRemoteTool(MemcheckRunMode);
}
MemcheckWithGdbTool::MemcheckWithGdbTool(QObject *parent) :
MemcheckTool(parent)
{
setRunMode(MemcheckWithGdbRunMode);
setObjectName(QLatin1String("MemcheckWithGdbTool"));
}
void MemcheckWithGdbTool::startTool(Analyzer::StartMode mode)
{
if (mode == StartLocal)
startLocalTool(MemcheckWithGdbRunMode);
if (mode == StartRemote)
startRemoteTool(MemcheckWithGdbRunMode);
}
MemcheckRunControl *MemcheckWithGdbTool::createMemcheckRunControl(const AnalyzerStartParameters &sp,
RunConfiguration *runConfiguration)
{

View File

@@ -139,6 +139,7 @@ public:
MemcheckWithGdbTool(QObject *parent);
protected:
void startTool(Analyzer::StartMode mode);
MemcheckRunControl *createMemcheckRunControl(
const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration) Q_DECL_OVERRIDE;

View File

@@ -128,6 +128,7 @@ bool ValgrindPlugin::initialize(const QStringList &, QString *)
action = new AnalyzerAction(this);
action->setId("Memcheck.Local");
action->setTool(m_memcheckTool);
action->setRunMode(ProjectExplorer::MemcheckRunMode);
action->setText(tr("Valgrind Memory Analyzer"));
action->setToolTip(memcheckToolTip);
action->setMenuGroup(Constants::G_ANALYZER_TOOLS);
@@ -138,6 +139,7 @@ bool ValgrindPlugin::initialize(const QStringList &, QString *)
action = new AnalyzerAction(this);
action->setId("MemcheckWithGdb.Local");
action->setTool(m_memcheckWithGdbTool);
action->setRunMode(ProjectExplorer::MemcheckWithGdbRunMode);
action->setText(tr("Valgrind Memory Analyzer with GDB"));
action->setToolTip(memcheckWithGdbToolTip);
action->setMenuGroup(Constants::G_ANALYZER_TOOLS);
@@ -148,6 +150,7 @@ bool ValgrindPlugin::initialize(const QStringList &, QString *)
action = new AnalyzerAction(this);
action->setId("Callgrind.Local");
action->setTool(m_callgrindTool);
action->setRunMode(ProjectExplorer::CallgrindRunMode);
action->setText(tr("Valgrind Function Profiler"));
action->setToolTip(callgrindToolTip);
action->setMenuGroup(Constants::G_ANALYZER_TOOLS);
@@ -159,6 +162,7 @@ bool ValgrindPlugin::initialize(const QStringList &, QString *)
action = new AnalyzerAction(this);
action->setId("Memcheck.Remote");
action->setTool(m_memcheckTool);
action->setRunMode(ProjectExplorer::MemcheckRunMode);
action->setText(tr("Valgrind Memory Analyzer (External Remote Application)"));
action->setToolTip(memcheckToolTip);
action->setMenuGroup(Constants::G_ANALYZER_REMOTE_TOOLS);
@@ -168,6 +172,7 @@ bool ValgrindPlugin::initialize(const QStringList &, QString *)
action = new AnalyzerAction(this);
action->setId("Callgrind.Remote");
action->setTool(m_callgrindTool);
action->setRunMode(ProjectExplorer::CallgrindRunMode);
action->setText(tr("Valgrind Function Profiler (External Remote Application)"));
action->setToolTip(callgrindToolTip);
action->setMenuGroup(Constants::G_ANALYZER_REMOTE_TOOLS);