Skip to content
Snippets Groups Projects
Commit 64be0004 authored by hjk's avatar hjk
Browse files

Analyzer: Remove IAnalyzerTool::m_toolMode member


It's always known from the context when needed.

Change-Id: Ibf314dfb779190e89b775acab784ed71acff2c83
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent e058dbe7
No related branches found
No related tags found
No related merge requests found
......@@ -72,16 +72,6 @@ void AnalyzerAction::setRunMode(ProjectExplorer::RunMode mode)
m_runMode = mode;
}
IAnalyzerTool::ToolMode IAnalyzerTool::toolMode() const
{
return m_toolMode;
}
void IAnalyzerTool::setToolMode(IAnalyzerTool::ToolMode mode)
{
m_toolMode = mode;
}
AnalyzerAction::AnalyzerAction(QObject *parent)
: QAction(parent)
{}
......@@ -102,7 +92,7 @@ static bool buildTypeAccepted(IAnalyzerTool::ToolMode toolMode,
return false;
}
void IAnalyzerTool::startLocalTool(RunMode runMode)
void IAnalyzerTool::startLocalTool(ToolMode toolMode, RunMode runMode)
{
// Make sure mode is shown.
AnalyzerManager::showMode();
......@@ -120,13 +110,13 @@ void IAnalyzerTool::startLocalTool(RunMode runMode)
// Check the project for whether the build config is in the correct mode
// if not, notify the user and urge him to use the correct mode.
if (!buildTypeAccepted(toolMode(), buildType)) {
if (!buildTypeAccepted(toolMode, buildType)) {
const QString currentMode = buildType == BuildConfiguration::Debug
? AnalyzerManager::tr("Debug")
: AnalyzerManager::tr("Release");
QString toolModeString;
switch (toolMode()) {
switch (toolMode) {
case IAnalyzerTool::DebugMode:
toolModeString = AnalyzerManager::tr("Debug");
break;
......
......@@ -80,8 +80,6 @@ public:
ReleaseMode,
AnyMode
};
ToolMode toolMode() const;
void setToolMode(ToolMode mode);
/// Creates all widgets used by the tool.
/// Returns a control widget which will be shown in the status bar when
......@@ -95,11 +93,8 @@ public:
virtual void startTool(StartMode mode) = 0;
void startLocalTool(ProjectExplorer::RunMode runMode);
void startLocalTool(ToolMode toolMode, ProjectExplorer::RunMode runMode);
void startRemoteTool(ProjectExplorer::RunMode runMode);
private:
ToolMode m_toolMode;
};
/**
......
......@@ -124,7 +124,6 @@ QmlProfilerTool::QmlProfilerTool(QObject *parent)
: IAnalyzerTool(parent), d(new QmlProfilerToolPrivate)
{
setObjectName(QLatin1String("QmlProfilerTool"));
setToolMode(AnyMode);
d->m_profilerState = 0;
d->m_viewContainer = 0;
......
......@@ -502,7 +502,6 @@ CallgrindTool::CallgrindTool(QObject *parent)
{
d = new CallgrindToolPrivate(this);
setObjectName(QLatin1String("CallgrindTool"));
setToolMode(ReleaseMode);
connect(EditorManager::instance(), &EditorManager::editorOpened,
d, &CallgrindToolPrivate::editorOpened);
......@@ -560,7 +559,7 @@ AnalyzerRunControl *CallgrindToolPrivate::createRunControl(const AnalyzerStartPa
void CallgrindTool::startTool(StartMode mode)
{
if (mode == StartLocal)
startLocalTool(CallgrindRunMode);
startLocalTool(ReleaseMode, CallgrindRunMode);
if (mode == StartRemote)
startRemoteTool(CallgrindRunMode);
d->setBusyCursor(true);
......
......@@ -196,7 +196,6 @@ MemcheckTool::MemcheckTool(QObject *parent)
m_filterMenu = 0;
setObjectName(QLatin1String("MemcheckTool"));
setToolMode(DebugMode);
m_filterProjectAction = new QAction(tr("External Errors"), this);
m_filterProjectAction->setToolTip(
......@@ -601,7 +600,7 @@ void MemcheckTool::setBusyCursor(bool busy)
void MemcheckTool::startTool(StartMode mode)
{
if (mode == StartLocal)
startLocalTool(MemcheckRunMode);
startLocalTool(DebugMode, MemcheckRunMode);
if (mode == StartRemote)
startRemoteTool(MemcheckRunMode);
}
......@@ -612,16 +611,14 @@ MemcheckWithGdbTool::MemcheckWithGdbTool(QObject *parent) :
setObjectName(QLatin1String("MemcheckWithGdbTool"));
}
void MemcheckWithGdbTool::startTool(Analyzer::StartMode mode)
{
if (mode == StartLocal)
startLocalTool(MemcheckWithGdbRunMode);
startLocalTool(DebugMode, MemcheckWithGdbRunMode);
if (mode == StartRemote)
startRemoteTool(MemcheckWithGdbRunMode);
}
MemcheckRunControl *MemcheckWithGdbTool::createMemcheckRunControl(const AnalyzerStartParameters &sp,
RunConfiguration *runConfiguration)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment