forked from qt-creator/qt-creator
qmlprofiler: simplify plugin construction
Change-Id: I26fe148669656637a82a30012e8632b105d4f073 Reviewed-on: http://codereview.qt.nokia.com/1050 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -221,7 +221,6 @@ public:
|
||||
void saveToolSettings(IAnalyzerTool *tool);
|
||||
void loadToolSettings(IAnalyzerTool *tool);
|
||||
|
||||
void registerRunControlFactory(ProjectExplorer::IRunControlFactory *factory);
|
||||
ProjectExplorer::RunControl *createRunControl
|
||||
(ProjectExplorer::RunConfiguration *runConfiguration, const QString &mode);
|
||||
|
||||
@@ -286,7 +285,7 @@ AnalyzerManager::AnalyzerManagerPrivate::AnalyzerManagerPrivate(AnalyzerManager
|
||||
connect(m_toolBox, SIGNAL(currentIndexChanged(int)), SLOT(selectTool(int)));
|
||||
|
||||
m_runControlFactory = new AnalyzerRunControlFactory();
|
||||
registerRunControlFactory(m_runControlFactory);
|
||||
AnalyzerPlugin::instance()->addAutoReleasedObject(m_runControlFactory);
|
||||
|
||||
setupActions();
|
||||
|
||||
@@ -307,12 +306,6 @@ AnalyzerManager::AnalyzerManagerPrivate::~AnalyzerManagerPrivate()
|
||||
}
|
||||
}
|
||||
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::registerRunControlFactory
|
||||
(ProjectExplorer::IRunControlFactory *factory)
|
||||
{
|
||||
AnalyzerPlugin::instance()->addAutoReleasedObject(factory);
|
||||
}
|
||||
|
||||
void AnalyzerManager::AnalyzerManagerPrivate::setupActions()
|
||||
{
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
|
||||
@@ -45,27 +45,14 @@ using namespace QmlProfiler::Internal;
|
||||
|
||||
bool QmlProfilerPlugin::debugOutput = false;
|
||||
|
||||
class QmlProfilerPlugin::QmlProfilerPluginPrivate
|
||||
{
|
||||
public:
|
||||
QmlProjectAnalyzerRunControlFactory *m_runControlFactory;
|
||||
};
|
||||
|
||||
QmlProfilerPlugin::QmlProfilerPlugin()
|
||||
: d(new QmlProfilerPluginPrivate())
|
||||
{}
|
||||
|
||||
QmlProfilerPlugin::~QmlProfilerPlugin()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorString)
|
||||
{
|
||||
Q_UNUSED(arguments)
|
||||
Q_UNUSED(errorString)
|
||||
d->m_runControlFactory = new QmlProjectAnalyzerRunControlFactory();
|
||||
AnalyzerManager::registerRunControlFactory(d->m_runControlFactory);
|
||||
addAutoReleasedObject(new QmlProjectAnalyzerRunControlFactory());
|
||||
AnalyzerManager::addTool(new QmlProfilerTool(true, this));
|
||||
AnalyzerManager::addTool(new QmlProfilerTool(false, this));
|
||||
return true;
|
||||
|
||||
@@ -46,18 +46,13 @@ class QmlProfilerPlugin : public ExtensionSystem::IPlugin
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QmlProfilerPlugin();
|
||||
~QmlProfilerPlugin();
|
||||
QmlProfilerPlugin() {}
|
||||
|
||||
bool initialize(const QStringList &arguments, QString *errorString);
|
||||
void extensionsInitialized();
|
||||
ShutdownFlag aboutToShutdown();
|
||||
|
||||
static bool debugOutput;
|
||||
|
||||
private:
|
||||
class QmlProfilerPluginPrivate;
|
||||
QmlProfilerPluginPrivate *d;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user