mirror of
https://github.com/overte-org/overte.git
synced 2025-07-24 01:23:55 +02:00
fix for registration of methods with typedef
This commit is contained in:
parent
b1650c0d8c
commit
15ca129005
2 changed files with 9 additions and 5 deletions
|
@ -282,7 +282,7 @@ void DomainServer::setupNodeListAndAssignments(const QUuid& sessionUUID) {
|
||||||
// register as the packet receiver for the types we want
|
// register as the packet receiver for the types we want
|
||||||
PacketReceiver& packetReceiver = nodeList->getPacketReceiver();
|
PacketReceiver& packetReceiver = nodeList->getPacketReceiver();
|
||||||
packetReceiver.registerListener(PacketType::RequestAssignment, this, "processRequestAssignmentPacket");
|
packetReceiver.registerListener(PacketType::RequestAssignment, this, "processRequestAssignmentPacket");
|
||||||
packetReceiver.registerListener(PacketType::DomainConnectRequest, this, "processConnectRequestPackets");
|
packetReceiver.registerListener(PacketType::DomainConnectRequest, this, "processConnectRequestPacket");
|
||||||
packetReceiver.registerListener(PacketType::DomainListRequest, this, "processListRequestPacket");
|
packetReceiver.registerListener(PacketType::DomainListRequest, this, "processListRequestPacket");
|
||||||
packetReceiver.registerListener(PacketType::DomainServerPathQuery, this, "processPathQueryPacket");
|
packetReceiver.registerListener(PacketType::DomainServerPathQuery, this, "processPathQueryPacket");
|
||||||
packetReceiver.registerListener(PacketType::NodeJsonStats, this, "processNodeJSONStatsPacket");
|
packetReceiver.registerListener(PacketType::NodeJsonStats, this, "processNodeJSONStatsPacket");
|
||||||
|
|
|
@ -75,11 +75,13 @@ QMetaMethod PacketReceiver::matchingMethodForListener(PacketType::Value type, QO
|
||||||
QSet<QString> possibleSignatures { QString("%1(%2)").arg(slot).arg(NON_SOURCED_PACKET_LISTENER_PARAMETERS) };
|
QSet<QString> possibleSignatures { QString("%1(%2)").arg(slot).arg(NON_SOURCED_PACKET_LISTENER_PARAMETERS) };
|
||||||
|
|
||||||
if (!NON_SOURCED_PACKETS.contains(type)) {
|
if (!NON_SOURCED_PACKETS.contains(type)) {
|
||||||
const QString SOURCED_PACKET_LISTENER_PARAMETERS = "QSharedPointer<NLPacket>,QSharedPointer<Node>";
|
static const QString SOURCED_PACKET_LISTENER_PARAMETERS = "QSharedPointer<NLPacket>,QSharedPointer<Node>";
|
||||||
|
static const QString TYPEDEF_SOURCED_PACKET_LISTENER_PARAMETERS = "QSharedPointer<NLPacket>,SharedNodePointer";
|
||||||
|
|
||||||
// a sourced packet must take the shared pointer to the packet but optionally could include
|
// a sourced packet must take the shared pointer to the packet but optionally could include
|
||||||
// a shared pointer to the node
|
// a shared pointer to the node
|
||||||
|
|
||||||
|
possibleSignatures << QString("%1(%2)").arg(slot).arg(TYPEDEF_SOURCED_PACKET_LISTENER_PARAMETERS);
|
||||||
possibleSignatures << QString("%1(%2)").arg(slot).arg(SOURCED_PACKET_LISTENER_PARAMETERS);
|
possibleSignatures << QString("%1(%2)").arg(slot).arg(SOURCED_PACKET_LISTENER_PARAMETERS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,15 +94,17 @@ QMetaMethod PacketReceiver::matchingMethodForListener(PacketType::Value type, QO
|
||||||
// does the constructed normalized method exist?
|
// does the constructed normalized method exist?
|
||||||
methodIndex = object->metaObject()->indexOfSlot(normalizedSlot.toStdString().c_str());
|
methodIndex = object->metaObject()->indexOfSlot(normalizedSlot.toStdString().c_str());
|
||||||
|
|
||||||
|
if (methodIndex >= 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (methodIndex < 0) {
|
if (methodIndex < 0) {
|
||||||
qDebug() << "PacketReceiver::registerListener expected a method with one of the following signatures:"
|
qDebug() << "PacketReceiver::registerListener expected a method with one of the following signatures:"
|
||||||
<< possibleSignatures.toList() << "- but such a method was not found.";
|
<< possibleSignatures.toList() << "- but such a method was not found.";
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_ASSERT(methodIndex >= 0);
|
assert(methodIndex >= 0);
|
||||||
|
|
||||||
// return the converted QMetaMethod
|
// return the converted QMetaMethod
|
||||||
if (methodIndex >= 0) {
|
if (methodIndex >= 0) {
|
||||||
|
|
Loading…
Reference in a new issue