mirror of
https://github.com/logos-co/logos-cpp-sdk.git
synced 2026-09-01 10:11:10 +00:00
abstract provider side
This commit is contained in:
committed by
Logos Workspace
parent
d35653ec8a
commit
33bf0f94d3
@@ -2,6 +2,7 @@
|
||||
#include "logos_api_consumer.h"
|
||||
#include "logos_object.h"
|
||||
#include "token_manager.h"
|
||||
#include <QMetaObject>
|
||||
|
||||
LogosAPIClient::LogosAPIClient(const QString& module_to_talk_to, const QString& origin_module, TokenManager* token_manager, QObject *parent)
|
||||
: QObject(parent)
|
||||
@@ -108,6 +109,26 @@ void LogosAPIClient::onEventResponse(LogosObject* object, const QString& eventNa
|
||||
object->emitEvent(eventName, data);
|
||||
}
|
||||
|
||||
void LogosAPIClient::onEventResponse(QObject* object, const QString& eventName, const QVariantList& data)
|
||||
{
|
||||
qDebug() << "[LogosObject] LogosAPIClient::onEventResponse (QObject* compat)" << eventName;
|
||||
|
||||
if (eventName.isEmpty()) {
|
||||
qWarning() << "LogosAPIClient: Event name cannot be empty";
|
||||
return;
|
||||
}
|
||||
|
||||
if (!object) {
|
||||
qWarning() << "LogosAPIClient: Cannot emit event on null QObject";
|
||||
return;
|
||||
}
|
||||
|
||||
QMetaObject::invokeMethod(object, "eventResponse",
|
||||
Qt::DirectConnection,
|
||||
Q_ARG(QString, eventName),
|
||||
Q_ARG(QVariantList, data));
|
||||
}
|
||||
|
||||
bool LogosAPIClient::informModuleToken(const QString& authToken, const QString& moduleName, const QString& token)
|
||||
{
|
||||
return m_consumer->informModuleToken(authToken, moduleName, token);
|
||||
|
||||
Reference in New Issue
Block a user