Commit daefb0c8 authored by hjk's avatar hjk Committed by hjk
Browse files

qmlprofiler: simplify plugin construction

Change-Id: I26fe148669656637a82a30012e8632b105d4f073
Reviewed-on: http://codereview.qt.nokia.com/1050

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 99d9f065
......@@ -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
......
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