summaryrefslogtreecommitdiffstats
path: root/tools/qdbus/qdbusviewer/qdbusmodel.cpp
diff options
context:
space:
mode:
authorKimmo Kotajärvi <kimmo.kotajarvi@nomovok.com>2010-03-11 12:44:21 (GMT)
committerHarald Fernengel <harald.fernengel@nokia.com>2010-03-11 12:44:21 (GMT)
commit54c7d51c54e4387a070f5f565d01693d078a6d13 (patch)
tree45121891b15989306c1baec3925e73d66da0922e /tools/qdbus/qdbusviewer/qdbusmodel.cpp
parent18b31adab8ea288edc84c190dcad2c8552d1e206 (diff)
downloadQt-54c7d51c54e4387a070f5f565d01693d078a6d13.zip
Qt-54c7d51c54e4387a070f5f565d01693d078a6d13.tar.gz
Qt-54c7d51c54e4387a070f5f565d01693d078a6d13.tar.bz2
Changed Qdbusviewer to match D-Bus type signature in addition to method name when finding a method.
Merge-request: 435 Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
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);