| 168 | } |
| 169 | |
| 170 | void Server::messageReceived(const Message &msg) |
| 171 | { |
| 172 | if (msg.address() == endpointAddress()) { |
| 173 | switch (msg.type()) { |
| 174 | case Protocol::ClientDataVersionNegotiated: { |
| 175 | quint8 version; |
| 176 | msg >> version; |
| 177 | |
| 178 | { |
| 179 | Message msg(endpointAddress(), Protocol::ServerDataVersionNegotiated); |
| 180 | msg << version; |
| 181 | send(msg); |
| 182 | } |
| 183 | |
| 184 | Message::setNegotiatedDataVersion(version); |
| 185 | break; |
| 186 | } |
| 187 | case Protocol::ObjectMonitored: |
| 188 | case Protocol::ObjectUnmonitored: { |
| 189 | Protocol::ObjectAddress addr; |
| 190 | msg >> addr; |
| 191 | Q_ASSERT(addr > Protocol::InvalidObjectAddress); |
| 192 | m_propertySyncer->setObjectEnabled(addr, msg.type() == Protocol::ObjectMonitored); |
| 193 | auto it = m_monitorNotifiers.constFind(addr); |
| 194 | if (it == m_monitorNotifiers.constEnd()) |
| 195 | break; |
| 196 | // cout << Q_FUNC_INFO << " un/monitor " << (int)addr << endl; |
| 197 | QMetaObject::invokeMethod(it.value().first, it.value().second, |
| 198 | Q_ARG(bool, msg.type() == Protocol::ObjectMonitored)); |
| 199 | break; |
| 200 | } |
| 201 | } |
| 202 | } else { |
| 203 | dispatchMessage(msg); |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | void Server::invokeObject(const QString &objectName, const char *method, |
| 208 | const QVariantList &args) const |
nothing calls this directly
no test coverage detected