mirror of https://github.com/nymea/nymea.git
Fix loading of JS plugins
parent
493b211eec
commit
8274550eed
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue