summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbuspendingcall.cpp
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2022-11-16 16:05:01 +0100
committerAleix Pol <aleixpol@kde.org>2022-11-26 01:45:43 +0100
commit479072791b0a91dae375bd136a5062e4e85d9e7a (patch)
tree4c873d0260bfc4d37cbcfbf3e2dd3359d885e88b /src/dbus/qdbuspendingcall.cpp
parent4332cb313469de1525afe3cddd792d7bc7e08a14 (diff)
dbus: Include some debug messages when failing to connect
When using dbus, there's a number of cases where resolution happens at runtime. It's useful to see dbus complain when connects don't work, because otherwise the system doesn't work but we don't know what is happening. Added this to debug such an issue, already helped me address other cases that had gone unnoticed elsewhere, so this is something that benefits from being in QtDBus. Change-Id: I5eefb94fcf775182edf1ad0c24e8a6692f84b15f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/dbus/qdbuspendingcall.cpp')
-rw-r--r--src/dbus/qdbuspendingcall.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp
index 7674dd10f2..ff5dfc8967 100644
--- a/src/dbus/qdbuspendingcall.cpp
+++ b/src/dbus/qdbuspendingcall.cpp
@@ -123,16 +123,18 @@ bool QDBusPendingCallPrivate::setReplyCallback(QObject *target, const char *memb
return false;
}
- methodIdx = QDBusConnectionPrivate::findSlot(target, member + 1, metaTypes);
+ QString errorMsg;
+ methodIdx = QDBusConnectionPrivate::findSlot(target, member + 1, metaTypes, errorMsg);
if (methodIdx == -1) {
QByteArray normalizedName = QMetaObject::normalizedSignature(member + 1);
- methodIdx = QDBusConnectionPrivate::findSlot(target, normalizedName, metaTypes);
+ methodIdx = QDBusConnectionPrivate::findSlot(target, normalizedName, metaTypes, errorMsg);
}
if (methodIdx == -1) {
// would not be able to deliver a reply
- qWarning("QDBusPendingCall::setReplyCallback: error: cannot deliver a reply to %s::%s (%s)",
- target->metaObject()->className(),
- member + 1, qPrintable(target->objectName()));
+ qWarning("QDBusPendingCall::setReplyCallback: error: cannot deliver a reply to %s::%s (%s) "
+ "because %s",
+ target->metaObject()->className(), member + 1, qPrintable(target->objectName()),
+ qPrintable(errorMsg));
return false;
}