mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
QmlPlugin: Change entrypoint to always be main.qml
This commit is contained in:
parent
7a562a4847
commit
13449605eb
|
@ -53,8 +53,7 @@ Plugins::Plugin QmlPlugin::loadPlugin(const QString &name)
|
|||
plugin.pluginPath = fullPath;
|
||||
DesktopFile desktopFile(fullPath + QSL("/metadata.desktop"));
|
||||
plugin.pluginSpec = Plugins::createSpec(desktopFile);
|
||||
QString entryPoint = desktopFile.value(QSL("X-Falkon-EntryPoint")).toString();
|
||||
plugin.data = QVariant::fromValue(new QmlPluginLoader(plugin.pluginSpec.name, fullPath, entryPoint));
|
||||
plugin.data = QVariant::fromValue(new QmlPluginLoader(plugin.pluginSpec.name, fullPath));
|
||||
return plugin;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,11 +25,10 @@
|
|||
#include "qml/api/i18n/qmli18n.h"
|
||||
#endif
|
||||
|
||||
QmlPluginLoader::QmlPluginLoader(const QString &name, const QString &path, const QString &entryPoint)
|
||||
QmlPluginLoader::QmlPluginLoader(const QString &name, const QString &path)
|
||||
{
|
||||
m_name = name;
|
||||
m_path = path;
|
||||
m_entryPoint = entryPoint;
|
||||
initEngineAndComponent();
|
||||
}
|
||||
|
||||
|
@ -63,7 +62,7 @@ QmlPluginInterface *QmlPluginLoader::instance() const
|
|||
void QmlPluginLoader::initEngineAndComponent()
|
||||
{
|
||||
m_engine = new QmlEngine();
|
||||
m_component = new QQmlComponent(m_engine, QDir(m_path).filePath(m_entryPoint));
|
||||
m_component = new QQmlComponent(m_engine, QDir(m_path).filePath(QStringLiteral("main.qml")));
|
||||
m_engine->setExtensionPath(m_path);
|
||||
m_engine->setExtensionName(m_name);
|
||||
#if HAVE_LIBINTL
|
||||
|
|
|
@ -29,14 +29,13 @@ class QmlPluginLoader : public QObject
|
|||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QmlPluginLoader(const QString &name, const QString &path, const QString &entryPoint);
|
||||
explicit QmlPluginLoader(const QString &name, const QString &path);
|
||||
void createComponent();
|
||||
QQmlComponent *component() const;
|
||||
QmlPluginInterface *instance() const;
|
||||
private:
|
||||
QString m_path;
|
||||
QString m_name;
|
||||
QString m_entryPoint;
|
||||
QmlEngine *m_engine = nullptr;
|
||||
QQmlComponent *m_component = nullptr;
|
||||
QmlPluginInterface *m_interface = nullptr;
|
||||
|
|
|
@ -49,4 +49,3 @@ X-Falkon-Author=Anmol Gautam
|
|||
X-Falkon-Email=tarptaeya@gmail.com
|
||||
X-Falkon-Version=0.1.0
|
||||
X-Falkon-Settings=true
|
||||
X-Falkon-EntryPoint=helloqml.qml
|
||||
|
|
Loading…
Reference in New Issue
Block a user