mirror of
https://github.com/logos-blockchain/lez-indexer-module.git
synced 2026-07-30 07:03:31 +00:00
fix: input type for Qt Remote Objects
This commit is contained in:
parent
14a1b4affb
commit
4dec2ec44c
@ -13,9 +13,13 @@ public:
|
||||
// === Logos Execution Zone Indexer ===
|
||||
|
||||
// Indexer Lifecycle
|
||||
// `port` is taken as a QString (not uint16_t) because the Qt Remote Objects
|
||||
// ModuleProxy invokes by exact meta-type match and delivers caller arguments
|
||||
// as QString (the module-viewer reads every parameter as text); a uint16_t
|
||||
// parameter would never match. It is parsed to a port number internally.
|
||||
virtual int start_indexer(
|
||||
const QString& config_path,
|
||||
uint16_t port
|
||||
const QString& port
|
||||
) = 0;
|
||||
};
|
||||
|
||||
|
||||
@ -40,12 +40,19 @@ void LezIndexerModule::initLogos(LogosAPI* logosApiInstance) {
|
||||
|
||||
// === Indexer Lifecycle ===
|
||||
|
||||
int LezIndexerModule::start_indexer(const QString& config_path, uint16_t port) {
|
||||
int LezIndexerModule::start_indexer(const QString& config_path, const QString& port) {
|
||||
if (!indexer_service_ffi) {
|
||||
bool ok = false;
|
||||
const uint16_t port_num = port.toUShort(&ok);
|
||||
if (!ok) {
|
||||
qWarning() << "start_indexer: invalid port:" << port;
|
||||
return -1;
|
||||
}
|
||||
|
||||
QByteArray utf8 = config_path.toUtf8();
|
||||
const char* c_path = utf8.constData();
|
||||
|
||||
InitializedIndexerServiceFFIResult indexer_service_ffi_res = ::start_indexer(c_path, port);
|
||||
InitializedIndexerServiceFFIResult indexer_service_ffi_res = ::start_indexer(c_path, port_num);
|
||||
|
||||
if (is_error(&indexer_service_ffi_res.error)) {
|
||||
int signal = indexer_service_ffi_res.error;
|
||||
|
||||
@ -39,7 +39,7 @@ public:
|
||||
// === Logos Execution Zone Indexer ===
|
||||
|
||||
// Indexer Lifecycle
|
||||
Q_INVOKABLE int start_indexer(const QString& config_path, uint16_t port) override;
|
||||
Q_INVOKABLE int start_indexer(const QString& config_path, const QString& port) override;
|
||||
|
||||
signals:
|
||||
void eventResponse(const QString& eventName, const QVariantList& data);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user