forked from qt-creator/qt-creator
analyzer: remove clutter
Change-Id: I195b92107e90519d456dbd12a28e9ad236e4b298 Reviewed-on: http://codereview.qt.nokia.com/1241 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -47,11 +47,16 @@
|
|||||||
#include <coreplugin/ioutputpane.h>
|
#include <coreplugin/ioutputpane.h>
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
#include <QtCore/QTimer>
|
|
||||||
|
|
||||||
using namespace Analyzer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
// AnalyzerRunControl::Private ///////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// AnalyzerRunControl::Private
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
namespace Analyzer {
|
||||||
|
|
||||||
class AnalyzerRunControl::Private
|
class AnalyzerRunControl::Private
|
||||||
{
|
{
|
||||||
@@ -67,7 +72,12 @@ AnalyzerRunControl::Private::Private()
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// AnalyzerRunControl ////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// AnalyzerRunControl
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
AnalyzerRunControl::AnalyzerRunControl(IAnalyzerTool *tool,
|
AnalyzerRunControl::AnalyzerRunControl(IAnalyzerTool *tool,
|
||||||
const AnalyzerStartParameters &sp, RunConfiguration *runConfiguration)
|
const AnalyzerStartParameters &sp, RunConfiguration *runConfiguration)
|
||||||
: RunControl(runConfiguration, tool->id()),
|
: RunControl(runConfiguration, tool->id()),
|
||||||
@@ -94,6 +104,7 @@ AnalyzerRunControl::~AnalyzerRunControl()
|
|||||||
|
|
||||||
delete d->m_engine;
|
delete d->m_engine;
|
||||||
d->m_engine = 0;
|
d->m_engine = 0;
|
||||||
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalyzerRunControl::start()
|
void AnalyzerRunControl::start()
|
||||||
@@ -105,7 +116,7 @@ void AnalyzerRunControl::start()
|
|||||||
|
|
||||||
// clear about-to-be-outdated tasks
|
// clear about-to-be-outdated tasks
|
||||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||||
ProjectExplorer::TaskHub *hub = pm->getObject<ProjectExplorer::TaskHub>();
|
TaskHub *hub = pm->getObject<TaskHub>();
|
||||||
hub->clearTasks(Constants::ANALYZERTASK_ID);
|
hub->clearTasks(Constants::ANALYZERTASK_ID);
|
||||||
|
|
||||||
d->m_isRunning = true;
|
d->m_isRunning = true;
|
||||||
@@ -113,7 +124,7 @@ void AnalyzerRunControl::start()
|
|||||||
d->m_engine->start();
|
d->m_engine->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::RunControl::StopResult AnalyzerRunControl::stop()
|
RunControl::StopResult AnalyzerRunControl::stop()
|
||||||
{
|
{
|
||||||
if (!d->m_engine || !d->m_isRunning)
|
if (!d->m_engine || !d->m_isRunning)
|
||||||
return StoppedSynchronously;
|
return StoppedSynchronously;
|
||||||
@@ -125,7 +136,7 @@ ProjectExplorer::RunControl::StopResult AnalyzerRunControl::stop()
|
|||||||
|
|
||||||
void AnalyzerRunControl::stopIt()
|
void AnalyzerRunControl::stopIt()
|
||||||
{
|
{
|
||||||
if (stop() == ProjectExplorer::RunControl::StoppedSynchronously)
|
if (stop() == RunControl::StoppedSynchronously)
|
||||||
AnalyzerManager::handleToolFinished();
|
AnalyzerManager::handleToolFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,12 +173,12 @@ void AnalyzerRunControl::receiveOutput(const QString &text, Utils::OutputFormat
|
|||||||
appendMessage(text, format);
|
appendMessage(text, format);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnalyzerRunControl::addTask(ProjectExplorer::Task::TaskType type, const QString &description,
|
void AnalyzerRunControl::addTask(Task::TaskType type, const QString &description,
|
||||||
const QString &file, int line)
|
const QString &file, int line)
|
||||||
{
|
{
|
||||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||||
ProjectExplorer::TaskHub *hub = pm->getObject<ProjectExplorer::TaskHub>();
|
TaskHub *hub = pm->getObject<TaskHub>();
|
||||||
hub->addTask(ProjectExplorer::Task(type, description, file, line, Constants::ANALYZERTASK_ID));
|
hub->addTask(Task(type, description, file, line, Constants::ANALYZERTASK_ID));
|
||||||
|
|
||||||
///FIXME: get a better API for this into Qt Creator
|
///FIXME: get a better API for this into Qt Creator
|
||||||
QList<Core::IOutputPane *> panes = pm->getObjects<Core::IOutputPane>();
|
QList<Core::IOutputPane *> panes = pm->getObjects<Core::IOutputPane>();
|
||||||
@@ -178,3 +189,5 @@ void AnalyzerRunControl::addTask(ProjectExplorer::Task::TaskType type, const QSt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Analyzer
|
||||||
|
|||||||
@@ -52,9 +52,8 @@ class ANALYZER_EXPORT AnalyzerRunControl : public ProjectExplorer::RunControl
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef ProjectExplorer::RunConfiguration RunConfiguration;
|
|
||||||
AnalyzerRunControl(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
|
AnalyzerRunControl(IAnalyzerTool *tool, const AnalyzerStartParameters &sp,
|
||||||
RunConfiguration *runConfiguration);
|
ProjectExplorer::RunConfiguration *runConfiguration);
|
||||||
~AnalyzerRunControl();
|
~AnalyzerRunControl();
|
||||||
|
|
||||||
// ProjectExplorer::RunControl
|
// ProjectExplorer::RunControl
|
||||||
@@ -76,7 +75,7 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
class Private;
|
class Private;
|
||||||
QScopedPointer<Private> d;
|
Private *d;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Analyzer
|
} // namespace Analyzer
|
||||||
|
|||||||
Reference in New Issue
Block a user