diff options
author | Brett Stottlemyer <bstottle@ford.com> | 2019-05-15 04:50:44 -0400 |
---|---|---|
committer | Michael Brasser <michael.brasser@live.com> | 2019-05-18 01:19:12 +0000 |
commit | fa84f22bfd5500550f26f544f6905ac89e60716f (patch) | |
tree | 3b1ab26a41ab4aaf10f60a381b6445a0fdead662 /src/remoteobjects/qremoteobjectsourceio.cpp | |
parent | 91f83125dd403878c989be4098cc3a35eb5ba06f (diff) |
Fix dynamic use_enum logic (Qt types only)
This is the first step in getting use_enum working. Since Qt types are
already declared, we just need to register them get support into QtRO.
Change-Id: I9b1b52f3012fa066acede921db338a755295d8d7
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src/remoteobjects/qremoteobjectsourceio.cpp')
-rw-r--r-- | src/remoteobjects/qremoteobjectsourceio.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/remoteobjects/qremoteobjectsourceio.cpp b/src/remoteobjects/qremoteobjectsourceio.cpp index 35f3bfd..189e5f4 100644 --- a/src/remoteobjects/qremoteobjectsourceio.cpp +++ b/src/remoteobjects/qremoteobjectsourceio.cpp @@ -239,10 +239,8 @@ void QRemoteObjectSourceIo::onServerRead(QObject *conn) qRODebug(this) << "Source (method) Invoke-->" << m_rxName << source->m_object->metaObject()->method(resolvedIndex).methodSignature(); auto method = source->m_object->metaObject()->method(resolvedIndex); const int parameterCount = method.parameterCount(); - for (int i = 0; i < parameterCount; i++) { - if (QMetaType::typeFlags(method.parameterType(i)).testFlag(QMetaType::IsEnumeration)) - m_rxArgs[i].convert(method.parameterType(i)); - } + for (int i = 0; i < parameterCount; i++) + decodeVariant(m_rxArgs[i], method.parameterType(i)); } int typeId = QMetaType::type(source->m_api->typeName(index).constData()); if (!QMetaType(typeId).sizeOf()) @@ -261,15 +259,13 @@ void QRemoteObjectSourceIo::onServerRead(QObject *conn) QRemoteObjectPendingCallWatcher *watcher = new QRemoteObjectPendingCallWatcher(call, connection); QObject::connect(watcher, &QRemoteObjectPendingCallWatcher::finished, connection, [this, serialId, connection, watcher]() { if (watcher->error() == QRemoteObjectPendingCall::NoError) { - serializeInvokeReplyPacket(this->m_packet, this->m_rxName, serialId, watcher->returnValue()); + serializeInvokeReplyPacket(this->m_packet, this->m_rxName, serialId, encodeVariant(watcher->returnValue())); connection->write(m_packet.array, m_packet.size); } watcher->deleteLater(); }); } else { - if (QMetaType::typeFlags(returnValue.userType()).testFlag(QMetaType::IsEnumeration)) - returnValue = QVariant::fromValue<qint32>(returnValue.toInt()); - serializeInvokeReplyPacket(m_packet, m_rxName, serialId, returnValue); + serializeInvokeReplyPacket(m_packet, m_rxName, serialId, encodeVariant(returnValue)); connection->write(m_packet.array, m_packet.size); } } |