1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

Fix when QQmlComponent throws error while init plugin

This commit is contained in:
Anmol Gautam 2018-06-22 19:39:41 +05:30
parent 316bc85eb6
commit 6cb052e79b
2 changed files with 6 additions and 1 deletions

View File

@ -474,7 +474,7 @@ void Plugins::initQmlPlugin(Plugin *plugin)
plugin->qmlPluginLoader->createComponent();
if (!plugin->qmlPluginLoader->instance()) {
qWarning() << "Initializing" << name << "failed:" << plugin->qmlPluginLoader->component()->errorString();
qWarning().noquote() << "Falied to create component for" << name << "plugin:" << plugin->qmlPluginLoader->component()->errorString();
return;
}

View File

@ -27,6 +27,11 @@ QmlPluginLoader::QmlPluginLoader(const QString &path)
void QmlPluginLoader::createComponent()
{
m_interface = qobject_cast<QmlPluginInterface*>(m_component->create());
if (!m_interface) {
return;
}
m_interface->setEngine(m_engine);
connect(m_interface, &QmlPluginInterface::qmlPluginUnloaded, this, [this]{
delete m_component;