[telepathy-qt4/master] FileTransferChannel: Added protected method to access AvailableSocketTypes property.
Andre Moreira Magalhaes (andrunko)
andre.magalhaes at collabora.co.uk
Tue Sep 22 20:03:26 PDT 2009
---
TelepathyQt4/file-transfer-channel.cpp | 26 ++++++++++++++++++++++++++
TelepathyQt4/file-transfer-channel.h | 2 ++
2 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/TelepathyQt4/file-transfer-channel.cpp b/TelepathyQt4/file-transfer-channel.cpp
index 5c74c2f..bcbe972 100644
--- a/TelepathyQt4/file-transfer-channel.cpp
+++ b/TelepathyQt4/file-transfer-channel.cpp
@@ -62,6 +62,7 @@ struct FileTransferChannel::Private
qulonglong initialOffset;
qulonglong size;
qulonglong transferredBytes;
+ SupportedSocketMap availableSocketTypes;
bool connected;
bool finished;
@@ -140,6 +141,7 @@ void FileTransferChannel::Private::extractProperties(const QVariantMap &props)
initialOffset = qdbus_cast<qulonglong>(props["InitialOffset"]);
size = qdbus_cast<qulonglong>(props["Size"]);
transferredBytes = qdbus_cast<qulonglong>(props["TransferredBytes"]);
+ availableSocketTypes = qdbus_cast<SupportedSocketMap>(props["AvailableSocketTypes"]);
}
/**
@@ -411,6 +413,30 @@ qulonglong FileTransferChannel::transferredBytes() const
}
/**
+ * Return a mapping from address types (members of SocketAddressType) to arrays
+ * of access-control type (members of SocketAccessControl) that the connection
+ * manager supports for sockets with that address type. For simplicity, if a CM
+ * supports offering a particular type of file transfer, it is assumed to
+ * support accepting it. All connection Managers support at least
+ * SocketAddressTypeIPv4.
+ *
+ * This method requires FileTransferChannel::FeatureCore to be enabled.
+ *
+ * \return A mapping from address types to arrays of access-control type.
+ * \sa transferredBytesChanged()
+ */
+SupportedSocketMap FileTransferChannel::availableSocketTypes() const
+{
+ if (!isReady(FeatureCore)) {
+ warning() << "FileTransferChannel::FeatureCore must be ready before "
+ "calling availableSocketTypes";
+ }
+
+ return mPriv->availableSocketTypes;
+}
+
+
+/**
* Cancel a file transfer.
*
* \return A PendingOperation object which will emit PendingOperation::finished
diff --git a/TelepathyQt4/file-transfer-channel.h b/TelepathyQt4/file-transfer-channel.h
index 9a502e0..0cc36f7 100644
--- a/TelepathyQt4/file-transfer-channel.h
+++ b/TelepathyQt4/file-transfer-channel.h
@@ -74,6 +74,8 @@ protected:
FileTransferChannel(const ConnectionPtr &connection, const QString &objectPath,
const QVariantMap &immutableProperties);
+ SupportedSocketMap availableSocketTypes() const;
+
virtual void connectToHost();
bool isConnected() const;
void setConnected();
--
1.5.6.5
More information about the telepathy-commits
mailing list