16#include <private/qlocking_p.h>
17#include <QtCore/qset.h>
56#define qDBusDebug if (::isDebugging.loadRelaxed() == 0); else qDebug
61 dbg.nospace() <<
"QThread(ptr=" << (
const void*)th;
62 if (th && !th->objectName().isEmpty())
63 dbg.nospace() <<
", name=" << th->objectName();
65 dbg.nospace() <<
", name=" << th->metaObject()->className();
74 dbg.nospace() <<
"QDBusConnection("
75 <<
"ptr=" << (
const void*)conn
76 <<
", name=" << conn->
name
85 <<
"Qt D-Bus threading action" << action
99 <<
"in connection" << conn;
101qdbusThreadDebugFunc qdbusThreadDebug =
nullptr;
109 const auto locker = qt_scoped_lock(lock);
117 QList<QDBusSpyCallEvent::Hook> hookListCopy;
119 const auto locker = qt_scoped_lock(lock);
123 for (
auto hook : std::as_const(hookListCopy))
129 QList<QDBusSpyCallEvent::Hook> list;
154 using namespace std::chrono_literals;
155 int timerId =
d->startTimer(q_dbus_timeout_get_interval(
timeout) * 1ms);
174 while (
it !=
d->timeouts.
end()) {
176 d->killTimer(
it.key());
205 int fd = q_dbus_watch_get_unix_fd(
watch);
213 watcher.read->setEnabled(q_dbus_watch_get_enabled(
watch));
220 watcher.write->setEnabled(q_dbus_watch_get_enabled(
watch));
237 int fd = q_dbus_watch_get_unix_fd(
watch);
240 while (
i !=
d->watchers.end() &&
i.key() ==
fd) {
241 if (
i.value().watch ==
watch) {
242 delete i.value().read;
243 delete i.value().write;
244 i =
d->watchers.erase(
i);
258 int fd = q_dbus_watch_get_unix_fd(
watch);
261 while (
i !=
d->watchers.end() &&
i.key() ==
fd) {
262 if (
i.value().watch ==
watch) {
269 i.value().read->setEnabled(
enabled);
271 i.value().write->setEnabled(
enabled);
283 emit d->dispatchStatusChanged();
302 if (serverConnection->anonymousAuthenticationAllowed)
303 q_dbus_connection_set_allow_anonymous(
connection,
true);
312 serverConnection->serverConnectionNames << newConnection->
name;
321 if (!serverConnection->serverObject)
343 result +=
"type='signal',"_L1;
344 const auto keyValue =
"%1='%2',"_L1;
346 if (!service.isEmpty())
347 result += keyValue.arg(
"sender"_L1, service);
349 result += keyValue.arg(
"path"_L1, objectPath);
353 result += keyValue.arg(
"member"_L1, member);
356 if (!argMatch.args.isEmpty()) {
357 const QString keyValue =
"arg%1='%2',"_L1;
358 for (
int i = 0;
i < argMatch.args.size(); ++
i)
359 if (!argMatch.args.at(
i).isNull())
362 if (!argMatch.arg0namespace.isEmpty()) {
363 result +=
"arg0namespace='%1',"_L1.
arg(argMatch.arg0namespace);
371 const QString &fullpath,
int &usedLength,
374 if (!fullpath.compare(
"/"_L1) && root->
obj) {
380 int length = fullpath.size();
381 if (fullpath.at(0) == u
'/')
391 int end = fullpath.indexOf(u
'/',
start);
422 int length = fullpath.size();
434 int pos = fullpath.indexOf(u
'/',
start);
441 if (
child->objectName() == pathComponent) {
462 if (service.endsWith(u
'*')) {
467 matchArgs.args << service;
488 auto *
hooks = qDBusSpyHookList();
512 if (!qDBusSpyHookList.exists())
515 qDBusSpyHookList->invoke(
msg);
529 qDBusDebug() <<
d <<
"got message (signal):" << amsg;
531 return d->handleMessage(amsg) ?
539 if (!
ref.loadRelaxed())
548 qDBusDebug() <<
this <<
"delivery is suspended";
553 switch (amsg.type()) {
566 qDBusDebug() <<
this <<
"invoking message spies directly";
569 qDBusDebug() <<
this <<
"invoking message spies via event";
578 handleObjectCall(amsg);
595 haystack.children.removeIf(isInactive);
597 if (needle == haystack.obj) {
598 haystack.obj =
nullptr;
607 if (pathComponents.size() ==
i) {
622 if (
it ==
end ||
it->name != pathComponents.at(
i))
636 if (node.isActive()) {
638 path + u
'/' + node.name);
642 if (needle == haystack.obj) {
646 else if (!isAdaptor) {
647 int mask = isScriptable
650 if ((haystack.flags &
mask) == 0)
658 DBusMessage *msg2 = q_dbus_message_copy(msg);
659 q_dbus_message_set_path(msg2,
p);
660 q_dbus_connection_send(
connection, msg2,
nullptr);
661 q_dbus_message_unref(msg2);
666 const QString &signature_, QList<QMetaType> &metaTypes)
668 QByteArray msgSignature = signature_.toLatin1();
671 for (
int idx =
mo->methodCount() - 1 ; idx >= QObject::staticMetaObject.methodCount(); --idx) {
691 if (isAsync && returnType.
id() != QMetaType::Void)
696 if (inputCount == -1) {
697 parametersErrorMsg = errorMsg;
701 metaTypes[0] = returnType;
702 bool hasMessage =
false;
703 if (inputCount > 0 &&
713 for (
i = 1;
i <= inputCount; ++
i) {
718 reconstructedSignature += typeSignature;
719 if (!msgSignature.startsWith(reconstructedSignature))
723 if (reconstructedSignature != msgSignature)
734 for (
int j =
i;
ok &&
j < metaTypes.size(); ++
j)
741 if (isAsync && metaTypes.size() >
i + 1)
761 if (!parametersErrorMsg.isEmpty()) {
762 qCWarning(dbusIntegration,
"QDBusConnection: couldn't handle call to %s: %ls",
765 qCWarning(dbusIntegration,
"QDBusConnection: couldn't handle call to %s, no slot matched",
789 const QList<QMetaType> &metaTypes,
794 int n = metaTypes.size() - 1;
802 for (
int i = 0;
i <
n; ++
i)
828 deliverCall(
this, msg, hook.params, hook.midx);
835bool QDBusConnectionPrivate::activateCall(
QObject *
object, QDBusConnection::RegisterOptions
flags,
858 static const char cachePropertyName[] =
"_qdbus_slotCache";
864 "QDBusConnection: internal threading error",
865 "function called for an object that is in another thread!!");
868 qvariant_cast<QDBusSlotCache>(
object->property(cachePropertyName));
878 if (cacheIt == slotCache.hash.constEnd()) {
886 if (slotData.slotIdx == -1) {
890 if (slotData.metaTypes.size() != 2 ||
894 slotData.slotIdx = -1;
895 slotData.metaTypes.clear();
896 slotCache.hash.insert(compoundKey, slotData);
899 qCWarning(dbusIntegration).nospace() <<
"Could not find slot " <<
mo->className()
900 <<
"::" << memberName.constData();
906 slotCache.hash.insert(compoundKey, slotData);
910 deliverCall(
object, msg, slotData.metaTypes, slotData.slotIdx);
912 }
else if (cacheIt->slotIdx == -1) {
917 deliverCall(
object, msg, cacheIt->metaTypes, cacheIt->slotIdx);
924 const QList<QMetaType> &metaTypes,
int slotIdx)
927 "QDBusConnection: internal threading error",
928 "function called for an object that is in another thread!!");
930 QVarLengthArray<void *, 10>
params;
931 params.reserve(metaTypes.size());
933 QVarLengthArray<QVariant, 10> auxParameters;
934 auxParameters.reserve(metaTypes.size());
944 for (
i = 1;
i <= pCount; ++
i) {
945 auto id = metaTypes[
i];
951 if (
arg.metaType() ==
id)
953 params.append(
const_cast<void *
>(
arg.constData()));
954 else if (
arg.metaType() == QMetaType::fromType<QDBusArgument>()) {
960 QVariant &
out = auxParameters[auxParameters.size() - 1];
963 qFatal(
"Internal error: demarshalling function for type '%s' (%d) failed!",
964 out.typeName(),
out.metaType().id());
966 params.append(
const_cast<void *
>(
out.constData()));
968 qFatal(
"Internal error: got invalid meta type %d (%s) "
969 "when trying to convert to meta type %d (%s)",
970 arg.metaType().id(),
arg.metaType().name(),
976 params.append(
const_cast<void*
>(
static_cast<const void*
>(&msg)));
981 const int numMetaTypes = metaTypes.size();
983 if (metaTypes[0].
id() != QMetaType::Void && metaTypes[0].isValid()) {
984 outputArgs.
reserve(numMetaTypes -
i + 1);
989 outputArgs.
reserve(numMetaTypes -
i);
992 for ( ;
i < numMetaTypes; ++
i) {
1009 slotIdx,
params.data()) >= 0;
1020 qDBusDebug() <<
this <<
"Automatically sending reply:" << outputArgs;
1024 qCWarning(dbusIntegration,
"Internal error: Failed to deliver message");
1038 anonymousAuthenticationAllowed(
false),
1039 dispatchEnabled(true),
1040 isAuthenticated(
false)
1042 static const bool threads = q_dbus_threads_init_default();
1047#ifdef QDBUS_THREAD_DEBUG
1049 qdbusThreadDebug = qdbusDefaultThreadDebug;
1058 this, &QDBusConnectionPrivate::sendInternal);
1068 matchRefCounts.
insert(
"type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.freedesktop.DBus'", 1);
1075 "QDBusConnection(name=\"%s\")'s last reference in not in its creation thread! "
1076 "Timer and socket errors will follow and the program will probably crash",
1079 auto lastMode =
mode;
1097 q_dbus_server_unref(
server);
1103 QSet<QObject *> &
set)
1109 set.insert(haystack.obj);
1121 q_dbus_server_disconnect(
server);
1135 if (!call->ref.deref())
1145 QSet<QObject *> allObjects;
1146 collectAllObjects(
rootNode, allObjects);
1148 allObjects.insert(signalHook.obj);
1151 for (
QObject *
obj : std::as_const(allObjects))
1152 obj->disconnect(
this);
1155void QDBusConnectionPrivate::handleDBusDisconnection()
1161void QDBusConnectionPrivate::checkThread()
1183 q_dbus_timeout_handle(
timeout);
1208 if (
it->watch &&
it->read &&
it->read->isEnabled()) {
1216 && q_dbus_connection_get_is_authenticated(
connection))
1217 handleAuthentication();
1225 if (
it->watch &&
it->write &&
it->write->isEnabled()) {
1233 && q_dbus_connection_get_is_authenticated(
connection))
1234 handleAuthentication();
1244 if (
static_cast<QObject *
>(sit.value().obj) ==
obj)
1245 sit = removeSignalHookNoLock(sit);
1250 obj->disconnect(
this);
1256 QString interface = qDBusInterfaceFromMetaObject(mo);
1263 bool isAdaptor =
false;
1264 for ( ;
mo;
mo =
mo->superClass())
1265 if (
mo == &QDBusAbstractAdaptor::staticMetaObject) {
1280 qCWarning(dbusIntegration,
"QDBusConnection: Could not emit signal %s.%s: %s",
1288 q_dbus_message_set_no_reply(msg,
true);
1290 q_dbus_message_unref(msg);
1293void QDBusConnectionPrivate::serviceOwnerChangedNoLock(
const QString &
name,
1300 if (oldOwner !=
it->owner)
1302 "QDBusConnection: name '%s' had owner '%s' but we thought it was '%s'",
1305 qDBusDebug() <<
this <<
"Updating name" <<
name <<
"from" << oldOwner <<
"to" << newOwner;
1306 it->owner = newOwner;
1318 if (inputCount == -1 || inputCount + 1 !=
params.size())
1328 const char *
signal,
int minMIdx,
bool buildSignature,
1332 hook.midx =
findSlot(receiver,
signal + 1, hook.params, errorMsg);
1333 if (hook.midx == -1) {
1337 if (hook.midx < minMIdx) {
1341 hook.service = service;
1343 hook.obj = receiver;
1344 hook.argumentMatch = argMatch;
1350 if (buildSignature && mname.isNull()) {
1359 if (buildSignature) {
1360 hook.signature.clear();
1361 for (
int i = 1;
i < hook.params.size(); ++
i)
1375 interfaceMsg =
"any interface"_L1;
1377 interfaceMsg =
"interface '%1'"_L1.
arg(msg.
interface());
1380 "(signature '%4')"_L1
1384 "No such interface '%1' at object path '%2'"_L1
1388 "No such object path '%1'"_L1.arg(msg.
path())));
1392bool QDBusConnectionPrivate::activateInternalFilters(
const ObjectTreeNode &node,
1396 const QString interface = msg.interface();
1423 }
else if (msg.
member() ==
"GetAll"_L1 && msg.
signature() ==
"s"_L1) {
1438void QDBusConnectionPrivate::activateObject(ObjectTreeNode &node,
const QDBusMessage &msg,
1449 if (node.treeNode->handleMessage(msg,
q(
this))) {
1452 if (activateInternalFilters(node, msg))
1457 if (pathStartPos != msg.
path().
size()) {
1475 std::as_const(connector->adaptors)) {
1476 if (activateCall(adaptorData.adaptor, newflags, msg))
1482 it = std::lower_bound(connector->adaptors.constBegin(), connector->adaptors.constEnd(),
1485 if (!activateCall(
it->adaptor, newflags, msg))
1494 if (activateInternalFilters(node, msg))
1500 bool interfaceFound =
true;
1502 if (!node.interfaceName.isEmpty())
1503 interfaceFound = msg.
interface() == node.interfaceName;
1508 if (interfaceFound) {
1509 if (!activateCall(node.obj, node.flags, msg))
1522void QDBusConnectionPrivate::handleObjectCall(
const QDBusMessage &msg)
1548 activateObject(
result, msg, usedLength);
1552 objThread =
result.obj->thread();
1555 "Object '%1' (at path '%2')"
1556 " has no thread. Cannot deliver message."_L1
1557 .arg(
result.obj->objectName(), msg.
path())));
1573 usedLength, msg, &
sem));
1584 activateObject(
result, msg, usedLength);
1605 that->activateObject(node,
message, pathStartPos);
1619 const SignalHook &hook =
it.value();
1620 if (!hook.service.isEmpty()) {
1625 if (!hook.path.isEmpty() && hook.path != msg.
path())
1627 if (!hook.signature.isEmpty() && hook.signature != msg.
signature())
1629 if (hook.signature.isEmpty() && !hook.signature.isNull() && !msg.
signature().
isEmpty())
1631 if (!hook.argumentMatch.args.isEmpty()) {
1636 bool matched =
true;
1637 for (
int i = 0;
i < hook.argumentMatch.args.size(); ++
i) {
1649 if (!hook.argumentMatch.arg0namespace.isEmpty()) {
1658 activateSignal(hook, msg);
1662void QDBusConnectionPrivate::handleSignal(
const QDBusMessage& msg)
1677 handleSignal(
key, msg);
1680 handleSignal(
key, msg);
1684 handleSignal(
key, msg);
1687void QDBusConnectionPrivate::watchForDBusDisconnection()
1691 hook.service.clear();
1694 hook.params <<
QMetaType(QMetaType::Void);
1695 hook.midx = staticMetaObject.indexOfSlot(
"handleDBusDisconnection()");
1749 q_dbus_connection_set_exit_on_disconnect(
connection,
false);
1750 q_dbus_connection_set_watch_functions(
connection,
1755 q_dbus_connection_set_timeout_functions(
connection,
1765 watchForDBusDisconnection();
1772 QDBusConnection::ConnectionCapabilities
result;
1774 static can_send_type_t can_send_type =
nullptr;
1776#if defined(QT_LINKED_LIBDBUS)
1777# if DBUS_VERSION-0 >= 0x010400
1778 can_send_type = dbus_connection_can_send_type;
1780#elif QT_CONFIG(library)
1785#ifndef DBUS_TYPE_UNIX_FD
1786# define DBUS_TYPE_UNIX_FD int('h')
1794void QDBusConnectionPrivate::handleAuthentication()
1810 const char *service = q_dbus_bus_get_unique_name(
connection);
1814 handleAuthentication();
1816 q_dbus_connection_set_exit_on_disconnect(
connection,
false);
1833 hook.midx = staticMetaObject.indexOfSlot(
"registerServiceNoLock(QString)");
1837 hook.midx = staticMetaObject.indexOfSlot(
"unregisterServiceNoLock(QString)");
1843 hook.params.clear();
1844 hook.params.reserve(4);
1846 hook.midx = staticMetaObject.indexOfSlot(
"serviceOwnerChangedNoLock(QString,QString,QString)");
1850 watchForDBusDisconnection();
1852 qDBusDebug() <<
this <<
": connected successfully";
1871 auto locker = qt_unique_lock(call->
mutex);
1879 if (q_dbus_pending_call_get_completed(call->
pending)) {
1881 DBusMessage *
reply = q_dbus_pending_call_steal_reply(call->
pending);
1883 q_dbus_message_unref(
reply);
1911 q_dbus_pending_call_unref(call->
pending);
1941 "QDBusConnection: error: could not send message to service \"%s\" path "
1942 "\"%s\" interface \"%s\" member \"%s\": %s",
1948 "QDBusConnection: error: could not send signal to service \"%s\" path \"%s\" "
1949 "interface \"%s\" member \"%s\": %s",
1955 "QDBusConnection: error: could not send %s message to service \"%s\": %s",
1964 q_dbus_message_set_no_reply(msg,
true);
1980 : m_message(
message), m_maxCallTimeoutMs(0)
1982#if defined(QT_NO_DEBUG)
1985 Q_CONSTINIT
static int mainThreadWarningAmount = -1;
1986 Q_CONSTINIT
static int otherThreadWarningAmount = -1;
1988 Q_CONSTINIT
static int mainThreadWarningAmount = 200;
1989 Q_CONSTINIT
static int otherThreadWarningAmount = 500;
1991 Q_CONSTINIT
static bool initializedAmounts =
false;
1993 auto locker = qt_unique_lock(initializeMutex);
1995 if (!initializedAmounts) {
2000 env =
qgetenv(
"Q_DBUS_BLOCKING_CALL_MAIN_THREAD_WARNING_MS");
2004 mainThreadWarningAmount = tmp;
2008 "QDBusBlockingCallWatcher: Q_DBUS_BLOCKING_CALL_MAIN_THREAD_WARNING_MS "
2009 "must be an integer; value ignored");
2012 env =
qgetenv(
"Q_DBUS_BLOCKING_CALL_OTHER_THREAD_WARNING_MS");
2016 otherThreadWarningAmount = tmp;
2019 "QDBusBlockingCallWatcher: "
2020 "Q_DBUS_BLOCKING_CALL_OTHER_THREAD_WARNING_MS must be an integer; "
2024 initializedAmounts =
true;
2033 m_maxCallTimeoutMs = mainThreadWarningAmount;
2035 m_maxCallTimeoutMs = otherThreadWarningAmount;
2037 m_callTimer.start();
2042 if (m_maxCallTimeoutMs < 0)
2045 if (m_callTimer.elapsed() >= m_maxCallTimeoutMs) {
2048 "QDBusConnection: warning: blocking call took a long time (%d ms, max for this "
2049 "thread is %d ms) to service \"%s\" path \"%s\" interface \"%s\" member \"%s\"",
2050 int(m_callTimer.elapsed()), m_maxCallTimeoutMs,
qPrintable(m_message.service()),
2058 int m_maxCallTimeoutMs;
2071 pcall->waitForFinishedWithGui();
2073 pcall->waitForFinished();
2078 if (!pcall->ref.deref())
2091 QString interface = message.interface();
2094 return QDBusMessage::createError(QDBusError::InternalError,
2095 "Internal
error trying to call %1.%2
at %3 (signature
'%4'"_L1
2096 .arg(interface, message.member(),
2097 message.path(), message.signature()));
2100 // if the message was handled, there might be a reply
2101 QDBusMessage localReplyMsg = QDBusMessagePrivate::makeLocalReply(*this, localCallMsg);
2102 if (localReplyMsg.type() == QDBusMessage::InvalidMessage) {
2107 qPrintable(message.member()), qPrintable(message.path()),
2108 qPrintable(message.signature()));
2109 return QDBusMessage::createError(
2110 QDBusError(QDBusError::InternalError,
2111 "local-loop
message cannot have delayed replies
"_L1));
2115 qDBusDebug() << this << "got
message via local-loop:
" << localReplyMsg;
2116 return localReplyMsg;
2119QDBusPendingCallPrivate *QDBusConnectionPrivate::sendWithReplyAsync(const QDBusMessage &message,
2120 QObject *receiver, const char *returnMethod,
2121 const char *errorMethod, int timeout)
2123 QDBusPendingCallPrivate *pcall = new QDBusPendingCallPrivate(message, this);
2125 if ((isLoopback = isServiceRegisteredByThread(message.service()))) {
2126 // special case for local calls
2127 pcall->replyMessage = sendWithReplyLocal(message);
2130 if (receiver && returnMethod)
2131 pcall->setReplyCallback(receiver, returnMethod);
2134 Q_ASSERT(!pcall->watcherHelper);
2135 pcall->watcherHelper = new QDBusPendingCallWatcherHelper;
2136 connect(pcall->watcherHelper, SIGNAL(error(QDBusError,QDBusMessage)), receiver, errorMethod,
2137 Qt::QueuedConnection);
2138 pcall->watcherHelper->moveToThread(thread());
2141 if ((receiver && returnMethod) || errorMethod) {
2142 // no one waiting, will delete pcall in processFinishedCall()
2143 pcall->ref.storeRelaxed(1);
2145 // set double ref to prevent race between processFinishedCall() and ref counting
2146 // by QDBusPendingCall::QExplicitlySharedDataPointer<QDBusPendingCallPrivate>
2147 pcall->ref.storeRelaxed(2);
2152 processFinishedCall(pcall);
2158 QDBusMessagePrivate::toDBusMessage(message, connectionCapabilities(), &error);
2160 qCWarning(dbusIntegration,
2162 "interface \"%s\" member \"%s\": %s",
2179 DBusPendingCall *
pending =
nullptr;
2180 DBusMessage *msg =
static_cast<DBusMessage *
>(
message);
2181 bool isNoReply = !pcall;
2182 Q_ASSERT(isNoReply == !!q_dbus_message_get_no_reply(msg));
2186 if (isNoReply && q_dbus_connection_send(
connection, msg,
nullptr)) {
2190 q_dbus_message_unref(msg);
2208 q_dbus_message_unref(msg);
2219 QObject *receiver,
const char *slot)
2222 rules.
args = argumentMatch;
2229 QObject *receiver,
const char *slot)
2235 hook.signature = signature;
2237 if (!
prepareHook(hook,
key, service,
path,
interface,
name, argumentMatch, receiver, slot, 0,
2240 <<
"Could not connect" <<
interface << "to
" << slot + 1 << ":" << qPrintable(errorMsg);
2244 Q_ASSERT(thread() != QThread::currentThread());
2245 return addSignalHook(key, hook);
2248bool QDBusConnectionPrivate::addSignalHook(const QString &key, const SignalHook &hook)
2250 bool result = false;
2252 QMetaObject::invokeMethod(this, &QDBusConnectionPrivate::addSignalHookImpl,
2253 Qt::BlockingQueuedConnection, qReturnArg(result), key, hook);
2258bool QDBusConnectionPrivate::addSignalHookImpl(const QString &key, const SignalHook &hook)
2260 QDBusWriteLocker locker(ConnectAction, this);
2263 QDBusConnectionPrivate::SignalHookHash::ConstIterator it = signalHooks.constFind(key);
2264 QDBusConnectionPrivate::SignalHookHash::ConstIterator end = signalHooks.constEnd();
2265 for ( ; it != end && it.key() == key; ++it) {
2266 const QDBusConnectionPrivate::SignalHook &entry = it.value();
2267 if (entry.service == hook.service &&
2268 entry.path == hook.path &&
2269 entry.signature == hook.signature &&
2270 entry.obj == hook.obj &&
2271 entry.midx == hook.midx &&
2272 entry.argumentMatch == hook.argumentMatch) {
2278 signalHooks.insert(key, hook);
2279 connect(hook.obj, &QObject::destroyed, this, &QDBusConnectionPrivate::objectDestroyed,
2280 Qt::ConnectionType(Qt::BlockingQueuedConnection | Qt::UniqueConnection));
2282 MatchRefCountHash::iterator mit = matchRefCounts.find(hook.matchRule);
2284 if (mit != matchRefCounts.end()) {
2285 mit.value() = mit.value() + 1;
2289 matchRefCounts.insert(hook.matchRule, 1);
2292 if (mode != QDBusConnectionPrivate::PeerMode) {
2293 qDBusDebug() << this << "Adding rule:" << hook.matchRule;
2294 q_dbus_bus_add_match(connection, hook.matchRule, nullptr);
2298 if (shouldWatchService(hook.service)) {
2299 WatchedServicesHash::mapped_type &data = watchedServices[hook.service];
2300 if (++data.refcount == 1) {
2302 ArgMatchRules rules;
2303 rules.args << hook.service;
2304 q_dbus_bus_add_match(connection,
2305 buildMatchRule(QDBusUtil::dbusService(), QString(), QDBusUtil::dbusInterface(),
2306 QDBusUtil::nameOwnerChanged(), rules, QString()),
2308 data.owner = getNameOwnerNoCache(hook.service);
2309 qDBusDebug() << this << "Watching service" << hook.service << "for owner changes (current owner:"
2310 << data.owner << ")";
2318bool QDBusConnectionPrivate::disconnectSignal(const QString &service,
2319 const QString &path, const QString &interface, const QString &name,
2320 const QStringList &argumentMatch, const QString &signature,
2321 QObject *receiver, const char *slot)
2323 ArgMatchRules rules;
2324 rules.args = argumentMatch;
2325 return disconnectSignal(service, path, interface, name, rules, signature, receiver, slot);
2328bool QDBusConnectionPrivate::disconnectSignal(const QString &service,
2329 const QString &path, const QString &interface, const QString &name,
2330 const ArgMatchRules &argumentMatch, const QString &signature,
2331 QObject *receiver, const char *slot)
2334 QDBusConnectionPrivate::SignalHook hook;
2336 QString name2 = name;
2340 hook.signature = signature;
2342 if (!prepareHook(hook, key, service, path, interface, name, argumentMatch, receiver, slot, 0,
2344 qCWarning(dbusIntegration)
2345 << "Could not disconnect" << interface << "to" << slot + 1 << ":" << qPrintable(errorMsg);
2349 Q_ASSERT(thread() != QThread::currentThread());
2350 return removeSignalHook(key, hook);
2353bool QDBusConnectionPrivate::removeSignalHook(const QString &key, const SignalHook &hook)
2355 bool result = false;
2357 QMetaObject::invokeMethod(this, &QDBusConnectionPrivate::removeSignalHookImpl,
2358 Qt::BlockingQueuedConnection, qReturnArg(result), key, hook);
2363bool QDBusConnectionPrivate::removeSignalHookImpl(const QString &key, const SignalHook &hook)
2366 QDBusWriteLocker locker(ConnectAction, this);
2367 QDBusConnectionPrivate::SignalHookHash::Iterator it = signalHooks.find(key);
2368 QDBusConnectionPrivate::SignalHookHash::Iterator end = signalHooks.end();
2369 for ( ; it != end && it.key() == key; ++it) {
2370 const QDBusConnectionPrivate::SignalHook &entry = it.value();
2371 if (entry.service == hook.service &&
2372 entry.path == hook.path &&
2373 entry.signature == hook.signature &&
2374 entry.obj == hook.obj &&
2375 entry.midx == hook.midx &&
2376 entry.argumentMatch.args == hook.argumentMatch.args) {
2378 removeSignalHookNoLock(it);
2387QDBusConnectionPrivate::SignalHookHash::Iterator
2388QDBusConnectionPrivate::removeSignalHookNoLock(SignalHookHash::Iterator it)
2390 const SignalHook &hook = it.value();
2393 MatchRefCountHash::iterator i = matchRefCounts.find(hook.matchRule);
2394 if (i == matchRefCounts.end()) {
2395 qCWarning(dbusIntegration,
2396 "QDBusConnectionPrivate::disconnectSignal: MatchRule not found in "
2397 "matchRefCounts!!");
2399 if (i.value() == 1) {
2401 matchRefCounts.erase(i);
2404 i.value() = i.value() - 1;
2409 if (connection && erase) {
2410 if (mode != QDBusConnectionPrivate::PeerMode) {
2411 qDBusDebug() << this << "Removing rule:" << hook.matchRule;
2412 q_dbus_bus_remove_match(connection, hook.matchRule, nullptr);
2416 WatchedServicesHash::Iterator sit = watchedServices.find(hook.service);
2417 if (sit != watchedServices.end()) {
2418 if (--sit.value().refcount == 0) {
2419 watchedServices.erase(sit);
2420 ArgMatchRules rules;
2421 rules.args << hook.service;
2422 q_dbus_bus_remove_match(connection,
2423 buildMatchRule(QDBusUtil::dbusService(), QString(), QDBusUtil::dbusInterface(),
2424 QDBusUtil::nameOwnerChanged(), rules, QString()),
2432 return signalHooks.erase(it);
2435void QDBusConnectionPrivate::registerObject(const ObjectTreeNode *node)
2437 connect(node->obj, &QObject::destroyed, this, &QDBusConnectionPrivate::objectDestroyed,
2438 Qt::ConnectionType(Qt::BlockingQueuedConnection | Qt::UniqueConnection));
2440 if (node->flags & (QDBusConnection::ExportAdaptors
2441 | QDBusConnection::ExportScriptableSignals
2442 | QDBusConnection::ExportNonScriptableSignals)) {
2443 QDBusAdaptorConnector *connector = qDBusCreateAdaptorConnector(node->obj);
2445 if (node->flags & (QDBusConnection::ExportScriptableSignals
2446 | QDBusConnection::ExportNonScriptableSignals)) {
2447 connector->disconnectAllSignals(node->obj);
2448 connector->connectAllSignals(node->obj);
2451 connect(connector, &QDBusAdaptorConnector::relaySignal, this,
2452 &QDBusConnectionPrivate::relaySignal,
2453 Qt::ConnectionType(Qt::QueuedConnection | Qt::UniqueConnection));
2457void QDBusConnectionPrivate::unregisterObject(const QString &path, QDBusConnection::UnregisterMode mode)
2459 QDBusConnectionPrivate::ObjectTreeNode *node = &rootNode;
2460 QList<QStringView> pathComponents;
2462 if (path == "/"_L1) {
2465 pathComponents = QStringView{path}.split(u'/');
2469 huntAndUnregister(pathComponents, i, mode, node);
2472void QDBusConnectionPrivate::connectRelay(const QString &service,
2473 const QString &path, const QString &interface,
2474 QDBusAbstractInterface *receiver,
2475 const QMetaMethod &signal)
2483 sig.append(QSIGNAL_CODE + '0');
2484 sig.append(signal.methodSignature());
2486 if (!prepareHook(hook, key, service, path, interface, QString(), ArgMatchRules(), receiver, sig,
2487 QDBusAbstractInterface::staticMetaObject.methodCount(), true, errorMsg)) {
2488 qCWarning(dbusIntegration)
2489 << "Could not connect" << interface << "to" << signal.name() << ":" << qPrintable(errorMsg);
2493 Q_ASSERT(thread() != QThread::currentThread());
2494 addSignalHook(key, hook);
2497void QDBusConnectionPrivate::disconnectRelay(const QString &service,
2498 const QString &path, const QString &interface,
2499 QDBusAbstractInterface *receiver,
2500 const QMetaMethod &signal)
2508 sig.append(QSIGNAL_CODE + '0');
2509 sig.append(signal.methodSignature());
2511 if (!prepareHook(hook, key, service, path, interface, QString(), ArgMatchRules(), receiver, sig,
2512 QDBusAbstractInterface::staticMetaObject.methodCount(), true, errorMsg)) {
2513 qCWarning(dbusIntegration) << "Could not disconnect" << interface << "to"
2514 << signal.methodSignature() << ":" << qPrintable(errorMsg);
2518 Q_ASSERT(thread() != QThread::currentThread());
2519 removeSignalHook(key, hook);
2522bool QDBusConnectionPrivate::shouldWatchService(const QString &service)
2525 if (mode != ClientMode)
2528 if (service.isEmpty())
2531 if (service == QDBusUtil::dbusService())
2545void QDBusConnectionPrivate::watchService(const QString &service, QDBusServiceWatcher::WatchMode mode, QObject *obj, const char *member)
2547 ArgMatchRules matchArgs = matchArgsForService(service, mode);
2548 connectSignal(QDBusUtil::dbusService(), QString(), QDBusUtil::dbusInterface(), QDBusUtil::nameOwnerChanged(),
2549 matchArgs, QString(), obj, member);
2560void QDBusConnectionPrivate::unwatchService(const QString &service, QDBusServiceWatcher::WatchMode mode, QObject *obj, const char *member)
2562 ArgMatchRules matchArgs = matchArgsForService(service, mode);
2563 disconnectSignal(QDBusUtil::dbusService(), QString(), QDBusUtil::dbusInterface(), QDBusUtil::nameOwnerChanged(),
2564 matchArgs, QString(), obj, member);
2567QString QDBusConnectionPrivate::getNameOwner(const QString& serviceName)
2569 if (QDBusUtil::isValidUniqueConnectionName(serviceName))
2576 QReadLocker locker(&lock);
2577 WatchedServicesHash::ConstIterator it = watchedServices.constFind(serviceName);
2578 if (it != watchedServices.constEnd())
2583 return getNameOwnerNoCache(serviceName);
2586QString QDBusConnectionPrivate::getNameOwnerNoCache(const QString &serviceName)
2588 QDBusMessage msg = QDBusMessage::createMethodCall(QDBusUtil::dbusService(),
2589 QDBusUtil::dbusPath(), QDBusUtil::dbusInterface(),
2590 QStringLiteral("GetNameOwner"));
2591 QDBusMessagePrivate::setParametersValidated(msg, true);
2594 QDBusPendingCallPrivate *pcall = sendWithReplyAsync(msg, nullptr, nullptr, nullptr);
2595 if (thread() == QThread::currentThread()) {
2598 q_dbus_pending_call_block(pcall->pending);
2600 pcall->waitForFinished();
2601 msg = pcall->replyMessage;
2603 if (!pcall->ref.deref())
2606 if (msg.type() == QDBusMessage::ReplyMessage)
2607 return msg.arguments().at(0).toString();
2612QDBusConnectionPrivate::findMetaObject(const QString &service, const QString &path,
2613 const QString &interface, QDBusError &error)
2616 if (!interface.isEmpty()) {
2617 QDBusReadLocker locker(FindMetaObject1Action, this);
2618 QDBusMetaObject *mo = cachedMetaObjects.value(interface, nullptr);
2622 if (path.isEmpty()) {
2623 error = QDBusError(QDBusError::InvalidObjectPath, "Object path cannot be empty"_L1);
2629 QDBusMessage msg = QDBusMessage::createMethodCall(service, path,
2630 QDBusUtil::dbusInterfaceIntrospectable(),
2631 QStringLiteral("Introspect"));
2632 QDBusMessagePrivate::setParametersValidated(msg, true);
2634 QDBusMessage reply = sendWithReply(msg, QDBus::Block);
2637 QDBusWriteLocker locker(FindMetaObject2Action, this);
2638 QDBusMetaObject *mo = nullptr;
2639 if (!interface.isEmpty())
2640 mo = cachedMetaObjects.value(interface, nullptr);
2646 if (reply.type() == QDBusMessage::ReplyMessage) {
2647 if (reply.signature() == "s"_L1)
2649 xml = reply.arguments().at(0).toString();
2651 error = QDBusError(reply);
2653 if (reply.type() != QDBusMessage::ErrorMessage || error.type() != QDBusError::UnknownMethod)
2658 QDBusMetaObject *result = QDBusMetaObject::createMetaObject(interface, xml,
2659 cachedMetaObjects, error);
2664void QDBusConnectionPrivate::registerService(const QString &serviceName)
2666 QDBusWriteLocker locker(RegisterServiceAction, this);
2667 registerServiceNoLock(serviceName);
2670void QDBusConnectionPrivate::registerServiceNoLock(const QString &serviceName)
2672 serviceNames.append(serviceName);
2675void QDBusConnectionPrivate::unregisterService(const QString &serviceName)
2677 QDBusWriteLocker locker(UnregisterServiceAction, this);
2678 unregisterServiceNoLock(serviceName);
2681void QDBusConnectionPrivate::unregisterServiceNoLock(const QString &serviceName)
2683 serviceNames.removeAll(serviceName);
2686bool QDBusConnectionPrivate::isServiceRegisteredByThread(const QString &serviceName)
2688 if (!serviceName.isEmpty() && serviceName == baseService)
2690 if (serviceName == QDBusUtil::dbusService())
2693 QDBusReadLocker locker(UnregisterServiceAction, this);
2694 return serviceNames.contains(serviceName);
2697void QDBusConnectionPrivate::postEventToThread(int action, QObject *object, QEvent *ev)
2699 QDBusLockerBase::reportThreadAction(action, QDBusLockerBase::BeforePost, this);
2700 QCoreApplication::postEvent(object, ev);
2701 QDBusLockerBase::reportThreadAction(action, QDBusLockerBase::AfterPost, this);
2709void QDBusConnectionPrivate::enableDispatchDelayed(QObject *context)
2712 QMetaObject::invokeMethod(
2718 QMetaObject::invokeMethod(this, &QDBusConnectionPrivate::setDispatchEnabled,
2719 Qt::QueuedConnection, true);
2723 Qt::QueuedConnection);
Connects to the accessibility dbus.
void storeRelaxed(T newValue) noexcept
int toInt(bool *ok=nullptr, int base=10) const
Returns the byte array converted to an int using base base, which is ten by default.
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
static void postEvent(QObject *receiver, QEvent *event, int priority=Qt::NormalEventPriority)
~QDBusActivateObjectEvent() override
void placeMetaCall(QObject *) override
~QDBusBlockingCallWatcher()
Q_NODISCARD_CTOR QDBusBlockingCallWatcher(const QDBusMessage &message)
static QDBusConnectionManager * instance()
static QDBusConnectionPrivate * d(const QDBusConnection &q)
void setDispatchEnabled(bool enable)
void objectDestroyed(QObject *o)
void socketWrite(qintptr)
PendingMessageList pendingMessages
friend class QDBusCallDeliveryEvent
void setPeer(DBusConnection *connection, const QDBusErrorInternal &error)
WatchedServicesHash watchedServices
void setConnection(DBusConnection *connection, const QDBusErrorInternal &error)
MatchRefCountHash matchRefCounts
static QDBusConnection q(QDBusConnectionPrivate *connection)
QDBusPendingCallPrivate * sendWithReplyAsync(const QDBusMessage &message, QObject *receiver, const char *returnMethod, const char *errorMethod, int timeout=-1)
bool connectSignal(const QString &service, const QString &path, const QString &interface, const QString &name, const QStringList &argumentMatch, const QString &signature, QObject *receiver, const char *slot)
QDBusMessage sendWithReply(const QDBusMessage &message, QDBus::CallMode mode, int timeout=-1)
void postEventToThread(int action, QObject *target, QEvent *event)
QDBusConnection::ConnectionCapabilities connectionCapabilities() const
PendingCallList pendingCalls
SignalHookHash signalHooks
void messageNeedsSending(QDBusPendingCallPrivate *pcall, void *msg, int timeout=-1)
bool send(const QDBusMessage &message)
QDBusConnectionInterface * busService
static bool prepareHook(QDBusConnectionPrivate::SignalHook &hook, QString &key, const QString &service, const QString &path, const QString &interface, const QString &name, const ArgMatchRules &argMatch, QObject *receiver, const char *signal, int minMIdx, bool buildSignature, QString &errorMsg)
~QDBusConnectionPrivate()
void setServer(QDBusServer *object, DBusServer *server, const QDBusErrorInternal &error)
void spyHooksFinished(const QDBusMessage &msg)
void relaySignal(QObject *obj, const QMetaObject *, int signalId, const QVariantList &args)
void timerEvent(QTimerEvent *e) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
QDBusMessage sendWithReplyLocal(const QDBusMessage &message)
void enableDispatchDelayed(QObject *context)
void dispatchStatusChanged()
static void processFinishedCall(QDBusPendingCallPrivate *call)
bool handleMessage(const QDBusMessage &msg)
MetaObjectHash cachedMetaObjects
static QDBusCallDeliveryEvent * prepareReply(QDBusConnectionPrivate *target, QObject *object, int idx, const QList< QMetaType > &metaTypes, const QDBusMessage &msg)
static int findSlot(QObject *obj, const QByteArray &normalizedName, QList< QMetaType > ¶ms, QString &errorMsg)
DBusConnection * connection
QDBusServer * serverObject
@ UnixFileDescriptorPassing
@ ExportScriptableInvokables
@ ExportNonScriptableSignals
@ ExportScriptableSignals
@ ExportNonScriptableSlots
@ ExportNonScriptableInvokables
UnregisterMode
The mode for unregistering an object path:
static QDBusContextPrivate * set(QObject *obj, QDBusContextPrivate *newContext)
ErrorType
In order to facilitate verification of the most common D-Bus errors generated by the D-Bus implementa...
static void setParametersValidated(QDBusMessage &msg, bool enable)
static QDBusMessage fromDBusMessage(DBusMessage *dmsg, QDBusConnection::ConnectionCapabilities capabilities)
static DBusMessage * toDBusMessage(const QDBusMessage &message, QDBusConnection::ConnectionCapabilities capabilities, QDBusError *error)
static bool isLocal(const QDBusMessage &msg)
static QDBusMessage makeLocal(const QDBusConnectionPrivate &conn, const QDBusMessage &asSent)
static QDBusMessage createSignal(const QString &path, const QString &interface, const QString &name)
Constructs a new DBus message with the given path, interface and name, representing a signal emission...
QString service() const
Returns the name of the service or the bus address of the remote method call.
QDBusMessage createReply(const QList< QVariant > &arguments=QList< QVariant >()) const
Constructs a new DBus message representing a reply, with the given arguments.
QList< QVariant > arguments() const
Returns the list of arguments that are going to be sent or were received from D-Bus.
bool isReplyRequired() const
Returns the flag that indicates if this message should see a reply or not.
QString interface() const
Returns the interface of the method being called (in the case of a method call) or of the signal bein...
static QDBusMessage createError(const QString &name, const QString &msg)
Constructs a new DBus message representing an error, with the given name and msg.
MessageType type() const
Returns the message type.
QString member() const
Returns the name of the signal that was emitted or the name of the method that was called.
QString signature() const
Returns the signature of the signal that was received or for the output arguments of a method call.
bool isDelayedReply() const
Returns the delayed reply flag, as set by setDelayedReply().
QString path() const
Returns the path of the object that this message is being sent to (in the case of a method call) or b...
QDBusMessage createErrorReply(const QString &name, const QString &msg) const
Constructs a new DBus message representing an error reply message, with the given name and msg.
QPointer< QObject > receiver
QDBusPendingCallWatcherHelper * watcherHelper
QWaitCondition waitForFinishedCondition
QDBusConnectionPrivate *const connection
QList< QMetaType > metaTypes
QDBusMessage replyMessage
void checkReceivedSignature()
DBusPendingCall * pending
const QDBusMessage sentMessage
void emitSignals(const QDBusMessage &replyMessage, const QDBusMessage &sentMessage)
void newConnection(const QDBusConnection &connection)
This signal is emitted when a new client connection connection is established to the server.
~QDBusSpyCallEvent() override
void placeMetaCall(QObject *) override
static void invokeSpyHooks(const QDBusMessage &msg)
void(* Hook)(const QDBusMessage &)
void add(QDBusSpyCallEvent::Hook hook)
void invoke(const QDBusMessage &msg)
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
iterator Iterator
Qt-style synonym for QHash::iterator.
T value(const Key &key) const noexcept
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
const_iterator ConstIterator
Qt-style synonym for QHash::const_iterator.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
qsizetype size() const noexcept
bool isEmpty() const noexcept
iterator erase(const_iterator begin, const_iterator end)
const_reference at(qsizetype i) const noexcept
const_iterator constBegin() const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
const_iterator constEnd() const noexcept
const_iterator ConstIterator
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
const_iterator ConstIterator
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
friend class const_iterator
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
const_iterator constFind(const Key &key) const noexcept
const QObjectList & children() const
Returns a list of child objects.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
QThread * thread() const
Returns the thread in which the object lives.
bool isNull() const noexcept
const_iterator constEnd() const noexcept
iterator erase(const_iterator i)
void activated(QSocketDescriptor socket, QSocketNotifier::Type activationEvent, QPrivateSignal)
constexpr QStringView mid(qsizetype pos, qsizetype n=-1) const noexcept
Returns the substring of length length starting at position start in this object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
void reserve(qsizetype size)
Ensures the string has space for at least size characters.
void chop(qsizetype n)
Removes n characters from the end of the string.
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
void clear()
Clears the contents of the string and makes it null.
qsizetype size() const noexcept
Returns the number of characters in this string.
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QByteArray toUtf8() const &
static QThread * currentThread()
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
QString toString() const
Returns the variant as a QString if the variant has a userType() including, but not limited to:
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
QMetaType metaType() const
const void * constData() const
#define DBUS_TYPE_UNIX_FD
dbus_uint32_t dbus_bool_t
@ DBUS_HANDLER_RESULT_HANDLED
@ DBUS_HANDLER_RESULT_NOT_YET_HANDLED
#define DBUS_INTERFACE_LOCAL
#define DBUS_INTERFACE_DBUS
@ DBUS_DISPATCH_DATA_REMAINS
qDeleteAll(list.begin(), list.end())
QSet< QString >::iterator it
QList< QVariant > arguments
QString dbusInterfaceIntrospectable()
QString dbusInterfaceProperties()
QString disconnectedErrorMessage()
CallMode
This enum describes the various ways of placing a function call.
Combined button and popup list for selecting options.
#define Q_BASIC_ATOMIC_INITIALIZER(a)
QFunctionPointer qdbus_resolve_conditionally(const char *name)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void * user_data
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch * watch
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage return DBusPendingCall DBusPendingCall return DBusPendingCall return dbus_int32_t return DBusServer * server
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char * interface
DBusConnection const char DBusError * error
DBusConnection * connection
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char * method
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage return DBusPendingCall * pending
QDBusAdaptorConnector * qDBusFindAdaptorConnector(QObject *obj)
bool qDBusInterfaceInObject(QObject *obj, const QString &interface_name)
QString qDBusIntrospectObject(const QDBusConnectionPrivate::ObjectTreeNode &node, const QString &path)
QDBusMessage qDBusPropertyGetAll(const QDBusConnectionPrivate::ObjectTreeNode &node, const QDBusMessage &msg)
QDBusMessage qDBusPropertyGet(const QDBusConnectionPrivate::ObjectTreeNode &node, const QDBusMessage &msg)
int qDBusParametersForMethod(const QMetaMethod &mm, QList< QMetaType > &metaTypes, QString &errorMsg)
Q_DBUS_EXPORT bool qDBusCheckAsyncTag(const char *tag)
QDBusMessage qDBusPropertySet(const QDBusConnectionPrivate::ObjectTreeNode &node, const QDBusMessage &msg)
static void qDBusNewConnection(DBusServer *server, DBusConnection *connection, void *data)
static QDBusConnectionPrivate::ArgMatchRules matchArgsForService(const QString &service, QDBusServiceWatcher::WatchMode mode)
static QDebug operator<<(QDebug dbg, const QThread *th)
static QDBusCallDeliveryEvent *const DIRECT_DELIVERY
static bool findObject(const QDBusConnectionPrivate::ObjectTreeNode *root, const QString &fullpath, int &usedLength, QDBusConnectionPrivate::ObjectTreeNode &result)
static Q_CONSTINIT QBasicAtomicInt isDebugging
static void qDBusUpdateDispatchStatus(DBusConnection *connection, DBusDispatchStatus new_status, void *data)
static void qDBusRemoveWatch(DBusWatch *watch, void *data)
static void qDBusResultReceived(DBusPendingCall *pending, void *user_data)
static void qDBusToggleTimeout(DBusTimeout *timeout, void *data)
static void huntAndUnregister(const QList< QStringView > &pathComponents, int i, QDBusConnection::UnregisterMode mode, QDBusConnectionPrivate::ObjectTreeNode *node)
static dbus_bool_t qDBusAddWatch(DBusWatch *watch, void *data)
static QDBusConnection::ConnectionCapabilities connectionCapabilities(DBusConnection *connection)
static dbus_bool_t qDBusAddTimeout(DBusTimeout *timeout, void *data)
static QObject * findChildObject(const QDBusConnectionPrivate::ObjectTreeNode *root, const QString &fullpath, int start)
Q_DBUS_EXPORT void qDBusAddSpyHook(QDBusSpyCallEvent::Hook)
static void huntAndEmit(DBusConnection *connection, DBusMessage *msg, QObject *needle, const QDBusConnectionPrivate::ObjectTreeNode &haystack, bool isScriptable, bool isAdaptor, const QString &path=QString())
static void qDBusRemoveTimeout(DBusTimeout *timeout, void *data)
static QByteArray buildMatchRule(const QString &service, const QString &objectPath, const QString &interface, const QString &member, const QDBusConnectionPrivate::ArgMatchRules &argMatch, const QString &)
static DBusHandlerResult qDBusSignalFilter(DBusConnection *connection, DBusMessage *message, void *data)
static void qDBusToggleWatch(DBusWatch *watch, void *data)
static int findSlot(const QMetaObject *mo, const QByteArray &name, int flags, const QString &signature_, QList< QMetaType > &metaTypes)
static dbus_int32_t server_slot
static void huntAndDestroy(QObject *needle, QDBusConnectionPrivate::ObjectTreeNode &haystack)
@ HandleObjectCallPostEventAction
@ MessageResultReceivedAction
@ HandleObjectCallSemaphoreAction
#define SEM_ACQUIRE(action, sem)
static QT_BEGIN_NAMESPACE QDirectFBEGLHooks * hooks
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
static QByteArray cacheKey(Args &&...args)
#define Q_LOGGING_CATEGORY(name,...)
#define qCWarning(category,...)
static ControlElement< T > * ptr(QWidget *widget)
constexpr const T & qMin(const T &a, const T &b)
GLenum GLuint GLenum GLsizei length
GLbitfield GLuint64 timeout
[4]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLuint GLsizei const GLchar * message
GLenum const GLint * param
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLdouble GLdouble GLdouble GLdouble q
GLsizei const GLchar *const * path
#define Q_ASSERT_X(cond, x, msg)
#define qPrintable(string)
#define qUtf16Printable(string)
#define QStringLiteral(str)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept
QFuture< QSet< QChar > > set
[10]
QFutureWatcher< int > watcher
QTextStream out(stdout)
[7]
myObject disconnect()
[26]
QNetworkAccessManager manager
QDBusConnection::RegisterOptions flags
static void reportThreadAction(int, int, QDBusConnectionPrivate *)