Commit 91846f41 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Use Monitor's objectName() if available to identify subscriber

Makes debugging easier. Fallbacks to this pointer-as-int.
parent c82fc387
......@@ -629,13 +629,20 @@ int MonitorPrivate::translateAndCompress(QQueue<Protocol::ChangeNotification> &n
void MonitorPrivate::commandReceived(qint64 tag, const Protocol::Command &command)
{
Q_Q(Monitor);
Q_UNUSED(tag);
if (command.isResponse()) {
switch (command.type()) {
case Protocol::Command::Hello: {
Protocol::HelloResponse hello(command);
qCDebug(AKONADICORE_LOG) << q_ptr << "Connected to notification bus";
Protocol::CreateSubscriptionCommand subCmd(session->sessionId() + QByteArray::number(quintptr(this)));
QByteArray subname = session->sessionId() + " - ";
if (!q->objectName().isEmpty()) {
subname += q->objectName().toLatin1();
} else {
subname += QByteArray::number(quintptr(q));
}
Protocol::CreateSubscriptionCommand subCmd(subname);
ntfConnection->sendCommand(2, subCmd);
break;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment