forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user