fix: input type for Qt Remote Objects

This commit is contained in:
erhant 2026-06-16 15:52:56 +03:00
parent 14a1b4affb
commit 4dec2ec44c
3 changed files with 15 additions and 4 deletions

View File

@ -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;
};

View File

@ -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;

View File

@ -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);