74 #define qDBusDebug if (!::isDebugging); else qDebug 78 static inline QString dbusServiceString()
79 {
return *orgFreedesktopDBusString(); }
84 return *orgFreedesktopDBusString();
89 dbg.
nospace() <<
"QThread(ptr=" << (
void*)th;
96 #if QDBUS_THREAD_DEBUG 99 dbg.
nospace() <<
"QDBusConnection(" 100 <<
"ptr=" << (
void*)conn
101 <<
", name=" << conn->
name 105 dbg.
nospace() <<
"same thread";
115 <<
"QtDBus threading action" << action
129 <<
"in connection" << conn;
152 if (!q_dbus_timeout_get_enabled(timeout))
195 if (pit->first == timeout)
205 if (it.
value() == timeout) {
243 int flags = q_dbus_watch_get_flags(watch);
244 int fd = q_dbus_watch_get_fd(watch);
264 if (flags & DBUS_WATCH_READABLE) {
266 watcher.
watch = watch;
273 if (flags & DBUS_WATCH_WRITABLE) {
275 watcher.
watch = watch;
295 int fd = q_dbus_watch_get_fd(watch);
300 if (i.value().watch == watch) {
303 delete i.
value().read;
304 delete i.value().write;
308 i->read->deleteLater();
310 i->write->deleteLater();
326 int fd = q_dbus_watch_get_fd(watch);
345 if (i.value().watch == watch) {
346 bool enabled = q_dbus_watch_get_enabled(watch);
347 int flags = q_dbus_watch_get_flags(watch);
351 if (flags & DBUS_WATCH_READABLE && i.value().read)
352 i.value().read->setEnabled(enabled);
353 if (flags & DBUS_WATCH_WRITABLE && i.value().write)
354 i.value().write->setEnabled(enabled);
375 if (new_status == DBUS_DISPATCH_DATA_REMAINS)
388 q_dbus_connection_ref(connection);
398 newConnection->
setPeer(connection, error);
427 for (
int i = 0; i < argMatch.
count(); ++i)
429 result += keyValue.
arg(i).
arg(argMatch.
at(i));
437 const QString &fullpath,
int &usedLength,
446 int length = fullpath.
length();
452 while (start < length && node) {
458 end = (end == -1 ? length :
end);
459 QStringRef pathComponent(&fullpath, start, end - start);
473 usedLength = (start > length ? length : start);
486 const QString &fullpath,
int start)
488 int length = fullpath.
length();
501 pos = (pos == -1 ? length : pos);
502 QStringRef pathComponent(&fullpath, start, pos - start);
510 for ( ; it !=
end; ++
it)
511 if ((*it)->objectName() == pathComponent) {
536 qDBusSpyHookList()->append(hook);
540 static DBusHandlerResult
547 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
550 qDBusDebug() << d <<
"got message (signal):" << amsg;
553 DBUS_HANDLER_RESULT_HANDLED :
554 DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
560 const QDBusSpyHookList *list = qDBusSpyHookList();
561 for (
int i = 0; i < list->
size(); ++i) {
562 qDBusDebug() <<
"calling the message spy hook";
569 switch (amsg.
type()) {
591 for ( ; it !=
end; ++
it)
594 if (needle == haystack.
obj) {
602 bool isScriptable,
bool isAdaptor,
const QString &path =
QString())
606 for ( ; it !=
end; ++
it)
609 if (needle == haystack.
obj) {
613 else if (!isAdaptor) {
614 int mask = isScriptable
617 if ((haystack.
flags & mask) == 0)
625 DBusMessage *msg2 = q_dbus_message_copy(msg);
626 q_dbus_message_set_path(msg2, p);
627 q_dbus_connection_send(connection, msg2, 0);
628 q_dbus_message_unref(msg2);
650 int paren = slotname.
indexOf(
'(');
663 if (inputCount == -1)
666 metaTypes[0] = returnType;
667 bool hasMessage =
false;
668 if (inputCount > 0 &&
678 for (i = 1; i <= inputCount; ++i) {
683 reconstructedSignature += typeSignature;
684 if (!msgSignature.
startsWith(reconstructedSignature))
688 if (reconstructedSignature != msgSignature)
699 for (
int j = i; ok && j < metaTypes.
count(); ++j)
706 if (isAsync && metaTypes.
count() > i + 1)
739 int n = metaTypes.
count() - 1;
747 for (
int i = 0; i < n; ++i)
754 if (target ==
object)
770 if (call == DIRECT_DELIVERY) {
802 static const char cachePropertyName[] =
"_qdbus_slotCache";
807 #ifndef QT_NO_PROPERTIES 809 "QDBusConnection: internal threading error",
810 "function called for an object that is in another thread!!");
815 if (!signature.isEmpty()) {
816 cacheKey.
reserve(cacheKey.length() + 1 + signature.length());
818 cacheKey += signature;
822 while (cacheIt != slotCache.hash.constEnd() && cacheIt->flags != flags &&
823 cacheIt.key() == cacheKey)
825 if (cacheIt == slotCache.hash.constEnd() || cacheIt.key() != cacheKey)
833 slotData.
flags = flags;
845 slotCache.hash.insert(cacheKey, slotData);
852 slotCache.hash.insert(cacheKey, slotData);
858 }
else if (cacheIt->slotIdx == -1) {
863 deliverCall(
object, flags, msg, cacheIt->metaTypes, cacheIt->slotIdx);
866 #endif // QT_NO_PROPERTIES 874 "QDBusConnection: internal threading error",
875 "function called for an object that is in another thread!!");
889 for (i = 1; i <= pCount; ++i) {
890 int id = metaTypes[i];
897 params.append(const_cast<void *>(arg.
constData()));
898 else if (arg.
userType() == qMetaTypeId<QDBusArgument>()) {
908 qFatal(
"Internal error: demarshalling function for type '%s' (%d) failed!",
911 params.append(const_cast<void *>(out.
constData()));
913 qFatal(
"Internal error: got invalid meta type %d (%s) " 914 "when trying to convert to meta type %d (%s)",
921 params.append(const_cast<void*>(static_cast<const void*>(&msg)));
931 params[0] =
const_cast<void*
>(outputArgs.
at( outputArgs.
count() - 1 ).constData());
933 for ( ; i < metaTypes.count(); ++i) {
936 params.append(const_cast<void*>(outputArgs.
at( outputArgs.
count() - 1 ).constData()));
951 slotIdx, params.data()) >= 0;
963 qDBusDebug() <<
this <<
"Automatically sending reply:" << outputArgs;
967 qWarning(
"Internal error: Failed to deliver message");
983 static const bool threads = q_dbus_threads_init_default();
984 static const int debugging =
qgetenv(
"QDBUS_DEBUG").
toInt();
989 #ifdef QDBUS_THREAD_DEBUG 991 qdbusThreadDebug = qdbusDefaultThreadDebug;
1004 matchRefCounts.
insert(
"type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.freedesktop.DBus'", 1);
1010 qWarning(
"QDBusConnection(name=\"%s\")'s last reference in not in its creation thread! " 1011 "Timer and socket errors will follow and the program will probably crash",
1019 q_dbus_server_unref(
server);
1021 q_dbus_connection_unref(connection);
1049 q_dbus_server_disconnect(
server);
1053 q_dbus_connection_close(connection);
1055 while (q_dbus_connection_dispatch(connection) == DBUS_DISPATCH_DATA_REMAINS)
1067 qWarning(
"The thread that had QDBusConnection('%s') has died and there is no main thread",
1089 q_dbus_timeout_handle(timeout);
1102 switch (ev->subtype)
1133 while (q_dbus_connection_dispatch(connection) == DBUS_DISPATCH_DATA_REMAINS) ;
1144 if (it->watch && it->read && it->read->isEnabled())
1145 pendingWatches.
append(it.value().watch);
1150 for (
int i = 0; i < pendingWatches.
size(); ++i)
1151 if (!q_dbus_watch_handle(pendingWatches[i], DBUS_WATCH_READABLE))
1164 if (it->watch && it->write && it->write->isEnabled())
1165 pendingWatches.
append(it.value().watch);
1170 for (
int i = 0; i < pendingWatches.
size(); ++i)
1171 if (!q_dbus_watch_handle(pendingWatches[i], DBUS_WATCH_WRITABLE))
1182 if (static_cast<QObject *>(sit.value().obj) == obj)
1194 QString interface = qDBusInterfaceFromMetaObject(mo);
1202 bool isAdaptor =
false;
1225 q_dbus_message_set_no_reply(msg,
true);
1227 q_dbus_message_unref(msg);
1238 if (oldOwner != it->owner)
1239 qWarning(
"QDBusConnection: name '%s' had owner '%s' but we thought it was '%s'",
1242 qDBusDebug() <<
this <<
"Updating name" << name <<
"from" << oldOwner <<
"to" << newOwner;
1243 it->owner = newOwner;
1254 if ( inputCount == -1 || inputCount + 1 != params.
count() )
1264 QObject *receiver,
const char *signal,
int minMIdx,
1265 bool buildSignature)
1269 if (hook.
midx == -1) {
1273 if (hook.
midx < minMIdx) {
1274 if (hook.
midx == -1)
1281 hook.
obj = receiver;
1288 if (buildSignature && mname.
isNull()) {
1297 if (buildSignature) {
1335 const QString interface = msg.interface();
1337 if (interface.isEmpty() ||
interface == QLatin1String(DBUS_INTERFACE_INTROSPECTABLE)) {
1345 if (!interface.isEmpty()) {
1351 if (node.
obj && (interface.isEmpty() ||
1352 interface == QLatin1String(DBUS_INTERFACE_PROPERTIES))) {
1368 if (!interface.isEmpty()) {
1418 for ( ; it !=
end; ++
it)
1442 bool interfaceFound =
true;
1446 if (interfaceFound) {
1494 " has no thread. Cannot deliver message.")
1510 usedLength, msg, &sem));
1554 for ( ; it != end && it.key() ==
key; ++
it) {
1575 bool matched =
true;
1630 dbus_bool_t data_allocated = q_dbus_server_allocate_data_slot(&server_slot);
1631 if (data_allocated && server_slot < 0)
1634 dbus_bool_t watch_functions_set = q_dbus_server_set_watch_functions(
server,
1642 dbus_bool_t time_functions_set = q_dbus_server_set_timeout_functions(
server,
1652 dbus_bool_t data_set = q_dbus_server_set_data(
server, server_slot,
this, 0);
1667 q_dbus_connection_set_exit_on_disconnect(connection,
false);
1668 q_dbus_connection_set_watch_functions(connection,
1673 q_dbus_connection_set_timeout_functions(connection,
1679 q_dbus_connection_add_filter(connection,
1688 QDBusConnection::ConnectionCapabilities result = 0;
1689 typedef dbus_bool_t (*can_send_type_t)(DBusConnection *, int);
1690 static can_send_type_t can_send_type = 0;
1692 #if defined(QT_LINKED_LIBDBUS) 1693 # if DBUS_VERSION-0 >= 0x010400 1694 can_send_type = dbus_connection_can_send_type;
1701 #ifndef DBUS_TYPE_UNIX_FD 1702 # define DBUS_TYPE_UNIX_FD int('h') 1720 const char *service = q_dbus_bus_get_unique_name(connection);
1725 q_dbus_connection_set_exit_on_disconnect(connection,
false);
1737 hook.
service = dbusServiceString();
1750 qDBusDebug() <<
this <<
": connected successfully";
1780 q_dbus_pending_call_block(pcall->
pending);
1786 q_dbus_pending_call_unref(pcall->
pending);
1803 DBusMessage *reply = q_dbus_pending_call_steal_reply(call->
pending);
1805 q_dbus_message_unref(reply);
1807 qDBusDebug() << connection <<
"got message reply (async):" << msg;
1830 q_dbus_pending_call_unref(call->
pending);
1857 qWarning(
"QDBusConnection: error: could not send message to service \"%s\" path \"%s\" interface \"%s\" member \"%s\": %s",
1862 qWarning(
"QDBusConnection: error: could not send signal path \"%s\" interface \"%s\" member \"%s\": %s",
1867 qWarning(
"QDBusConnection: error: could not send %s message to service \"%s\": %s",
1876 q_dbus_message_set_no_reply(msg,
true);
1878 qDBusDebug() <<
this <<
"sending message (no reply):" << message;
1880 bool isOk = q_dbus_connection_send(connection, msg, 0);
1883 serial = q_dbus_message_get_serial(msg);
1885 q_dbus_message_unref(msg);
1890 int sendMode,
int timeout)
1902 qWarning(
"QDBusConnection: error: could not send message to service \"%s\" path \"%s\" interface \"%s\" member \"%s\": %s",
1910 qDBusDebug() <<
this <<
"sending message (blocking):" << message;
1912 DBusMessage *reply = q_dbus_connection_send_with_reply_and_block(connection, msg, timeout, error);
1914 q_dbus_message_unref(msg);
1922 q_dbus_message_unref(reply);
1923 qDBusDebug() <<
this <<
"got message reply (blocking):" << amsg;
1954 qDBusDebug() <<
this <<
"sending message via local-loop:" << message;
1960 QString interface = message.interface();
1961 if (interface.isEmpty())
1965 .arg(interface, message.
member(),
1972 qWarning(
"QDBusConnection: cannot call local method '%s' at object %s (with signature '%s') " 1977 QLatin1String(
"local-loop message cannot have delayed replies")));
1981 qDBusDebug() <<
this <<
"got message via local-loop:" << localReplyMsg;
1982 return localReplyMsg;
1986 QObject *receiver,
const char *returnMethod,
1987 const char *errorMethod,
int timeout)
1993 if (receiver && returnMethod)
2003 if ((receiver && returnMethod) || errorMethod) {
2017 if (receiver && returnMethod)
2027 if ((receiver && returnMethod) || errorMethod) {
2039 qWarning(
"QDBusConnection: error: could not send message to service \"%s\" path \"%s\" interface \"%s\" member \"%s\": %s",
2049 qDBusDebug() <<
this <<
"sending message (async):" << message;
2050 DBusPendingCall *pending = 0;
2053 if (q_dbus_connection_send_with_reply(connection, msg, &pending, timeout)) {
2055 q_dbus_message_unref(msg);
2069 q_dbus_message_unref(msg);
2078 QObject *receiver,
const char *slot)
2088 if (!
prepareHook(hook, key, service, path, interface, name, argumentMatch, receiver, slot, 0,
false))
2094 for ( ; it != end && it.key() ==
key; ++
it) {
2120 it.value() = it.value() + 1;
2129 q_dbus_bus_add_match(connection, hook.
matchRule, NULL);
2135 if (++data.refcount == 1) {
2141 qDBusDebug() <<
this <<
"Watching service" << hook.
service <<
"for owner changes (current owner:" 2142 << data.owner <<
")";
2152 QObject *receiver,
const char *slot)
2162 if (!
prepareHook(hook, key, service, path, interface, name, argumentMatch, receiver, slot, 0,
false))
2168 for ( ; it != end && it.key() ==
key; ++
it) {
2194 qWarning(
"QDBusConnectionPrivate::disconnectSignal: MatchRule not found in matchRefCounts!!");
2196 if (i.value() == 1) {
2201 i.value() = i.value() - 1;
2206 if (connection && erase) {
2209 q_dbus_bus_remove_match(connection, hook.
matchRule, NULL);
2215 if (--sit.value().refcount == 0) {
2232 QMutableVectorIterator<QDBusConnectionPrivate::ObjectTreeNode>
it(parent.
children);
2233 while (it.hasNext()) {
2266 static int counter = 0;
2267 if ((++counter % 20) == 0)
2289 for ( ; it != end && it.key() ==
key; ++
it) {
2320 for ( ; it != end && it.key() ==
key; ++
it) {
2333 qWarning(
"QDBusConnectionPrivate::disconnectRelay called for a signal that was not found");
2455 #endif // QT_NO_DBUS static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QVariant class acts like a union for the most common Qt data types.
Q_DBUS_EXPORT void qDBusAddSpyHook(QDBusSpyHook)
QVarLengthArray< QDBusSpyHook, 4 > QDBusSpyHookList
int startTimer(int interval)
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer...
The QDebug class provides an output stream for debugging information.
QStringList argumentMatch
static QDBusMessage createError(const QString &name, const QString &msg)
Constructs a new DBus message representing an error, with the given name and msg. ...
void handleObjectCall(const QDBusMessage &message)
SignalHookHash signalHooks
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
void callWithCallbackFailed(const QDBusError &error, const QDBusMessage &message)
void setServer(DBusServer *server, const QDBusErrorInternal &error)
static dbus_int32_t server_slot
void truncate(int pos)
Truncates the byte array at index position pos.
void activateObject(ObjectTreeNode &node, const QDBusMessage &msg, int pathStartPos)
QStringList serverConnectionNames
void checkReceivedSignature()
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
static bool isLocal(const QDBusMessage &msg)
#define QT_END_NAMESPACE
This macro expands to.
void lock()
Locks the mutex.
~QDBusConnectionPrivate()
The QSemaphore class provides a general counting semaphore.
QDBusAdaptorConnector * qDBusFindAdaptorConnector(QObject *obj)
The QMutex class provides access serialization between threads.
static bool findObject(const QDBusConnectionPrivate::ObjectTreeNode *root, const QString &fullpath, int &usedLength, QDBusConnectionPrivate::ObjectTreeNode &result)
static QByteArray buildMatchRule(const QString &service, const QString &objectPath, const QString &interface, const QString &member, const QStringList &argMatch, const QString &)
QHash< Key, T >::const_iterator constFind(const Key &key, const T &value) const
Returns an iterator pointing to the item with the key and the value in the hash.
const QChar at(int i) const
Returns the character at the given index position in the string.
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...
QDBusMessage replyMessage
static void qDBusNewConnection(DBusServer *server, DBusConnection *connection, void *data)
#define it(className, varName)
void placeMetaCall(QObject *)
bool isNull() const
Returns true if the referenced object has been destroyed or if there is no referenced object; otherwi...
static void huntAndEmit(DBusConnection *connection, DBusMessage *msg, QObject *needle, const QDBusConnectionPrivate::ObjectTreeNode &haystack, bool isScriptable, bool isAdaptor, const QString &path=QString())
The QDBusArgument class is used to marshall and demarshall D-Bus arguments.
QDBusAdaptorConnector * qDBusCreateAdaptorConnector(QObject *obj)
static void postEvent(QObject *receiver, QEvent *event)
Adds the event event, with the object receiver as the receiver of the event, to an event queue and re...
QDebug & nospace()
Clears the stream's internal flag that records whether the last character was a space and returns a r...
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
void serviceOwnerChangedNoLock(const QString &name, const QString &oldOwner, const QString &newOwner)
QString objectName
the name of this object
bool handleError(const QDBusErrorInternal &error)
static QDBusConnectionPrivate * d(const QDBusConnection &q)
The QByteArray class provides an array of bytes.
void chop(int n)
Removes n characters from the end of the string.
int length() const
Returns the number of characters in this string.
QString service() const
Returns the name of the service or the bus address of the remote method call.
#define DBUS_TYPE_UNIX_FD
const_iterator ConstIterator
Qt-style synonym for QHash::const_iterator.
bool setReplyCallback(QObject *target, const char *member)
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the vector...
void unlock()
Unlocks this mutex locker.
The QDBusError class represents an error received from the D-Bus bus or from remote applications foun...
void disconnectAllSignals(QObject *object)
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
void registerServiceNoLock(const QString &serviceName)
static const QMetaObject staticMetaObject
This variable stores the meta-object for the class.
WatchedServiceData mapped_type
Typedef for T.
static dbus_bool_t qDBusAddWatch(DBusWatch *watch, void *data)
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
void * qdbus_resolve_conditionally(const char *name)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
static QDBusConnection q(QDBusConnectionPrivate *connection)
QDBusVirtualObject * treeNode
virtual bool handleMessage(const QDBusMessage &message, const QDBusConnection &connection)=0
This function needs to handle all messages to the path of the virtual object, when the SubPath option...
int count(const T &t) const
Returns the number of occurrences of value in the list.
void deliverCall(QObject *object, int flags, const QDBusMessage &msg, const QList< int > &metaTypes, int slotIdx)
void handleSignal(const QString &key, const QDBusMessage &msg)
T & value() const
Returns a modifiable reference to the current item's value.
MatchRefCountHash matchRefCounts
The QString class provides a Unicode character string.
QMutex watchAndTimeoutLock
static void processFinishedCall(QDBusPendingCallPrivate *call)
The QObject class is the base class of all Qt objects.
static int findSlot(QObject *obj, const QByteArray &normalizedName, QList< int > ¶ms)
void relaySignal(QObject *obj, const QMetaObject *, int signalId, const QVariantList &args)
bool startsWith(const QByteArray &a) const
Returns true if this byte array starts with byte array ba; otherwise returns false.
static void setSender(const QDBusConnectionPrivate *s)
DBusConnection * connection
MetaObjectHash cachedMetaObjects
QHash< Key, T >::iterator find(const Key &key, const T &value)
Returns an iterator pointing to the item with the key and value.
static QDBusCallDeliveryEvent *const DIRECT_DELIVERY
iterator Iterator
Qt-style synonym for QVector::iterator.
const T value(const Key &key) const
Returns the value associated with the key.
bool qDBusCheckAsyncTag(const char *tag)
void connectAllSignals(QObject *object)
int qDBusParametersForMethod(const QMetaMethod &mm, QList< int > &metaTypes)
ErrorType
In order to facilitate verification of the most common D-Bus errors generated by the D-Bus implementa...
ErrorType type() const
Returns this error's ErrorType.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
The QSocketNotifier class provides support for monitoring activity on a file descriptor.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the vector...
static QDBusMessage fromDBusMessage(DBusMessage *dmsg, QDBusConnection::ConnectionCapabilities capabilities)
Constructs a QDBusMessage by parsing the given DBusMessage object.
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...
static bool prepareHook(QDBusConnectionPrivate::SignalHook &hook, QString &key, const QString &service, const QString &path, const QString &interface, const QString &name, const QStringList &argMatch, QObject *receiver, const char *signal, int minMIdx, bool buildSignature)
Q_CORE_EXPORT void qDebug(const char *,...)
static QDBusConnectionManager * instance()
static void qDBusResultReceived(DBusPendingCall *pending, void *user_data)
QString signature() const
Returns the signature of the signal that was received or for the output arguments of a method call...
void reserve(int size)
Attempts to allocate memory for at least size characters.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the vector.
static void setParametersValidated(QDBusMessage &msg, bool enable)
bool activateCall(QObject *object, int flags, const QDBusMessage &msg)
static QThread * currentThread()
Returns a pointer to a QThread which manages the currently executing thread.
void append(const T &t)
Inserts value at the end of the list.
The QDBusAbstractInterface class is the base class for all D-Bus interfaces in the QtDBus binding...
#define QT_BEGIN_NAMESPACE
This macro expands to.
QList< QVariant > arguments() const
Returns the list of arguments that are going to be sent or were received from D-Bus.
static QDBusMessage makeLocal(const QDBusConnectionPrivate &conn, const QDBusMessage &asSent)
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...
void destroyed(QObject *=0)
This signal is emitted immediately before the object obj is destroyed, and can not be blocked...
QDBusMetaObject * findMetaObject(const QString &service, const QString &path, const QString &interface, QDBusError &error)
The QEventLoop class provides a means of entering and leaving an event loop.
void truncate(int pos)
Truncates the string at the given position index.
static void qDBusRemoveTimeout(DBusTimeout *timeout, void *data)
void clear()
Removes all the elements from the vector and releases the memory used by the vector.
T takeFirst()
Removes the first item in the list and returns it.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QDBusMessage sendWithReply(const QDBusMessage &message, int mode, int timeout=-1)
void disconnectRelay(const QString &service, const QString &path, const QString &interface, QDBusAbstractInterface *receiver, const char *signal)
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the list...
const QDBusMessage sentMessage
void activateSignal(const SignalHook &hook, const QDBusMessage &msg)
QPointer< QObject > receiver
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
const T & at(int i) const
Returns the item at index position i in the list.
void unregisterServiceNoLock(const QString &serviceName)
bool deref()
Atomically decrements the value of this QAtomicInt.
bool isReplyRequired() const
Returns the flag that indicates if this message should see a reply or not.
The QStringList class provides a list of strings.
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)
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
SignalHookHash::Iterator disconnectSignal(SignalHookHash::Iterator &it)
Q_CORE_EXPORT void qWarning(const char *,...)
static DBusMessage * toDBusMessage(const QDBusMessage &message, QDBusConnection::ConnectionCapabilities capabilities, QDBusError *error)
Constructs a DBusMessage object from message.
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
void connectRelay(const QString &service, const QString &path, const QString &interface, QDBusAbstractInterface *receiver, const char *signal)
static const char * data(const QByteArray &arr)
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
const_iterator constFind(const Key &key) const
Returns an iterator pointing to the item with the key in the hash.
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
void moveToThread(QThread *thread)
Changes the thread affinity for this object and its children.
void setConnection(const QString &name, QDBusConnectionPrivate *c)
const T * ptr(const T &t)
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
void emitSignals(const QDBusMessage &replyMessage, const QDBusMessage &sentMessage)
void clear()
Removes all items from the list.
void waitForFinished(QDBusPendingCallPrivate *pcall)
QString member() const
Returns the name of the signal that was emitted or the name of the method that was called...
const Key & key() const
Returns the current item's key as a const reference.
The QReadLocker class is a convenience class that simplifies locking and unlocking read-write locks f...
static void qDBusToggleTimeout(DBusTimeout *timeout, void *data)
QDBusConnection::ConnectionCapabilities capabilities
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
QDBusPendingCallPrivate * sendWithReplyAsync(const QDBusMessage &message, QObject *receiver, const char *returnMethod, const char *errorMethod, int timeout=-1)
bool isDelayedReply() const
Returns the delayed reply flag, as set by setDelayedReply().
const char * typeName() const
Returns the name of the type stored in the variant.
friend class QDBusCallDeliveryEvent
int indexOf(char c, int from=0) const
Returns the index position of the first occurrence of the character ch in the byte array...
void unregisterService(const QString &serviceName)
void unlock()
Unlocks the mutex.
QDBusMessage qDBusPropertyGet(const QDBusConnectionPrivate::ObjectTreeNode &node, const QDBusMessage &msg)
static QDBusCallDeliveryEvent * prepareReply(QDBusConnectionPrivate *target, QObject *object, int idx, const QList< int > &metaTypes, const QDBusMessage &msg)
The QStringRef class provides a thin wrapper around QString substrings.
PendingTimeoutList timeoutsPendingAdd
bool isValidUniqueConnectionName(const QString &connName)
Returns true if connName is a valid unique connection name.
bool wait(QMutex *mutex, unsigned long time=ULONG_MAX)
Q_GLOBAL_STATIC_WITH_ARGS(const QString, orgFreedesktopDBusString,(QLatin1String(DBUS_SERVICE_DBUS))) static inline QString dbusServiceString()
QDBusMessage createReply(const QList< QVariant > &arguments=QList< QVariant >()) const
Constructs a new DBus message representing a reply, with the given arguments.
int length() const
Same as size().
const char * constData() const
Returns a pointer to the data stored in the byte array.
QHash< Key, T >::iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
bool isNull() const
Returns true if this string is null; otherwise returns false.
QString interface() const
Returns the interface of the method being called (in the case of a method call) or of the signal bein...
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
void objectDestroyed(QObject *o)
int qDBusNameToTypeId(const char *name)
QDBusMessage qDBusPropertySet(const QDBusConnectionPrivate::ObjectTreeNode &node, const QDBusMessage &msg)
Q_OUTOFLINE_TEMPLATE RandomAccessIterator qLowerBound(RandomAccessIterator begin, RandomAccessIterator end, const T &value)
static QString dbusInterfaceString()
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the hash...
QDBusMessage qDBusPropertyGetAll(const QDBusConnectionPrivate::ObjectTreeNode &node, const QDBusMessage &msg)
static QAuServer & server()
Q_CORE_EXPORT void qFatal(const char *,...)
static void qDBusUpdateDispatchStatus(DBusConnection *connection, DBusDispatchStatus new_status, void *data)
#define Q_ASSERT_X(cond, where, what)
iterator erase(iterator pos)
Removes the item associated with the iterator pos from the list, and returns an iterator to the next ...
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
int userType() const
Returns the storage type of the value stored in the variant.
bool handleMessage(const QDBusMessage &msg)
#define SEM_ACQUIRE(action, sem)
int compare(const QString &s) const
static bool qDBusRealAddTimeout(QDBusConnectionPrivate *d, DBusTimeout *timeout, int ms)
void timerEvent(QTimerEvent *e)
This event handler can be reimplemented in a subclass to receive timer events for the object...
bool isServiceRegisteredByThread(const QString &serviceName) const
void registerObject(const ObjectTreeNode *node)
QString getNameOwnerNoCache(const QString &service)
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
The QTimerEvent class contains parameters that describe a timer event.
iterator begin()
Returns an STL-style iterator pointing to the first item in the vector.
static bool shouldWatchService(const QString &service)
static QCoreApplication * instance()
Returns a pointer to the application's QCoreApplication (or QApplication) instance.
void clear()
Clears the contents of the string and makes it empty.
The QDBusConnection class represents a connection to the D-Bus bus daemon.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
QDBusPendingCallWatcherHelper * watcherHelper
static QDBusMessage createMethodCall(const QString &destination, const QString &path, const QString &interface, const QString &method)
Constructs a new DBus message representing a method call.
bool qDBusInterfaceInObject(QObject *obj, const QString &interface_name)
int toInt(bool *ok=0, int base=10) const
Returns the byte array converted to an int using base base, which is 10 by default and must be betwee...
QObject * parent() const
Returns a pointer to the parent object.
Q_OUTOFLINE_TEMPLATE QPair< T1, T2 > qMakePair(const T1 &x, const T2 &y)
WatchedServicesHash watchedServices
const void * constData() const
const_iterator ConstIterator
Qt-style synonym for QList::const_iterator.
void setPeer(DBusConnection *connection, const QDBusErrorInternal &error)
QDBusMessage sendWithReplyLocal(const QDBusMessage &message)
QString qDBusIntrospectObject(const QDBusConnectionPrivate::ObjectTreeNode &node, const QString &path)
The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash.
int size() const
Returns the number of items in the list.
static bool qDBusRealAddWatch(QDBusConnectionPrivate *d, DBusWatch *watch, int flags, int fd)
void setEnabled(bool)
If enable is true, the notifier is enabled; otherwise the notifier is disabled.
void sendError(const QDBusMessage &msg, QDBusError::ErrorType code)
QString objectName() const
static void qDBusRealToggleWatch(QDBusConnectionPrivate *d, DBusWatch *watch, int fd)
if(void) toggleToolbarShown
#define Q_AUTOTEST_EXPORT
iterator begin()
Returns an STL-style iterator pointing to the first item in the hash.
const QObjectList & children() const
Returns a list of child objects.
QDBusConnectionPrivate *const connection
enum QDBusConnectionCallbackEvent::Subtype subtype
DBusPendingCall * pending
T qvariant_cast(const QVariant &)
static QDBusContextPrivate * set(QObject *obj, QDBusContextPrivate *newContext)
volatile bool waitingForFinished
static void qDBusToggleWatch(DBusWatch *watch, void *data)
The QDBusMessage class represents one message sent or received over the D-Bus bus.
MessageType type() const
Returns the message type.
static QByteArray memberName(const QMetaMethod &member)
void setArguments(const QList< QVariant > &arguments)
Sets the arguments that are going to be sent over D-Bus to arguments.
static QDBusConnection::ConnectionCapabilities connectionCapabilies(DBusConnection *connection)
static void qDBusRemoveWatch(DBusWatch *watch, void *data)
const_iterator ConstIterator
Qt-style synonym for QVector::const_iterator.
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
bool isEmpty() const
Returns true if the vector has size 0; otherwise returns false.
static QDBusMessage makeLocalReply(const QDBusConnectionPrivate &conn, const QDBusMessage &asSent)
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
QThread * thread() const
Returns the thread in which the object lives.
QDBusConnectionInterface * busService
iterator insertMulti(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
QWaitCondition waitForFinishedCondition
static void cleanupDeletedNodes(QDBusConnectionPrivate::ObjectTreeNode &parent)
~QDBusActivateObjectEvent()
static dbus_bool_t qDBusAddTimeout(DBusTimeout *timeout, void *data)
bool activateInternalFilters(const ObjectTreeNode &node, const QDBusMessage &msg)
static const KeyPair *const end
static void huntAndDestroy(QObject *needle, QDBusConnectionPrivate::ObjectTreeNode &haystack)
QDebug & space()
Writes a space character to the debug stream and returns a reference to the stream.
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
#define qPrintable(string)
The QThread class provides a platform-independent way to manage threads.
void registerService(const QString &serviceName)
QDataStream & operator<<(QDataStream &out, const QUrl &url)
Writes url url to the stream out and returns a reference to the stream.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
QList< Key > keys() const
Returns a list containing all the keys in the hash, in an arbitrary order.
void deleteLater()
Schedules this object for deletion.
static void reportThreadAction(int, int, QDBusConnectionPrivate *)
iterator erase(iterator it)
Removes the (key, value) pair associated with the iterator pos from the hash, and returns an iterator...
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QString getNameOwner(const QString &service)
void setConnection(DBusConnection *connection, const QDBusErrorInternal &error)
int exec(ProcessEventsFlags flags=AllEvents)
Enters the main event loop and waits until exit() is called.
static DBusHandlerResult qDBusSignalFilter(DBusConnection *connection, DBusMessage *message, void *data)
void(* QDBusSpyHook)(const QDBusMessage &)
iterator Iterator
Qt-style synonym for QHash::iterator.
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
friend class const_iterator
void serverConnection(const QDBusConnection &connection)
QDBusConnectionPrivate(QObject *parent=0)
void postEventToThread(int action, QObject *target, QEvent *event)
void customEvent(QEvent *e)
This event handler can be reimplemented in a subclass to receive custom events.
static QObject * findChildObject(const QDBusConnectionPrivate::ObjectTreeNode *root, const QString &fullpath, int start)
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
void killTimer(int id)
Kills the timer with timer identifier, id.
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
int send(const QDBusMessage &message)
QString message() const
Returns the message that the callee associated with this error.