QmlProfiler: Require model manager when constructing timeline models

This relieves us of the headaches created by figuring out what should
happen if the model manager is changed later. Extension models can be
safely created through a factory.

Change-Id: I8cf8fd6d639e4e6c9da66351ea44cfc35fd614a5
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2014-10-28 17:37:11 +01:00
committed by Ulf Hermann
parent 307d45ecaa
commit 91cb52d40b
15 changed files with 136 additions and 72 deletions

View File

@@ -92,7 +92,7 @@ bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorS
void QmlProfilerPlugin::extensionsInitialized()
{
timelineModels = ExtensionSystem::PluginManager::getObjects<AbstractTimelineModel>();
factory = ExtensionSystem::PluginManager::getObject<QmlProfilerTimelineModelFactory>();
}
ExtensionSystem::IPlugin::ShutdownFlag QmlProfilerPlugin::aboutToShutdown()
@@ -103,9 +103,9 @@ ExtensionSystem::IPlugin::ShutdownFlag QmlProfilerPlugin::aboutToShutdown()
return SynchronousShutdown;
}
QList<AbstractTimelineModel *> QmlProfilerPlugin::getModels() const
QList<AbstractTimelineModel *> QmlProfilerPlugin::getModels(QmlProfilerModelManager *manager) const
{
return timelineModels;
return factory->create(manager);
}
} // namespace Internal