telepathy-qt: dbus-tubes: Add DBusTubeChannel to RequestableChannelClassSpec
Dario Freddi
drf at kemper.freedesktop.org
Tue Jul 3 15:08:39 PDT 2012
Module: telepathy-qt
Branch: master
Commit: 29be2a2f7b7571ece1b2a9cdea3804e9d11745ed
URL: http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=29be2a2f7b7571ece1b2a9cdea3804e9d11745ed
Author: Dario Freddi <dario.freddi at collabora.co.uk>
Date: Fri Jun 3 23:35:07 2011 +0200
dbus-tubes: Add DBusTubeChannel to RequestableChannelClassSpec
---
TelepathyQt/requestable-channel-class-spec.cpp | 23 +++++++++++++++++++++++
TelepathyQt/requestable-channel-class-spec.h | 1 +
2 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/TelepathyQt/requestable-channel-class-spec.cpp b/TelepathyQt/requestable-channel-class-spec.cpp
index a9e46bc..0b6c519 100644
--- a/TelepathyQt/requestable-channel-class-spec.cpp
+++ b/TelepathyQt/requestable-channel-class-spec.cpp
@@ -432,6 +432,29 @@ RequestableChannelClassSpec RequestableChannelClassSpec::contactSearchWithSpecif
return spec;
}
+RequestableChannelClassSpec RequestableChannelClassSpec::dbusTube(const QString &serviceName)
+{
+ static RequestableChannelClassSpec spec;
+
+ if (!spec.isValid()) {
+ RequestableChannelClass rcc;
+ rcc.fixedProperties.insert(TP_QT_IFACE_CHANNEL + QLatin1String(".ChannelType"),
+ TP_QT_IFACE_CHANNEL_TYPE_STREAM_TUBE);
+ rcc.fixedProperties.insert(TP_QT_IFACE_CHANNEL + QLatin1String(".TargetHandleType"),
+ (uint) HandleTypeContact);
+ spec = RequestableChannelClassSpec(rcc);
+ }
+
+ if (serviceName.isEmpty()) {
+ return spec;
+ }
+
+ RequestableChannelClass rcc = spec.bareClass();
+ rcc.fixedProperties.insert(TP_QT_IFACE_CHANNEL_TYPE_DBUS_TUBE + QLatin1String(".ServiceName"),
+ serviceName);
+ return RequestableChannelClassSpec(rcc);
+}
+
RequestableChannelClassSpec RequestableChannelClassSpec::streamTube(const QString &service)
{
static RequestableChannelClassSpec spec;
diff --git a/TelepathyQt/requestable-channel-class-spec.h b/TelepathyQt/requestable-channel-class-spec.h
index f49fce1..8a6f154 100644
--- a/TelepathyQt/requestable-channel-class-spec.h
+++ b/TelepathyQt/requestable-channel-class-spec.h
@@ -68,6 +68,7 @@ public:
static RequestableChannelClassSpec contactSearchWithLimit();
static RequestableChannelClassSpec contactSearchWithSpecificServerAndLimit();
+ static RequestableChannelClassSpec dbusTube(const QString &serviceName = QString());
static RequestableChannelClassSpec streamTube(const QString &service = QString());
bool isValid() const { return mPriv.constData() != 0; }
More information about the telepathy-commits
mailing list