[Telepathy-commits] [telepathy-salut/master] Added Direction property to file channel.

Jonny Lamb jonny.lamb at collabora.co.uk
Fri Nov 21 03:46:01 PST 2008


20080718121832-8ed0e-649e33e87af52de9064631b7fe73952d7955e8fd.gz
---
 src/salut-file-channel.c |   17 +++++++++++++++++
 src/salut-ft-manager.c   |    1 +
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/salut-file-channel.c b/src/salut-file-channel.c
index 6fba0eb..47ccbd2 100644
--- a/src/salut-file-channel.c
+++ b/src/salut-file-channel.c
@@ -262,6 +262,9 @@ salut_file_channel_set_property (GObject *object,
         self->priv->state = g_value_get_uint (value);
         break;
       case PROP_DIRECTION:
+        /* TODO: the new request API will remove the need for this property */
+        self->priv->direction = g_value_get_uint (value);
+        break;
       case PROP_CONTENT_TYPE:
         /* This should not be writeable with the new request API */
         self->priv->content_type = g_value_dup_string (value);
@@ -355,6 +358,7 @@ salut_file_channel_class_init (SalutFileChannelClass *salut_file_channel_class)
   };
 
   static TpDBusPropertiesMixinPropImpl file_props[] = {
+    { "Direction", "direction", NULL },
     { "State", "state", "state" },
     { "ContentType", "content-type", NULL },
     { "Filename", "filename", NULL },
@@ -434,6 +438,19 @@ salut_file_channel_class_init (SalutFileChannelClass *salut_file_channel_class)
       param_spec);
 
   param_spec = g_param_spec_uint (
+      "direction",
+      "SalutFileTransferDirection direction",
+      "Direction of the file transfer",
+      0,
+      G_MAXUINT,
+      0,
+      G_PARAM_CONSTRUCT_ONLY |
+      G_PARAM_READWRITE |
+      G_PARAM_STATIC_NICK |
+      G_PARAM_STATIC_BLURB);
+  g_object_class_install_property (object_class, PROP_DIRECTION, param_spec);
+
+  param_spec = g_param_spec_uint (
       "state",
       "SalutFileTransferState state",
       "State of the file transfer in this channel",
diff --git a/src/salut-ft-manager.c b/src/salut-ft-manager.c
index 0cd35cd..4cef010 100644
--- a/src/salut-ft-manager.c
+++ b/src/salut-ft-manager.c
@@ -297,6 +297,7 @@ salut_ft_manager_new_channel (SalutFtManager *mgr,
                        "object-path", path,
                        "handle", handle,
                        "xmpp-connection-manager", priv->xmpp_connection_manager,
+                       "direction", SALUT_FILE_TRANSFER_DIRECTION_OUTGOING,
                        NULL);
   g_object_unref (contact);
   g_free (path);
-- 
1.5.6.5




More information about the Telepathy-commits mailing list