telepathy-qt: dbus-tubes: Handle property names correctly
Dario Freddi
drf at kemper.freedesktop.org
Tue Jul 3 15:08:41 PDT 2012
Module: telepathy-qt
Branch: master
Commit: 5b39773fc284fb9eafaa05f1cc99c474e3e2826d
URL: http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=5b39773fc284fb9eafaa05f1cc99c474e3e2826d
Author: Dario Freddi <dario.freddi at collabora.co.uk>
Date: Thu Jun 16 14:35:09 2011 +0200
dbus-tubes: Handle property names correctly
---
TelepathyQt/dbus-tube-channel.cpp | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/TelepathyQt/dbus-tube-channel.cpp b/TelepathyQt/dbus-tube-channel.cpp
index b2b3f97..dc95b5e 100644
--- a/TelepathyQt/dbus-tube-channel.cpp
+++ b/TelepathyQt/dbus-tube-channel.cpp
@@ -95,8 +95,8 @@ DBusTubeChannel::Private::~Private()
void DBusTubeChannel::Private::extractProperties(const QVariantMap &props)
{
- serviceName = qdbus_cast<QString>(props[QLatin1String("Service")]);
- accessControls = qdbus_cast<UIntList>(props[QLatin1String("SupportedAccessControls")]);
+ serviceName = qdbus_cast<QString>(props[TP_QT_IFACE_CHANNEL_TYPE_DBUS_TUBE + QLatin1String(".ServiceName")]);
+ accessControls = qdbus_cast<UIntList>(props[TP_QT_IFACE_CHANNEL_TYPE_DBUS_TUBE + QLatin1String(".SupportedAccessControls")]);
}
void DBusTubeChannel::Private::extractParticipants(const Tp::DBusTubeParticipants &participants)
@@ -140,8 +140,8 @@ void DBusTubeChannel::Private::introspectDBusTube(DBusTubeChannel::Private *self
debug() << "Introspect dbus tube properties";
- if (parent->immutableProperties().contains(QLatin1String("Service")) &&
- parent->immutableProperties().contains(QLatin1String("SupportedAccessControls"))) {
+ if (parent->immutableProperties().contains(TP_QT_IFACE_CHANNEL_TYPE_DBUS_TUBE + QLatin1String(".ServiceName")) &&
+ parent->immutableProperties().contains(TP_QT_IFACE_CHANNEL_TYPE_DBUS_TUBE + QLatin1String(".SupportedAccessControls"))) {
self->extractProperties(parent->immutableProperties());
self->readinessHelper->setIntrospectCompleted(DBusTubeChannel::FeatureDBusTube, true);
} else {
@@ -341,7 +341,16 @@ void DBusTubeChannel::onRequestAllPropertiesFinished(PendingOperation *op)
if (!op->isError()) {
debug() << "RequestAllProperties succeeded";
PendingVariantMap *result = qobject_cast<PendingVariantMap*>(op);
- mPriv->extractProperties(result->result());
+
+ QVariantMap map = result->result();
+ QVariantMap qualifiedMap;
+
+ for (QVariantMap::const_iterator i = map.constBegin(); i != map.constEnd(); ++i) {
+ qualifiedMap.insert(TP_QT_IFACE_CHANNEL_TYPE_DBUS_TUBE + QLatin1Char('.') + i.key(),
+ i.value());
+ }
+
+ mPriv->extractProperties(qualifiedMap);
mPriv->readinessHelper->setIntrospectCompleted(DBusTubeChannel::FeatureDBusTube, true);
} else {
warning().nospace() << "RequestAllProperties failed "
More information about the telepathy-commits
mailing list