forked from qt-creator/qt-creator
AnalyzerTool: Make runMode and toolMode value members
Change-Id: Iaf89bc399db65e17345effb2e9767692786b5ca8 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
@@ -36,6 +36,27 @@ IAnalyzerTool::IAnalyzerTool(QObject *parent)
|
|||||||
: 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)
|
AnalyzerAction::AnalyzerAction(QObject *parent)
|
||||||
: QAction(parent)
|
: QAction(parent)
|
||||||
{}
|
{}
|
||||||
|
@@ -67,8 +67,8 @@ class ANALYZER_EXPORT IAnalyzerTool : public QObject
|
|||||||
public:
|
public:
|
||||||
explicit IAnalyzerTool(QObject *parent = 0);
|
explicit IAnalyzerTool(QObject *parent = 0);
|
||||||
|
|
||||||
/// Returns the run mode for this tool.
|
ProjectExplorer::RunMode runMode() const;
|
||||||
virtual ProjectExplorer::RunMode runMode() const = 0;
|
void setRunMode(ProjectExplorer::RunMode mode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The mode in which this tool should preferably be run
|
* The mode in which this tool should preferably be run
|
||||||
@@ -82,7 +82,8 @@ public:
|
|||||||
ReleaseMode,
|
ReleaseMode,
|
||||||
AnyMode
|
AnyMode
|
||||||
};
|
};
|
||||||
virtual ToolMode toolMode() const = 0;
|
ToolMode toolMode() const;
|
||||||
|
void setToolMode(ToolMode mode);
|
||||||
|
|
||||||
/// Creates all widgets used by the tool.
|
/// Creates all widgets used by the tool.
|
||||||
/// Returns a control widget which will be shown in the status bar when
|
/// Returns a control widget which will be shown in the status bar when
|
||||||
@@ -95,6 +96,10 @@ public:
|
|||||||
ProjectExplorer::RunConfiguration *runConfiguration) = 0;
|
ProjectExplorer::RunConfiguration *runConfiguration) = 0;
|
||||||
|
|
||||||
virtual void startTool(StartMode mode) = 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)
|
: IAnalyzerTool(parent), d(new QmlProfilerToolPrivate)
|
||||||
{
|
{
|
||||||
setObjectName(QLatin1String("QmlProfilerTool"));
|
setObjectName(QLatin1String("QmlProfilerTool"));
|
||||||
|
setRunMode(QmlProfilerRunMode);
|
||||||
|
setToolMode(AnyMode);
|
||||||
|
|
||||||
d->m_profilerState = 0;
|
d->m_profilerState = 0;
|
||||||
d->m_viewContainer = 0;
|
d->m_viewContainer = 0;
|
||||||
@@ -161,16 +163,6 @@ QmlProfilerTool::~QmlProfilerTool()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
RunMode QmlProfilerTool::runMode() const
|
|
||||||
{
|
|
||||||
return QmlProfilerRunMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
IAnalyzerTool::ToolMode QmlProfilerTool::toolMode() const
|
|
||||||
{
|
|
||||||
return AnyMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
AnalyzerRunControl *QmlProfilerTool::createRunControl(const AnalyzerStartParameters &sp,
|
AnalyzerRunControl *QmlProfilerTool::createRunControl(const AnalyzerStartParameters &sp,
|
||||||
RunConfiguration *runConfiguration)
|
RunConfiguration *runConfiguration)
|
||||||
{
|
{
|
||||||
|
@@ -48,9 +48,6 @@ public:
|
|||||||
explicit QmlProfilerTool(QObject *parent);
|
explicit QmlProfilerTool(QObject *parent);
|
||||||
~QmlProfilerTool();
|
~QmlProfilerTool();
|
||||||
|
|
||||||
ProjectExplorer::RunMode runMode() const;
|
|
||||||
ToolMode toolMode() const;
|
|
||||||
|
|
||||||
Analyzer::AnalyzerRunControl *createRunControl(const Analyzer::AnalyzerStartParameters &sp,
|
Analyzer::AnalyzerRunControl *createRunControl(const Analyzer::AnalyzerStartParameters &sp,
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
||||||
|
|
||||||
|
@@ -498,6 +498,8 @@ CallgrindTool::CallgrindTool(QObject *parent)
|
|||||||
{
|
{
|
||||||
d = new CallgrindToolPrivate(this);
|
d = new CallgrindToolPrivate(this);
|
||||||
setObjectName(QLatin1String("CallgrindTool"));
|
setObjectName(QLatin1String("CallgrindTool"));
|
||||||
|
setRunMode(CallgrindRunMode);
|
||||||
|
setToolMode(ReleaseMode);
|
||||||
|
|
||||||
connect(EditorManager::instance(), SIGNAL(editorOpened(Core::IEditor*)),
|
connect(EditorManager::instance(), SIGNAL(editorOpened(Core::IEditor*)),
|
||||||
d, SLOT(editorOpened(Core::IEditor*)));
|
d, SLOT(editorOpened(Core::IEditor*)));
|
||||||
@@ -508,16 +510,6 @@ CallgrindTool::~CallgrindTool()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
RunMode CallgrindTool::runMode() const
|
|
||||||
{
|
|
||||||
return CallgrindRunMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
IAnalyzerTool::ToolMode CallgrindTool::toolMode() const
|
|
||||||
{
|
|
||||||
return ReleaseMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
AnalyzerRunControl *CallgrindTool::createRunControl(const AnalyzerStartParameters &sp,
|
AnalyzerRunControl *CallgrindTool::createRunControl(const AnalyzerStartParameters &sp,
|
||||||
RunConfiguration *runConfiguration)
|
RunConfiguration *runConfiguration)
|
||||||
{
|
{
|
||||||
|
@@ -45,9 +45,6 @@ public:
|
|||||||
CallgrindTool(QObject *parent);
|
CallgrindTool(QObject *parent);
|
||||||
~CallgrindTool();
|
~CallgrindTool();
|
||||||
|
|
||||||
ProjectExplorer::RunMode runMode() const;
|
|
||||||
ToolMode toolMode() const;
|
|
||||||
|
|
||||||
Analyzer::AnalyzerRunControl *createRunControl(const Analyzer::AnalyzerStartParameters &sp,
|
Analyzer::AnalyzerRunControl *createRunControl(const Analyzer::AnalyzerStartParameters &sp,
|
||||||
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
||||||
QWidget *createWidgets();
|
QWidget *createWidgets();
|
||||||
|
@@ -193,7 +193,10 @@ MemcheckTool::MemcheckTool(QObject *parent)
|
|||||||
m_errorProxyModel = 0;
|
m_errorProxyModel = 0;
|
||||||
m_errorView = 0;
|
m_errorView = 0;
|
||||||
m_filterMenu = 0;
|
m_filterMenu = 0;
|
||||||
|
|
||||||
setObjectName(QLatin1String("MemcheckTool"));
|
setObjectName(QLatin1String("MemcheckTool"));
|
||||||
|
setRunMode(MemcheckRunMode);
|
||||||
|
setToolMode(DebugMode);
|
||||||
|
|
||||||
m_filterProjectAction = new QAction(tr("External Errors"), this);
|
m_filterProjectAction = new QAction(tr("External Errors"), this);
|
||||||
m_filterProjectAction->setToolTip(
|
m_filterProjectAction->setToolTip(
|
||||||
@@ -284,16 +287,6 @@ void MemcheckTool::maybeActiveRunConfigurationChanged()
|
|||||||
updateFromSettings();
|
updateFromSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
RunMode MemcheckTool::runMode() const
|
|
||||||
{
|
|
||||||
return MemcheckRunMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
IAnalyzerTool::ToolMode MemcheckTool::toolMode() const
|
|
||||||
{
|
|
||||||
return DebugMode;
|
|
||||||
}
|
|
||||||
|
|
||||||
class FrameFinder : public ErrorListModel::RelevantFrameFinder
|
class FrameFinder : public ErrorListModel::RelevantFrameFinder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@@ -81,8 +81,6 @@ class MemcheckTool : public ValgrindTool
|
|||||||
public:
|
public:
|
||||||
MemcheckTool(QObject *parent);
|
MemcheckTool(QObject *parent);
|
||||||
|
|
||||||
ProjectExplorer::RunMode runMode() const;
|
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void settingsDestroyed(QObject *settings);
|
void settingsDestroyed(QObject *settings);
|
||||||
void maybeActiveRunConfigurationChanged();
|
void maybeActiveRunConfigurationChanged();
|
||||||
@@ -99,7 +97,6 @@ private slots:
|
|||||||
void loadExternalXmlLogFile();
|
void loadExternalXmlLogFile();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ToolMode toolMode() const;
|
|
||||||
QWidget *createWidgets();
|
QWidget *createWidgets();
|
||||||
void setBusyCursor(bool busy);
|
void setBusyCursor(bool busy);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user