Fix loading of JS plugins

pull/395/head
Michael Zanetti 2021-02-20 22:09:56 +01:00
parent 493b211eec
commit 8274550eed
2 changed files with 1 additions and 8 deletions

View File

@ -81,7 +81,7 @@ bool ScriptIntegrationPlugin::loadScript(const QString &fileName)
dbg << spacer << "^";
return false;
}
m_metaData = QJsonObject::fromVariantMap(jsonDoc.toVariant().toMap());
setMetaData(QJsonObject::fromVariantMap(jsonDoc.toVariant().toMap()));
m_engine = new QQmlEngine(this);
m_engine->installExtensions(QJSEngine::AllExtensions);
@ -98,11 +98,6 @@ bool ScriptIntegrationPlugin::loadScript(const QString &fileName)
return true;
}
QJsonObject ScriptIntegrationPlugin::metaData() const
{
return m_metaData;
}
void ScriptIntegrationPlugin::init()
{
//Couldn't find an non-qml way to register abstract classes in the JS engine as qRegisterMetatype doesn't deal so well with abstract classes

View File

@ -171,7 +171,6 @@ public:
explicit ScriptIntegrationPlugin(QObject *parent = nullptr);
bool loadScript(const QString &fileName);
QJsonObject metaData() const;
void init() override;
void startMonitoringAutoThings() override;
@ -185,7 +184,6 @@ public:
private:
QQmlEngine *m_engine = nullptr;
QJsonObject m_metaData;
QJSValue m_pluginImport;
QHash<Thing*, ScriptThing*> m_things;
};