116 QDBusItem *item = 0; |
117 QDBusItem *item = 0; |
117 if (child.tagName() == QLatin1String("method")) { |
118 if (child.tagName() == QLatin1String("method")) { |
118 item = new QDBusItem(QDBusModel::MethodItem, |
119 item = new QDBusItem(QDBusModel::MethodItem, |
119 child.attribute(QLatin1String("name")), parent); |
120 child.attribute(QLatin1String("name")), parent); |
120 item->caption = QLatin1String("Method: ") + item->name; |
121 item->caption = QLatin1String("Method: ") + item->name; |
|
122 //get "type" from <arg> where "direction" is "in" |
|
123 QDomElement n = child.firstChildElement(); |
|
124 while (!n.isNull()) { |
|
125 if (n.attribute(QLatin1String("direction")) == QLatin1String("in")) |
|
126 item->typeSignature += n.attribute(QLatin1String("type")); |
|
127 n = n.nextSiblingElement(); |
|
128 } |
121 } else if (child.tagName() == QLatin1String("signal")) { |
129 } else if (child.tagName() == QLatin1String("signal")) { |
122 item = new QDBusItem(QDBusModel::SignalItem, |
130 item = new QDBusItem(QDBusModel::SignalItem, |
123 child.attribute(QLatin1String("name")), parent); |
131 child.attribute(QLatin1String("name")), parent); |
124 item->caption = QLatin1String("Signal: ") + item->name; |
132 item->caption = QLatin1String("Signal: ") + item->name; |
125 } else if (child.tagName() == QLatin1String("property")) { |
133 } else if (child.tagName() == QLatin1String("property")) { |
296 { |
304 { |
297 QDBusItem *item = static_cast<QDBusItem *>(index.internalPointer()); |
305 QDBusItem *item = static_cast<QDBusItem *>(index.internalPointer()); |
298 return item ? item->name : QString(); |
306 return item ? item->name : QString(); |
299 } |
307 } |
300 |
308 |
|
309 QString QDBusModel::dBusTypeSignature(const QModelIndex &index) const |
|
310 { |
|
311 QDBusItem *item = static_cast<QDBusItem *>(index.internalPointer()); |
|
312 return item ? item->typeSignature : QString(); |
|
313 } |
|
314 |
301 QModelIndex QDBusModel::findObject(const QDBusObjectPath &objectPath) |
315 QModelIndex QDBusModel::findObject(const QDBusObjectPath &objectPath) |
302 { |
316 { |
303 QStringList path = objectPath.path().split(QLatin1Char('/'), QString::SkipEmptyParts); |
317 QStringList path = objectPath.path().split(QLatin1Char('/'), QString::SkipEmptyParts); |
304 |
318 |
305 QDBusItem *item = root; |
319 QDBusItem *item = root; |