summaryrefslogtreecommitdiffstats
path: root/tools/qdbus/qdbusviewer/qdbusmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/qdbus/qdbusviewer/qdbusmodel.cpp')
-rw-r--r--tools/qdbus/qdbusviewer/qdbusmodel.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/qdbus/qdbusviewer/qdbusmodel.cpp b/tools/qdbus/qdbusviewer/qdbusmodel.cpp
index befe4b4..f85e288 100644
--- a/tools/qdbus/qdbusviewer/qdbusmodel.cpp
+++ b/tools/qdbus/qdbusviewer/qdbusmodel.cpp
@@ -75,6 +75,7 @@ struct QDBusItem
bool isPrefetched;
QString name;
QString caption;
+ QString typeSignature;
};
QDomDocument QDBusModel::introspect(const QString &path)
@@ -118,6 +119,13 @@ void QDBusModel::addMethods(QDBusItem *parent, const QDomElement &iface)
item = new QDBusItem(QDBusModel::MethodItem,
child.attribute(QLatin1String("name")), parent);
item->caption = QLatin1String("Method: ") + item->name;
+ //get "type" from <arg> where "direction" is "in"
+ QDomElement n = child.firstChildElement();
+ while (!n.isNull()) {
+ if (n.attribute(QLatin1String("direction")) == QLatin1String("in"))
+ item->typeSignature += n.attribute(QLatin1String("type"));
+ n = n.nextSiblingElement();
+ }
} else if (child.tagName() == QLatin1String("signal")) {
item = new QDBusItem(QDBusModel::SignalItem,
child.attribute(QLatin1String("name")), parent);
@@ -298,6 +306,12 @@ QString QDBusModel::dBusMethodName(const QModelIndex &index) const
return item ? item->name : QString();
}
+QString QDBusModel::dBusTypeSignature(const QModelIndex &index) const
+{
+ QDBusItem *item = static_cast<QDBusItem *>(index.internalPointer());
+ return item ? item->typeSignature : QString();
+}
+
QModelIndex QDBusModel::findObject(const QDBusObjectPath &objectPath)
{
QStringList path = objectPath.path().split(QLatin1Char('/'), QString::SkipEmptyParts);