153 if (
name.isEmpty()) {
339 const char *returnMethod,
const char *errorMethod,
370 const char *returnMethod,
int timeout)
const
484 QObject *receiver,
const char *slot)
514 QObject *receiver,
const char *slot)
517 if (!receiver || !slot || !d || !d->
connection)
523 qWarning(
"QDBusConnection::connect: interface name '%s' is not valid",
interface.toLatin1().constData());
529 qWarning(
"QDBusConnection::connect: service name '%s' is not valid", service.toLatin1().constData());
535 qWarning(
"QDBusConnection::connect: object path '%s' is not valid",
path.toLatin1().constData());
568 QObject *receiver,
const char *slot)
586 QObject *receiver,
const char *slot)
588 if (!receiver || !slot || !d || !d->
connection)
641 "Invalid object path given");
646 if (pathComponents.constLast().isEmpty())
647 pathComponents.removeLast();
654 if (pathComponents.size() ==
i) {
670 node->
flags = options;
709 Q_ASSERT_X(
false,
"QDBusConnection::registerObject",
"The impossible happened");
750 "Invalid object path given");
755 if (pathComponents.constLast().isEmpty())
756 pathComponents.removeLast();
764 if (pathComponents.size() ==
i)
974 char *dbus_machine_id = q_dbus_get_local_machine_id();
976 q_dbus_free(dbus_machine_id);
1015#include "moc_qdbusconnection_p.cpp"
1016#include "moc_qdbusconnection.cpp"
void callWithCallbackFailed(const QDBusError &error, const QDBusMessage &call)
This signal is emitted when there is an error during a QDBusConnection::callWithCallback().
static QDBusConnectionManager * instance()
void unregisterService(const QString &serviceName)
void registerObject(const ObjectTreeNode *node)
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 unregisterObject(const QString &path, QDBusConnection::UnregisterMode mode)
QDBusConnection::ConnectionCapabilities connectionCapabilities() const
bool send(const QDBusMessage &message)
QDBusConnectionInterface * busService
bool disconnectSignal(const QString &service, const QString &path, const QString &interface, const QString &name, const QStringList &argumentMatch, const QString &signature, QObject *receiver, const char *slot)
void registerService(const QString &serviceName)
DBusConnection * connection
void callWithCallbackFailed(const QDBusError &error, const QDBusMessage &message)
bool send(const QDBusMessage &message) const
Sends the message over this connection, without waiting for a reply.
static QDBusConnection systemBus()
Returns a QDBusConnection object opened with the system bus.
bool disconnect(const QString &service, const QString &path, const QString &interface, const QString &name, QObject *receiver, const char *slot)
Disconnects the signal specified by the service, path, interface and name parameters from the slot sl...
void * internalPointer() const
bool registerVirtualObject(const QString &path, QDBusVirtualObject *object, VirtualObjectRegisterOption options=SingleNode)
static QByteArray localMachineId()
static QDBusConnection connectToPeer(const QString &address, const QString &name)
QDBusConnection(const QString &name)
Creates a QDBusConnection object attached to the connection with name name.
bool callWithCallback(const QDBusMessage &message, QObject *receiver, const char *returnMethod, const char *errorMethod, int timeout=-1) const
Sends the message over this connection and returns immediately.
BusType
Specifies the type of the bus connection.
QDBusConnectionInterface * interface() const
Returns a QDBusConnectionInterface object that represents the D-Bus server interface on this connecti...
bool unregisterService(const QString &serviceName)
Unregisters the service serviceName that was previously registered with registerService() and returns...
VirtualObjectRegisterOption
bool isConnected() const
Returns true if this QDBusConnection object is connected.
static QDBusConnection connectToBus(BusType type, const QString &name)
Opens a connection of type type to one of the known buses and associate with it the connection name n...
ConnectionCapabilities connectionCapabilities() const
QDBusMessage call(const QDBusMessage &message, QDBus::CallMode mode=QDBus::Block, int timeout=-1) const
Sends the message over this connection and blocks, waiting for a reply, for at most timeout milliseco...
bool connect(const QString &service, const QString &path, const QString &interface, const QString &name, QObject *receiver, const char *slot)
Connects the signal specified by the service, path, interface and name parameters to the slot slot in...
static QDBusConnection sessionBus()
Returns a QDBusConnection object opened with the session bus.
static void disconnectFromPeer(const QString &name)
static void disconnectFromBus(const QString &name)
Closes the bus connection of name name.
~QDBusConnection()
Disposes of this object.
UnregisterMode
The mode for unregistering an object path:
bool registerService(const QString &serviceName)
Attempts to register the serviceName on the D-Bus server and returns true if the registration succeed...
QObject * objectRegisteredAt(const QString &path) const
Return the object that was registered with the registerObject() at the object path given by path.
void unregisterObject(const QString &path, UnregisterMode mode=UnregisterNode)
Unregisters an object that was registered with the registerObject() at the object path given by path ...
QString baseService() const
Returns the unique connection name for this connection, if this QDBusConnection object is connected,...
QDBusPendingCall asyncCall(const QDBusMessage &message, int timeout=-1) const
bool registerObject(const QString &path, QObject *object, RegisterOptions options=ExportAdaptors)
Registers the object object at path path and returns true if the registration was successful.
QDBusError lastError() const
Returns the last error that happened in this connection.
QDBusConnection & operator=(QDBusConnection &&other) noexcept
static QDBusMessage createError(const QString &name, const QString &msg)
Constructs a new DBus message representing an error, with the given name and msg.
bool isEmpty() const noexcept
iterator insert(qsizetype i, parameter_type t)
const_iterator constBegin() const noexcept
const_iterator constEnd() const noexcept
const_iterator ConstIterator
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void deleteLater()
\threadsafe
Q_CORE_EXPORT QList< QStringView > split(QStringView sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the view into substring views wherever sep occurs, and returns the list of those string views.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QSet< QString >::iterator it
bool isValidInterfaceName(const QString &ifaceName)
Returns true if this is ifaceName is a valid interface name.
bool isValidBusName(const QString &busName)
Returns true if busName is a valid bus name.
bool isValidObjectPath(const QString &path)
Returns true if path is valid object path.
QString disconnectedErrorMessage()
CallMode
This enum describes the various ways of placing a function call.
Combined button and popup list for selecting options.
QList< QString > QStringList
Constructs a string list that contains the given string, str.
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
@ ObjectRegisteredAtAction
GLbitfield GLuint64 timeout
[4]
GLuint GLsizei const GLchar * message
GLuint GLuint64EXT address
GLsizei const GLchar *const * path
#define Q_ASSERT_X(cond, x, msg)
myObject disconnect()
[26]
QNetworkAccessManager manager
QDBusConnection::RegisterOptions flags