mirror of
https://github.com/logos-co/logos-liblogos.git
synced 2026-08-27 12:51:10 +00:00
Merge pull request #57 from logos-co/set_metadata_field
set modulePath property when loading a module
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QJsonObject>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
@@ -112,6 +113,7 @@ namespace PluginManager {
|
||||
|
||||
// Initialize LogosAPI for this plugin
|
||||
LogosAPI* logos_api = new LogosAPI(pluginName, plugin);
|
||||
logos_api->setProperty("modulePath", QFileInfo(pluginPath).absolutePath());
|
||||
qDebug() << "LogosAPI initialized for plugin (Local mode):" << pluginName;
|
||||
|
||||
// Register the plugin for access using LogosAPI Provider
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <QLocalSocket>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
#include <QFileInfo>
|
||||
#include "../common/interface.h"
|
||||
#include "logos_api.h"
|
||||
#include "logos_api_provider.h"
|
||||
@@ -86,10 +87,12 @@ LogosModule loadPlugin(const QString& pluginPath, const QString& expectedName)
|
||||
}
|
||||
|
||||
LogosAPI* initializeLogosAPI(const QString& pluginName, QObject* plugin,
|
||||
PluginInterface* basePlugin, const QString& authToken)
|
||||
PluginInterface* basePlugin, const QString& authToken,
|
||||
const QString& pluginPath)
|
||||
{
|
||||
// Initialize LogosAPI for this plugin
|
||||
LogosAPI* logos_api = new LogosAPI(pluginName, plugin);
|
||||
logos_api->setProperty("modulePath", QFileInfo(pluginPath).absolutePath());
|
||||
|
||||
if (!logos_api) {
|
||||
qCritical() << "Failed to create LogosAPI instance";
|
||||
@@ -134,7 +137,7 @@ LogosAPI* setupPlugin(const QString& pluginName, const QString& pluginPath)
|
||||
// 3. Initialize LogosAPI and register plugin
|
||||
PluginInterface* basePlugin = module.as<PluginInterface>();
|
||||
LogosAPI* logos_api = initializeLogosAPI(pluginName, module.instance(),
|
||||
basePlugin, authToken);
|
||||
basePlugin, authToken, pluginPath);
|
||||
|
||||
// Release module ownership so the plugin stays loaded
|
||||
module.release();
|
||||
|
||||
@@ -13,7 +13,8 @@ QString receiveAuthToken(const QString& pluginName);
|
||||
ModuleLib::LogosModule loadPlugin(const QString& pluginPath, const QString& expectedName);
|
||||
|
||||
LogosAPI* initializeLogosAPI(const QString& pluginName, QObject* plugin,
|
||||
PluginInterface* basePlugin, const QString& authToken);
|
||||
PluginInterface* basePlugin, const QString& authToken,
|
||||
const QString& pluginPath);
|
||||
|
||||
LogosAPI* setupPlugin(const QString& pluginName, const QString& pluginPath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user