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;
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;
127 int timerId =
d->startTimer(std::chrono::milliseconds{q_dbus_timeout_get_interval(
timeout)});
128 Q_ASSERT_X(timerId,
"QDBusConnection",
"Failed to start a timer");
147 while (
it !=
d->timeouts.end()) {
149 d->killTimer(
it.key());
150 it =
d->timeouts.erase(
it);
178 int fd = q_dbus_watch_get_unix_fd(
watch);
186 watcher.read->setEnabled(q_dbus_watch_get_enabled(
watch));
193 watcher.write->setEnabled(q_dbus_watch_get_enabled(
watch));
210 int fd = q_dbus_watch_get_unix_fd(
watch);
213 while (
i !=
d->watchers.end() &&
i.key() ==
fd) {
214 if (
i.value().watch ==
watch) {
215 delete i.value().read;
216 delete i.value().write;
217 i =
d->watchers.erase(
i);
231 int fd = q_dbus_watch_get_unix_fd(
watch);
234 while (
i !=
d->watchers.end() &&
i.key() ==
fd) {
235 if (
i.value().watch ==
watch) {
242 i.value().read->setEnabled(
enabled);
244 i.value().write->setEnabled(
enabled);
257 emit d->dispatchStatusChanged();
277 q_dbus_connection_set_allow_anonymous(
connection,
true);
313 result +=
"type='signal',"_L1;
314 const auto keyValue =
"%1='%2',"_L1;
316 if (!service.isEmpty())
317 result += keyValue.arg(
"sender"_L1, service);
319 result += keyValue.arg(
"path"_L1, objectPath);
323 result += keyValue.arg(
"member"_L1, member);
326 if (!argMatch.
args.isEmpty()) {
327 const QString keyValue =
"arg%1='%2',"_L1;
328 for (
int i = 0;
i < argMatch.
args.size(); ++
i)
329 if (!argMatch.
args.at(
i).isNull())
341 const QString &fullpath,
int &usedLength,
351 if (fullpath.
at(0) == u
'/')
411 if (
child->objectName() == pathComponent) {
432 if (service.endsWith(u
'*')) {
437 matchArgs.
args << service;
458 qDBusSpyHookList()->append(hook);
494 qDBusDebug() <<
d <<
"got message (signal):" << amsg;
496 return d->handleMessage(amsg) ?
504 if (!
ref.loadRelaxed())
513 qDBusDebug() <<
this <<
"delivery is suspended";
518 switch (amsg.
type()) {
532 qDBusDebug() <<
this <<
"invoking message spies directly";
535 qDBusDebug() <<
this <<
"invoking message spies via event";
544 handleObjectCall(amsg);
563 if (needle == haystack.
obj) {
564 haystack.
obj =
nullptr;
573 if (pathComponents.
size() ==
i) {
588 if (
it ==
end ||
it->name != pathComponents.
at(
i))
602 if (node.isActive()) {
604 path + u
'/' + node.name);
608 if (needle == haystack.
obj) {
612 else if (!isAdaptor) {
613 int mask = isScriptable
624 DBusMessage *msg2 = q_dbus_message_copy(msg);
625 q_dbus_message_set_path(msg2,
p);
626 q_dbus_connection_send(
connection, msg2,
nullptr);
627 q_dbus_message_unref(msg2);
636 for (
int idx =
mo->methodCount() - 1 ; idx >= QObject::staticMetaObject.methodCount(); --idx) {
656 if (isAsync && returnType.
id() != QMetaType::Void)
661 if (inputCount == -1)
664 metaTypes[0] = returnType;
665 bool hasMessage =
false;
666 if (inputCount > 0 &&
676 for (
i = 1;
i <= inputCount; ++
i) {
681 reconstructedSignature += typeSignature;
682 if (!msgSignature.
startsWith(reconstructedSignature))
686 if (reconstructedSignature != msgSignature)
697 for (
int j =
i;
ok &&
j < metaTypes.
size(); ++
j)
704 if (isAsync && metaTypes.
size() >
i + 1)
751 int n = metaTypes.
size() - 1;
759 for (
int i = 0;
i <
n; ++
i)
785 deliverCall(
this, 0, msg, hook.
params, hook.
midx);
814 static const char cachePropertyName[] =
"_qdbus_slotCache";
820 "QDBusConnection: internal threading error",
821 "function called for an object that is in another thread!!");
824 qvariant_cast<QDBusSlotCache>(
object->property(cachePropertyName));
834 cacheIt.key() == cacheKey)
836 if (cacheIt == slotCache.
hash.
constEnd() || cacheIt.key() != cacheKey)
859 qCWarning(dbusIntegration).nospace() <<
"Could not find slot " <<
mo->className()
872 }
else if (cacheIt->slotIdx == -1) {
877 deliverCall(
object,
flags, msg, cacheIt->metaTypes, cacheIt->slotIdx);
887 "QDBusConnection: internal threading error",
888 "function called for an object that is in another thread!!");
904 for (
i = 1;
i <= pCount; ++
i) {
905 auto id = metaTypes[
i];
911 if (
arg.metaType() ==
id)
913 params.append(
const_cast<void *
>(
arg.constData()));
914 else if (
arg.metaType() == QMetaType::fromType<QDBusArgument>()) {
923 qFatal(
"Internal error: demarshalling function for type '%s' (%d) failed!",
924 out.typeName(),
out.metaType().id());
926 params.append(
const_cast<void *
>(
out.constData()));
928 qFatal(
"Internal error: got invalid meta type %d (%s) "
929 "when trying to convert to meta type %d (%s)",
930 arg.metaType().id(),
arg.metaType().name(),
936 params.append(
const_cast<void*
>(
static_cast<const void*
>(&msg)));
941 const int numMetaTypes = metaTypes.
size();
943 if (metaTypes[0].
id() != QMetaType::Void && metaTypes[0].isValid()) {
944 outputArgs.
reserve(numMetaTypes -
i + 1);
949 outputArgs.
reserve(numMetaTypes -
i);
952 for ( ;
i < numMetaTypes; ++
i) {
969 slotIdx,
params.data()) >= 0;
980 qDBusDebug() <<
this <<
"Automatically sending reply:" << outputArgs;
984 qCWarning(dbusIntegration,
"Internal error: Failed to deliver message");
999 anonymousAuthenticationAllowed(
false),
1000 dispatchEnabled(true),
1001 isAuthenticated(
false)
1003 static const bool threads = q_dbus_threads_init_default();
1008#ifdef QDBUS_THREAD_DEBUG
1010 qdbusThreadDebug = qdbusDefaultThreadDebug;
1019 this, &QDBusConnectionPrivate::sendInternal);
1033 matchRefCounts.
insert(
"type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.freedesktop.DBus'", 1);
1040 "QDBusConnection(name=\"%s\")'s last reference in not in its creation thread! "
1041 "Timer and socket errors will follow and the program will probably crash",
1044 auto lastMode =
mode;
1062 q_dbus_server_unref(
server);
1074 set.insert(haystack.
obj);
1086 q_dbus_server_disconnect(
server);
1100 if (!call->ref.deref())
1111 collectAllObjects(
rootNode, allObjects);
1113 allObjects.
insert(signalHook.obj);
1116 for (
QObject *
obj : std::as_const(allObjects))
1117 obj->disconnect(
this);
1120void QDBusConnectionPrivate::handleDBusDisconnection()
1126void QDBusConnectionPrivate::checkThread()
1148 q_dbus_timeout_handle(
timeout);
1173 if (
it->watch &&
it->read &&
it->read->isEnabled()) {
1181 && q_dbus_connection_get_is_authenticated(
connection))
1182 handleAuthentication();
1190 if (
it->watch &&
it->write &&
it->write->isEnabled()) {
1198 && q_dbus_connection_get_is_authenticated(
connection))
1199 handleAuthentication();
1209 if (
static_cast<QObject *
>(sit.value().obj) ==
obj)
1210 sit = removeSignalHookNoLock(sit);
1215 obj->disconnect(
this);
1221 QString interface = qDBusInterfaceFromMetaObject(mo);
1228 bool isAdaptor =
false;
1229 for ( ;
mo;
mo =
mo->superClass())
1230 if (
mo == &QDBusAbstractAdaptor::staticMetaObject) {
1245 qCWarning(dbusIntegration,
"QDBusConnection: Could not emit signal %s.%s: %s",
1253 q_dbus_message_set_no_reply(msg,
true);
1255 q_dbus_message_unref(msg);
1258void QDBusConnectionPrivate::serviceOwnerChangedNoLock(
const QString &
name,
1266 if (oldOwner !=
it->owner)
1268 "QDBusConnection: name '%s' had owner '%s' but we thought it was '%s'",
1271 qDBusDebug() <<
this <<
"Updating name" <<
name <<
"from" << oldOwner <<
"to" << newOwner;
1272 it->owner = newOwner;
1279 int midx =
obj->metaObject()->indexOfMethod(normalizedName);
1284 if (inputCount == -1 || inputCount + 1 !=
params.size())
1295 bool buildSignature)
1300 if (hook.
midx == -1) {
1304 if (hook.
midx < minMIdx) {
1310 hook.
obj = receiver;
1317 if (buildSignature && mname.
isNull()) {
1326 if (buildSignature) {
1342 interfaceMsg =
"any interface"_L1;
1344 interfaceMsg =
"interface '%1'"_L1.
arg(msg.
interface());
1347 "(signature '%4')"_L1
1351 "No such interface '%1' at object path '%2'"_L1
1355 "No such object path '%1'"_L1.arg(msg.
path())));
1359bool QDBusConnectionPrivate::activateInternalFilters(
const ObjectTreeNode &node,
1363 const QString interface = msg.interface();
1390 }
else if (msg.
member() ==
"GetAll"_L1 && msg.
signature() ==
"s"_L1) {
1405void QDBusConnectionPrivate::activateObject(ObjectTreeNode &node,
const QDBusMessage &msg,
1416 if (node.treeNode->handleMessage(msg,
q(
this))) {
1419 if (activateInternalFilters(node, msg))
1424 if (pathStartPos != msg.
path().
size()) {
1442 std::as_const(connector->adaptors)) {
1443 if (activateCall(adaptorData.adaptor, newflags, msg))
1452 if (!activateCall(
it->adaptor, newflags, msg))
1461 if (activateInternalFilters(node, msg))
1467 bool interfaceFound =
true;
1469 if (!node.interfaceName.isEmpty())
1470 interfaceFound = msg.
interface() == node.interfaceName;
1475 if (interfaceFound) {
1476 if (!activateCall(node.obj, node.flags, msg))
1489void QDBusConnectionPrivate::handleObjectCall(
const QDBusMessage &msg)
1515 activateObject(
result, msg, usedLength);
1522 "Object '%1' (at path '%2')"
1523 " has no thread. Cannot deliver message."_L1
1524 .arg(
result.obj->objectName(), msg.
path())));
1540 usedLength, msg, &
sem));
1551 activateObject(
result, msg, usedLength);
1572 that->activateObject(node,
message, pathStartPos);
1586 const SignalHook &hook =
it.value();
1587 if (!hook.service.isEmpty()) {
1592 if (!hook.path.isEmpty() && hook.path != msg.
path())
1594 if (!hook.signature.isEmpty() && hook.signature != msg.
signature())
1596 if (hook.signature.isEmpty() && !hook.signature.isNull() && !msg.
signature().
isEmpty())
1598 if (!hook.argumentMatch.args.isEmpty()) {
1603 bool matched =
true;
1604 for (
int i = 0;
i < hook.argumentMatch.args.size(); ++
i) {
1616 if (!hook.argumentMatch.arg0namespace.isEmpty()) {
1625 activateSignal(hook, msg);
1629void QDBusConnectionPrivate::handleSignal(
const QDBusMessage& msg)
1644 handleSignal(
key, msg);
1647 handleSignal(
key, msg);
1651 handleSignal(
key, msg);
1654void QDBusConnectionPrivate::watchForDBusDisconnection()
1658 hook.service.clear();
1661 hook.params <<
QMetaType(QMetaType::Void);
1662 hook.midx = staticMetaObject.indexOfSlot(
"handleDBusDisconnection()");
1716 q_dbus_connection_set_exit_on_disconnect(
connection,
false);
1717 q_dbus_connection_set_watch_functions(
connection,
1722 q_dbus_connection_set_timeout_functions(
connection,
1732 watchForDBusDisconnection();
1739 QDBusConnection::ConnectionCapabilities
result;
1741 static can_send_type_t can_send_type =
nullptr;
1743#if defined(QT_LINKED_LIBDBUS)
1744# if DBUS_VERSION-0 >= 0x010400
1745 can_send_type = dbus_connection_can_send_type;
1747#elif QT_CONFIG(library)
1752#ifndef DBUS_TYPE_UNIX_FD
1753# define DBUS_TYPE_UNIX_FD int('h')
1761void QDBusConnectionPrivate::handleAuthentication()
1777 const char *service = q_dbus_bus_get_unique_name(
connection);
1781 handleAuthentication();
1783 q_dbus_connection_set_exit_on_disconnect(
connection,
false);
1800 hook.
midx = staticMetaObject.indexOfSlot(
"registerServiceNoLock(QString)");
1804 hook.
midx = staticMetaObject.indexOfSlot(
"unregisterServiceNoLock(QString)");
1813 hook.
midx = staticMetaObject.indexOfSlot(
"serviceOwnerChangedNoLock(QString,QString,QString)");
1817 watchForDBusDisconnection();
1819 qDBusDebug() <<
this <<
": connected successfully";
1839 auto locker = qt_unique_lock(call->
mutex);
1847 if (q_dbus_pending_call_get_completed(call->
pending)) {
1849 DBusMessage *
reply = q_dbus_pending_call_steal_reply(call->
pending);
1851 q_dbus_message_unref(
reply);
1879 q_dbus_pending_call_unref(call->
pending);
1909 "QDBusConnection: error: could not send message to service \"%s\" path "
1910 "\"%s\" interface \"%s\" member \"%s\": %s",
1916 "QDBusConnection: error: could not send signal to service \"%s\" path \"%s\" "
1917 "interface \"%s\" member \"%s\": %s",
1923 "QDBusConnection: error: could not send %s message to service \"%s\": %s",
1932 q_dbus_message_set_no_reply(msg,
true);
1948 : m_message(
message), m_maxCallTimeoutMs(0)
1950#if defined(QT_NO_DEBUG)
1953 Q_CONSTINIT
static int mainThreadWarningAmount = -1;
1954 Q_CONSTINIT
static int otherThreadWarningAmount = -1;
1956 Q_CONSTINIT
static int mainThreadWarningAmount = 200;
1957 Q_CONSTINIT
static int otherThreadWarningAmount = 500;
1959 Q_CONSTINIT
static bool initializedAmounts =
false;
1961 auto locker = qt_unique_lock(initializeMutex);
1963 if (!initializedAmounts) {
1968 env =
qgetenv(
"Q_DBUS_BLOCKING_CALL_MAIN_THREAD_WARNING_MS");
1972 mainThreadWarningAmount = tmp;
1976 "QDBusBlockingCallWatcher: Q_DBUS_BLOCKING_CALL_MAIN_THREAD_WARNING_MS "
1977 "must be an integer; value ignored");
1980 env =
qgetenv(
"Q_DBUS_BLOCKING_CALL_OTHER_THREAD_WARNING_MS");
1984 otherThreadWarningAmount = tmp;
1987 "QDBusBlockingCallWatcher: "
1988 "Q_DBUS_BLOCKING_CALL_OTHER_THREAD_WARNING_MS must be an integer; "
1992 initializedAmounts =
true;
2001 m_maxCallTimeoutMs = mainThreadWarningAmount;
2003 m_maxCallTimeoutMs = otherThreadWarningAmount;
2005 m_callTimer.start();
2010 if (m_maxCallTimeoutMs < 0)
2013 if (m_callTimer.elapsed() >= m_maxCallTimeoutMs) {
2016 "QDBusConnection: warning: blocking call took a long time (%d ms, max for this "
2017 "thread is %d ms) to service \"%s\" path \"%s\" interface \"%s\" member \"%s\"",
2018 int(m_callTimer.elapsed()), m_maxCallTimeoutMs,
qPrintable(m_message.service()),
2026 int m_maxCallTimeoutMs;
2069 QString interface = message.interface();
2072 return QDBusMessage::createError(QDBusError::InternalError,
2073 "Internal
error trying to call %1.%2
at %3 (signature
'%4'"_L1
2074 .arg(interface, message.member(),
2075 message.path(), message.signature()));
2078 // if the message was handled, there might be a reply
2079 QDBusMessage localReplyMsg = QDBusMessagePrivate::makeLocalReply(*this, localCallMsg);
2080 if (localReplyMsg.type() == QDBusMessage::InvalidMessage) {
2085 qPrintable(message.member()), qPrintable(message.path()),
2086 qPrintable(message.signature()));
2087 return QDBusMessage::createError(
2088 QDBusError(QDBusError::InternalError,
2089 "local-loop
message cannot have delayed replies
"_L1));
2093 qDBusDebug() << this << "got
message via local-loop:
" << localReplyMsg;
2094 return localReplyMsg;
2097QDBusPendingCallPrivate *QDBusConnectionPrivate::sendWithReplyAsync(const QDBusMessage &message,
2098 QObject *receiver, const char *returnMethod,
2099 const char *errorMethod, int timeout)
2101 QDBusPendingCallPrivate *pcall = new QDBusPendingCallPrivate(message, this);
2103 if ((isLoopback = isServiceRegisteredByThread(message.service()))) {
2104 // special case for local calls
2105 pcall->replyMessage = sendWithReplyLocal(message);
2108 if (receiver && returnMethod)
2109 pcall->setReplyCallback(receiver, returnMethod);
2112 pcall->watcherHelper = new QDBusPendingCallWatcherHelper;
2113 connect(pcall->watcherHelper, SIGNAL(error(QDBusError,QDBusMessage)), receiver, errorMethod,
2114 Qt::QueuedConnection);
2115 pcall->watcherHelper->moveToThread(thread());
2118 if ((receiver && returnMethod) || errorMethod) {
2119 // no one waiting, will delete pcall in processFinishedCall()
2120 pcall->ref.storeRelaxed(1);
2122 // set double ref to prevent race between processFinishedCall() and ref counting
2123 // by QDBusPendingCall::QExplicitlySharedDataPointer<QDBusPendingCallPrivate>
2124 pcall->ref.storeRelaxed(2);
2129 processFinishedCall(pcall);
2135 QDBusMessagePrivate::toDBusMessage(message, connectionCapabilities(), &error);
2137 qCWarning(dbusIntegration,
2139 "interface \"%s\" member \"%s\": %s",
2156 DBusPendingCall *
pending =
nullptr;
2157 DBusMessage *msg =
static_cast<DBusMessage *
>(
message);
2158 bool isNoReply = !pcall;
2159 Q_ASSERT(isNoReply == !!q_dbus_message_get_no_reply(msg));
2163 if (isNoReply && q_dbus_connection_send(
connection, msg,
nullptr)) {
2167 q_dbus_message_unref(msg);
2185 q_dbus_message_unref(msg);
2196 QObject *receiver,
const char *slot)
2199 rules.
args = argumentMatch;
2206 QObject *receiver,
const char *slot)
2213 if (!
prepareHook(hook,
key, service,
path,
interface,
name, argumentMatch, receiver, slot, 0,
2215 qCWarning(dbusIntegration) <<
"Could not connect" <<
interface << "to
" << slot + 1;
2216 return false; // don't connect
2219 Q_ASSERT(thread() != QThread::currentThread());
2220 return emit signalNeedsConnecting(key, hook);
2223bool QDBusConnectionPrivate::addSignalHook(const QString &key, const SignalHook &hook)
2225 QDBusWriteLocker locker(ConnectAction, this);
2227 // avoid duplicating:
2228 QDBusConnectionPrivate::SignalHookHash::ConstIterator it = signalHooks.constFind(key);
2229 QDBusConnectionPrivate::SignalHookHash::ConstIterator end = signalHooks.constEnd();
2230 for ( ; it != end && it.key() == key; ++it) {
2231 const QDBusConnectionPrivate::SignalHook &entry = it.value();
2232 if (entry.service == hook.service &&
2233 entry.path == hook.path &&
2234 entry.signature == hook.signature &&
2235 entry.obj == hook.obj &&
2236 entry.midx == hook.midx &&
2237 entry.argumentMatch == hook.argumentMatch) {
2238 // no need to compare the parameters if it's the same slot
2239 return false; // already there
2243 signalHooks.insert(key, hook);
2244 connect(hook.obj, &QObject::destroyed, this, &QDBusConnectionPrivate::objectDestroyed,
2245 Qt::ConnectionType(Qt::BlockingQueuedConnection | Qt::UniqueConnection));
2247 MatchRefCountHash::iterator mit = matchRefCounts.find(hook.matchRule);
2249 if (mit != matchRefCounts.end()) { // Match already present
2250 mit.value() = mit.value() + 1;
2254 matchRefCounts.insert(hook.matchRule, 1);
2257 if (mode != QDBusConnectionPrivate::PeerMode) {
2258 qDBusDebug() << this << "Adding
rule:" << hook.matchRule;
2259 q_dbus_bus_add_match(connection, hook.matchRule, nullptr);
2263 if (shouldWatchService(hook.service)) {
2264 WatchedServicesHash::mapped_type &data = watchedServices[hook.service];
2265 if (++data.refcount == 1) {
2267 ArgMatchRules rules;
2268 rules.args << hook.service;
2269 q_dbus_bus_add_match(connection,
2270 buildMatchRule(QDBusUtil::dbusService(), QString(), QDBusUtil::dbusInterface(),
2271 QDBusUtil::nameOwnerChanged(), rules, QString()),
2273 data.owner = getNameOwnerNoCache(hook.service);
2274 qDBusDebug() << this << "Watching service" << hook.service << "for owner changes (current owner:"
2275 << data.owner << ")";
2283bool QDBusConnectionPrivate::disconnectSignal(const QString &service,
2284 const QString &path, const QString &interface, const QString &name,
2285 const QStringList &argumentMatch, const QString &signature,
2286 QObject *receiver, const char *slot)
2288 ArgMatchRules rules;
2289 rules.args = argumentMatch;
2290 return disconnectSignal(service, path, interface, name, rules, signature, receiver, slot);
2293bool QDBusConnectionPrivate::disconnectSignal(const QString &service,
2294 const QString &path, const QString &interface, const QString &name,
2295 const ArgMatchRules &argumentMatch, const QString &signature,
2296 QObject *receiver, const char *slot)
2299 QDBusConnectionPrivate::SignalHook hook;
2301 QString name2 = name;
2305 hook.signature = signature;
2306 if (!prepareHook(hook, key, service, path, interface, name, argumentMatch, receiver, slot, 0,
2308 qCWarning(dbusIntegration) << "Could not disconnect" << interface << "to" << slot + 1;
2312 Q_ASSERT(thread() != QThread::currentThread());
2313 return emit signalNeedsDisconnecting(key, hook);
2316bool QDBusConnectionPrivate::removeSignalHook(const QString &key, const SignalHook &hook)
2319 QDBusWriteLocker locker(ConnectAction, this);
2320 QDBusConnectionPrivate::SignalHookHash::Iterator it = signalHooks.find(key);
2321 QDBusConnectionPrivate::SignalHookHash::Iterator end = signalHooks.end();
2322 for ( ; it != end && it.key() == key; ++it) {
2323 const QDBusConnectionPrivate::SignalHook &entry = it.value();
2324 if (entry.service == hook.service &&
2325 entry.path == hook.path &&
2326 entry.signature == hook.signature &&
2327 entry.obj == hook.obj &&
2328 entry.midx == hook.midx &&
2329 entry.argumentMatch.args == hook.argumentMatch.args) {
2331 removeSignalHookNoLock(it);
2340QDBusConnectionPrivate::SignalHookHash::Iterator
2341QDBusConnectionPrivate::removeSignalHookNoLock(SignalHookHash::Iterator it)
2343 const SignalHook &hook = it.value();
2346 MatchRefCountHash::iterator i = matchRefCounts.find(hook.matchRule);
2347 if (i == matchRefCounts.end()) {
2348 qCWarning(dbusIntegration,
2349 "QDBusConnectionPrivate::disconnectSignal: MatchRule not found in "
2350 "matchRefCounts!!");
2352 if (i.value() == 1) {
2354 matchRefCounts.erase(i);
2357 i.value() = i.value() - 1;
2362 if (connection && erase) {
2363 if (mode != QDBusConnectionPrivate::PeerMode) {
2364 qDBusDebug() << this << "Removing rule:" << hook.matchRule;
2365 q_dbus_bus_remove_match(connection, hook.matchRule, nullptr);
2369 WatchedServicesHash::Iterator sit = watchedServices.find(hook.service);
2370 if (sit != watchedServices.end()) {
2371 if (--sit.value().refcount == 0) {
2372 watchedServices.erase(sit);
2373 ArgMatchRules rules;
2374 rules.args << hook.service;
2375 q_dbus_bus_remove_match(connection,
2376 buildMatchRule(QDBusUtil::dbusService(), QString(), QDBusUtil::dbusInterface(),
2377 QDBusUtil::nameOwnerChanged(), rules, QString()),
2385 return signalHooks.erase(it);
2388void QDBusConnectionPrivate::registerObject(const ObjectTreeNode *node)
2390 connect(node->obj, &QObject::destroyed, this, &QDBusConnectionPrivate::objectDestroyed,
2391 Qt::ConnectionType(Qt::BlockingQueuedConnection | Qt::UniqueConnection));
2393 if (node->flags & (QDBusConnection::ExportAdaptors
2394 | QDBusConnection::ExportScriptableSignals
2395 | QDBusConnection::ExportNonScriptableSignals)) {
2396 QDBusAdaptorConnector *connector = qDBusCreateAdaptorConnector(node->obj);
2398 if (node->flags & (QDBusConnection::ExportScriptableSignals
2399 | QDBusConnection::ExportNonScriptableSignals)) {
2400 connector->disconnectAllSignals(node->obj);
2401 connector->connectAllSignals(node->obj);
2404 connect(connector, &QDBusAdaptorConnector::relaySignal, this,
2405 &QDBusConnectionPrivate::relaySignal,
2406 Qt::ConnectionType(Qt::QueuedConnection | Qt::UniqueConnection));
2410void QDBusConnectionPrivate::unregisterObject(const QString &path, QDBusConnection::UnregisterMode mode)
2412 QDBusConnectionPrivate::ObjectTreeNode *node = &rootNode;
2413 QList<QStringView> pathComponents;
2415 if (path == "/"_L1) {
2418 pathComponents = QStringView{path}.split(u'/');
2422 huntAndUnregister(pathComponents, i, mode, node);
2425void QDBusConnectionPrivate::connectRelay(const QString &service,
2426 const QString &path, const QString &interface,
2427 QDBusAbstractInterface *receiver,
2428 const QMetaMethod &signal)
2436 sig.append(QSIGNAL_CODE + '0');
2437 sig.append(signal.methodSignature());
2438 if (!prepareHook(hook, key, service, path, interface, QString(), ArgMatchRules(), receiver, sig,
2439 QDBusAbstractInterface::staticMetaObject.methodCount(), true)) {
2440 qCWarning(dbusIntegration) << "Could not connect" << interface << "to" << signal.name();
2444 Q_ASSERT(thread() != QThread::currentThread());
2445 emit signalNeedsConnecting(key, hook);
2448void QDBusConnectionPrivate::disconnectRelay(const QString &service,
2449 const QString &path, const QString &interface,
2450 QDBusAbstractInterface *receiver,
2451 const QMetaMethod &signal)
2459 sig.append(QSIGNAL_CODE + '0');
2460 sig.append(signal.methodSignature());
2461 if (!prepareHook(hook, key, service, path, interface, QString(), ArgMatchRules(), receiver, sig,
2462 QDBusAbstractInterface::staticMetaObject.methodCount(), true)) {
2463 qCWarning(dbusIntegration)
2464 << "Could not disconnect" << interface << "to" << signal.methodSignature();
2468 Q_ASSERT(thread() != QThread::currentThread());
2469 emit signalNeedsDisconnecting(key, hook);
2472bool QDBusConnectionPrivate::shouldWatchService(const QString &service)
2475 if (mode != ClientMode)
2478 if (service.isEmpty())
2481 if (service == QDBusUtil::dbusService())
2495void QDBusConnectionPrivate::watchService(const QString &service, QDBusServiceWatcher::WatchMode mode, QObject *obj, const char *member)
2497 ArgMatchRules matchArgs = matchArgsForService(service, mode);
2498 connectSignal(QDBusUtil::dbusService(), QString(), QDBusUtil::dbusInterface(), QDBusUtil::nameOwnerChanged(),
2499 matchArgs, QString(), obj, member);
2510void QDBusConnectionPrivate::unwatchService(const QString &service, QDBusServiceWatcher::WatchMode mode, QObject *obj, const char *member)
2512 ArgMatchRules matchArgs = matchArgsForService(service, mode);
2513 disconnectSignal(QDBusUtil::dbusService(), QString(), QDBusUtil::dbusInterface(), QDBusUtil::nameOwnerChanged(),
2514 matchArgs, QString(), obj, member);
2517QString QDBusConnectionPrivate::getNameOwner(const QString& serviceName)
2519 if (QDBusUtil::isValidUniqueConnectionName(serviceName))
2526 QReadLocker locker(&lock);
2527 WatchedServicesHash::ConstIterator it = watchedServices.constFind(serviceName);
2528 if (it != watchedServices.constEnd())
2533 return getNameOwnerNoCache(serviceName);
2536QString QDBusConnectionPrivate::getNameOwnerNoCache(const QString &serviceName)
2538 QDBusMessage msg = QDBusMessage::createMethodCall(QDBusUtil::dbusService(),
2539 QDBusUtil::dbusPath(), QDBusUtil::dbusInterface(),
2540 QStringLiteral("GetNameOwner"));
2541 QDBusMessagePrivate::setParametersValidated(msg, true);
2544 QDBusPendingCallPrivate *pcall = sendWithReplyAsync(msg, nullptr, nullptr, nullptr);
2545 if (thread() == QThread::currentThread()) {
2548 q_dbus_pending_call_block(pcall->pending);
2550 pcall->waitForFinished();
2551 msg = pcall->replyMessage;
2553 if (!pcall->ref.deref())
2556 if (msg.type() == QDBusMessage::ReplyMessage)
2557 return msg.arguments().at(0).toString();
2562QDBusConnectionPrivate::findMetaObject(const QString &service, const QString &path,
2563 const QString &interface, QDBusError &error)
2566 if (!interface.isEmpty()) {
2567 QDBusReadLocker locker(FindMetaObject1Action, this);
2568 QDBusMetaObject *mo = cachedMetaObjects.value(interface, nullptr);
2572 if (path.isEmpty()) {
2573 error = QDBusError(QDBusError::InvalidObjectPath, "Object path cannot be empty"_L1);
2579 QDBusMessage msg = QDBusMessage::createMethodCall(service, path,
2580 QDBusUtil::dbusInterfaceIntrospectable(),
2581 QStringLiteral("Introspect"));
2582 QDBusMessagePrivate::setParametersValidated(msg, true);
2584 QDBusMessage reply = sendWithReply(msg, QDBus::Block);
2587 QDBusWriteLocker locker(FindMetaObject2Action, this);
2588 QDBusMetaObject *mo = nullptr;
2589 if (!interface.isEmpty())
2590 mo = cachedMetaObjects.value(interface, nullptr);
2596 if (reply.type() == QDBusMessage::ReplyMessage) {
2597 if (reply.signature() == "s"_L1)
2599 xml = reply.arguments().at(0).toString();
2601 error = QDBusError(reply);
2603 if (reply.type() != QDBusMessage::ErrorMessage || error.type() != QDBusError::UnknownMethod)
2608 QDBusMetaObject *result = QDBusMetaObject::createMetaObject(interface, xml,
2609 cachedMetaObjects, error);
2614void QDBusConnectionPrivate::registerService(const QString &serviceName)
2616 QDBusWriteLocker locker(RegisterServiceAction, this);
2617 registerServiceNoLock(serviceName);
2620void QDBusConnectionPrivate::registerServiceNoLock(const QString &serviceName)
2622 serviceNames.append(serviceName);
2625void QDBusConnectionPrivate::unregisterService(const QString &serviceName)
2627 QDBusWriteLocker locker(UnregisterServiceAction, this);
2628 unregisterServiceNoLock(serviceName);
2631void QDBusConnectionPrivate::unregisterServiceNoLock(const QString &serviceName)
2633 serviceNames.removeAll(serviceName);
2636bool QDBusConnectionPrivate::isServiceRegisteredByThread(const QString &serviceName)
2638 if (!serviceName.isEmpty() && serviceName == baseService)
2640 if (serviceName == QDBusUtil::dbusService())
2643 QDBusReadLocker locker(UnregisterServiceAction, this);
2644 return serviceNames.contains(serviceName);
2647void QDBusConnectionPrivate::postEventToThread(int action, QObject *object, QEvent *ev)
2649 QDBusLockerBase::reportThreadAction(action, QDBusLockerBase::BeforePost, this);
2650 QCoreApplication::postEvent(object, ev);
2651 QDBusLockerBase::reportThreadAction(action, QDBusLockerBase::AfterPost, this);
2659void QDBusConnectionPrivate::enableDispatchDelayed(QObject *context)
2662 QMetaObject::invokeMethod(
2668 QMetaObject::invokeMethod(
2669 this, [this] { setDispatchEnabled(true); }, Qt::QueuedConnection);
2673 Qt::QueuedConnection);
Connects to the accessibility dbus.
void storeRelaxed(T newValue) noexcept
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
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.
qsizetype indexOf(char c, qsizetype from=0) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void truncate(qsizetype pos)
Truncates the byte array at index position pos.
bool startsWith(QByteArrayView bv) const
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()
void setConnection(const QString &name, QDBusConnectionPrivate *c)
QDBusConnectionPrivate(QObject *parent=nullptr)
static QDBusConnectionPrivate * d(const QDBusConnection &q)
void setDispatchEnabled(bool enable)
void objectDestroyed(QObject *o)
void socketWrite(qintptr)
bool signalNeedsDisconnecting(const QString &key, const QDBusConnectionPrivate::SignalHook &hook)
PendingMessageList pendingMessages
friend class QDBusCallDeliveryEvent
void setPeer(DBusConnection *connection, const QDBusErrorInternal &error)
WatchedServicesHash watchedServices
void setConnection(DBusConnection *connection, const QDBusErrorInternal &error)
bool anonymousAuthenticationAllowed
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)
MatchRefCountHash matchRefCounts
QStringList serverConnectionNames
bool signalNeedsConnecting(const QString &key, const QDBusConnectionPrivate::SignalHook &hook)
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
~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)
bool addSignalHook(const QString &key, const SignalHook &hook)
MetaObjectHash cachedMetaObjects
bool removeSignalHook(const QString &key, const SignalHook &hook)
void newServerConnection(QDBusConnectionPrivate *newConnection)
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 error(const QDBusError &error, const QDBusMessage &msg)
void emitSignals(const QDBusMessage &replyMessage, const QDBusMessage &sentMessage)
void reply(const QDBusMessage &msg)
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, const Hook *hooks, int hookCount)
void(* Hook)(const QDBusMessage &)
int exec(ProcessEventsFlags flags=AllEvents)
Enters the main event loop and waits until exit() is called.
void quit()
Tells the event loop to exit normally.
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 ...
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
qsizetype size() const noexcept
const_pointer constData() 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
qsizetype removeIf(Predicate pred)
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.
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
QString objectName
the name of this object
QThread * thread() const
Returns the thread in which the object lives.
bool isNull() const
Returns true if the referenced object has been destroyed or if there is no referenced object; otherwi...
iterator insert(const T &value)
void activated(QSocketDescriptor socket, QSocketNotifier::Type activationEvent, QPrivateSignal)
\macro QT_RESTRICTED_CAST_FROM_ASCII
QByteArray toLatin1() const &
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...
void clear()
Clears the contents of the string and makes it null.
bool isNull() const
Returns true if this string is null; otherwise returns false.
qsizetype size() const
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
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
int compare(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString static QString qsizetype indexOf(QChar c, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QByteArray toUtf8() const &
static QThread * currentThread()
constexpr size_type size() const noexcept
void reserve(qsizetype sz)
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.
@ BlockingQueuedConnection
#define Q_BASIC_ATOMIC_INITIALIZER(a)
void(*)() 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 * rule
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)
QVarLengthArray< QDBusSpyCallEvent::Hook, 4 > QDBusSpyHookList
@ HandleObjectCallPostEventAction
@ MessageResultReceivedAction
@ HandleObjectCallSemaphoreAction
#define SEM_ACQUIRE(action, sem)
static QT_BEGIN_NAMESPACE QDirectFBEGLHooks * hooks
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
#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]
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLuint GLsizei const GLchar * message
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
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 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]
ArgMatchRules argumentMatch
QList< QMetaType > params
static void reportThreadAction(int, int, QDBusConnectionPrivate *)
QList< QMetaType > metaTypes