forked from qt-creator/qt-creator
QmlProfiler: Don't use the model factory if it doesn't exist
The model factory only exists if there is a plugin providing it. Also, it's a good idea to initialize it. Change-Id: I904bae1e733c37699a99e84e79c67ab4e8aea805 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
@@ -105,7 +105,10 @@ ExtensionSystem::IPlugin::ShutdownFlag QmlProfilerPlugin::aboutToShutdown()
|
|||||||
|
|
||||||
QList<QmlProfilerTimelineModel *> QmlProfilerPlugin::getModels(QmlProfilerModelManager *manager) const
|
QList<QmlProfilerTimelineModel *> QmlProfilerPlugin::getModels(QmlProfilerModelManager *manager) const
|
||||||
{
|
{
|
||||||
|
if (factory)
|
||||||
return factory->create(manager);
|
return factory->create(manager);
|
||||||
|
else
|
||||||
|
return QList<QmlProfilerTimelineModel *>();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class QmlProfilerPlugin : public ExtensionSystem::IPlugin
|
|||||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmlProfiler.json")
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QmlProfiler.json")
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QmlProfilerPlugin() {}
|
QmlProfilerPlugin() : factory(0) {}
|
||||||
|
|
||||||
bool initialize(const QStringList &arguments, QString *errorString);
|
bool initialize(const QStringList &arguments, QString *errorString);
|
||||||
void extensionsInitialized();
|
void extensionsInitialized();
|
||||||
|
|||||||
Reference in New Issue
Block a user