summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusconnection_p.h
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@nokia.com>2011-05-22 19:36:10 (GMT)
committerFrederik Gladhorn <frederik.gladhorn@nokia.com>2011-07-04 11:44:14 (GMT)
commitb07919b3de8cff3e44b7271062372b14bcda5b83 (patch)
treefb6e9c5ebbade0756b85819b59eb3efcf0ee242d /src/dbus/qdbusconnection_p.h
parentcee1f6454a7b52a52795590e2f793c0cd4e15ce1 (diff)
downloadQt-b07919b3de8cff3e44b7271062372b14bcda5b83.zip
Qt-b07919b3de8cff3e44b7271062372b14bcda5b83.tar.gz
Qt-b07919b3de8cff3e44b7271062372b14bcda5b83.tar.bz2
Add DBus VirtualObject to handle multiple paths.
When a virtual object is registered with the SubPath option it will handle all dbus calls to itself and all child paths. It needs to reimplement handleMessage for that purpose. Introspection needs to be implemented manually in the introspect function. Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
Diffstat (limited to 'src/dbus/qdbusconnection_p.h')
-rw-r--r--src/dbus/qdbusconnection_p.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h
index 12bcb21..d481cf1 100644
--- a/src/dbus/qdbusconnection_p.h
+++ b/src/dbus/qdbusconnection_p.h
@@ -129,6 +129,11 @@ public:
QByteArray matchRule;
};
+ enum TreeNodeType {
+ Object = 0x0,
+ VirtualObject = 0x01000000
+ };
+
struct ObjectTreeNode
{
typedef QVector<ObjectTreeNode> DataList;
@@ -143,8 +148,12 @@ public:
{ return QStringRef(&name) < other; }
QString name;
- QObject* obj;
+ union {
+ QObject *obj;
+ QDBusVirtualObject *treeNode;
+ };
int flags;
+
DataList children;
};
@@ -333,7 +342,7 @@ extern bool qDBusInterfaceInObject(QObject *obj, const QString &interface_name);
extern QString qDBusInterfaceFromMetaObject(const QMetaObject *mo);
// in qdbusinternalfilters.cpp
-extern QString qDBusIntrospectObject(const QDBusConnectionPrivate::ObjectTreeNode &node);
+extern QString qDBusIntrospectObject(const QDBusConnectionPrivate::ObjectTreeNode &node, const QString &path);
extern QDBusMessage qDBusPropertyGet(const QDBusConnectionPrivate::ObjectTreeNode &node,
const QDBusMessage &msg);
extern QDBusMessage qDBusPropertySet(const QDBusConnectionPrivate::ObjectTreeNode &node,