Commit 18dca1e3 authored by hjk's avatar hjk

AnalyzerTool: Make runMode and toolMode value members

Change-Id: Iaf89bc399db65e17345effb2e9767692786b5ca8
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 17ce7d4a
......@@ -36,6 +36,27 @@ IAnalyzerTool::IAnalyzerTool(QObject *parent)
: QObject(parent)
{}
/// Returns the run mode for this tool.
ProjectExplorer::RunMode IAnalyzerTool::runMode() const
{
return m_runMode;
}
void IAnalyzerTool::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)
{}
......
......@@ -67,8 +67,8 @@ class ANALYZER_EXPORT IAnalyzerTool : public QObject
public:
explicit IAnalyzerTool(QObject *parent = 0);
/// Returns the run mode for this tool.
virtual ProjectExplorer::RunMode runMode() const = 0;
ProjectExplorer::RunMode runMode() const;
void setRunMode(ProjectExplorer::RunMode mode);
/**
* The mode in which this tool should preferably be run
......@@ -82,7 +82,8 @@ public:
ReleaseMode,
AnyMode
};
virtual ToolMode toolMode() const = 0;
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,6 +96,10 @@ public:
ProjectExplorer::RunConfiguration *runConfiguration) = 0;
virtual void startTool(StartMode mode) = 0;
private:
ProjectExplorer::RunMode m_runMode;
ToolMode m_toolMode;
};
/**
......
......@@ -112,6 +112,8 @@ QmlProfilerTool::QmlProfilerTool(QObject *parent)
: IAnalyzerTool(parent), d(new QmlProfilerToolPrivate)
{
setObjectName(QLatin1String("QmlProfilerTool"));
setRunMode(QmlProfilerRunMode);
setToolMode(AnyMode);
d->m_profilerState = 0;
d->m_viewContainer = 0;
......@@ -161,16 +163,6 @@ QmlProfilerTool::~QmlProfilerTool()
delete d;
}
RunMode QmlProfilerTool::runMode() const
{
return QmlProfilerRunMode;
}
IAnalyzerTool::ToolMode QmlProfilerTool::toolMode() const
{
return AnyMode;
}
AnalyzerRunControl *QmlProfilerTool::createRunControl(const AnalyzerStartParameters &sp,
RunConfiguration *runConfiguration)
{
......
......@@ -48,9 +48,6 @@ public:
explicit QmlProfilerTool(QObject *parent);
~QmlProfilerTool();
ProjectExplorer::RunMode runMode() const;
ToolMode toolMode() const;
Analyzer::AnalyzerRunControl *createRunControl(const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration = 0);
......
......@@ -498,6 +498,8 @@ CallgrindTool::CallgrindTool(QObject *parent)
{
d = new CallgrindToolPrivate(this);
setObjectName(QLatin1String("CallgrindTool"));
setRunMode(CallgrindRunMode);
setToolMode(ReleaseMode);
connect(EditorManager::instance(), SIGNAL(editorOpened(Core::IEditor*)),
d, SLOT(editorOpened(Core::IEditor*)));
......@@ -508,16 +510,6 @@ CallgrindTool::~CallgrindTool()
delete d;
}
RunMode CallgrindTool::runMode() const
{
return CallgrindRunMode;
}
IAnalyzerTool::ToolMode CallgrindTool::toolMode() const
{
return ReleaseMode;
}
AnalyzerRunControl *CallgrindTool::createRunControl(const AnalyzerStartParameters &sp,
RunConfiguration *runConfiguration)
{
......
......@@ -45,9 +45,6 @@ public:
CallgrindTool(QObject *parent);
~CallgrindTool();
ProjectExplorer::RunMode runMode() const;
ToolMode toolMode() const;
Analyzer::AnalyzerRunControl *createRunControl(const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration = 0);
QWidget *createWidgets();
......
......@@ -193,7 +193,10 @@ MemcheckTool::MemcheckTool(QObject *parent)
m_errorProxyModel = 0;
m_errorView = 0;
m_filterMenu = 0;
setObjectName(QLatin1String("MemcheckTool"));
setRunMode(MemcheckRunMode);
setToolMode(DebugMode);
m_filterProjectAction = new QAction(tr("External Errors"), this);
m_filterProjectAction->setToolTip(
......@@ -284,16 +287,6 @@ void MemcheckTool::maybeActiveRunConfigurationChanged()
updateFromSettings();
}
RunMode MemcheckTool::runMode() const
{
return MemcheckRunMode;
}
IAnalyzerTool::ToolMode MemcheckTool::toolMode() const
{
return DebugMode;
}
class FrameFinder : public ErrorListModel::RelevantFrameFinder
{
public:
......
......@@ -81,8 +81,6 @@ class MemcheckTool : public ValgrindTool
public:
MemcheckTool(QObject *parent);
ProjectExplorer::RunMode runMode() const;
private slots:
void settingsDestroyed(QObject *settings);
void maybeActiveRunConfigurationChanged();
......@@ -99,7 +97,6 @@ private slots:
void loadExternalXmlLogFile();
private:
ToolMode toolMode() const;
QWidget *createWidgets();
void setBusyCursor(bool busy);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment