[Telepathy-commits] [telepathy-salut/master] Added SocketPath D-BUS property.

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


20080721192524-8ed0e-a7f160a0a688e1c1ab670fb7b275224a7c22eec2.gz
---
 extensions/Channel_Type_File.xml |    8 ++++++++
 src/salut-file-channel.c         |   22 +++++++++++++++++++++-
 2 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/extensions/Channel_Type_File.xml b/extensions/Channel_Type_File.xml
index ffdabb3..7d4df28 100644
--- a/extensions/Channel_Type_File.xml
+++ b/extensions/Channel_Type_File.xml
@@ -141,6 +141,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</
       </tp:docstring>
     </property>
 
+    <property name="SocketPath" type="s" access="readwrite">
+      <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+        <p>Path to the UNIX socket in use.</p>
+
+	<p>If this is an empty string, its value is undefined.</p>
+      </tp:docstring>
+    </property>
+
     <tp:enum name="File_Transfer_Direction">
       <tp:enumvalue suffix="Incoming" value="0">
         <tp:docstring>
diff --git a/src/salut-file-channel.c b/src/salut-file-channel.c
index d17c240..e8db54a 100644
--- a/src/salut-file-channel.c
+++ b/src/salut-file-channel.c
@@ -98,6 +98,7 @@ enum
   PROP_DESCRIPTION,
   PROP_AVAILABLE_SOCKET_TYPES,
   PROP_TRANSFERRED_BYTES,
+  PROP_SOCKET_PATH,
   LAST_PROPERTY
 };
 
@@ -127,6 +128,7 @@ struct _SalutFileChannelPrivate {
   gchar *description;
   GHashTable *available_socket_types;
   guint64 transferred_bytes;
+  gchar *socket_path;
 
 };
 
@@ -216,7 +218,10 @@ salut_file_channel_get_property (GObject    *object,
         g_value_set_boxed (value, self->priv->available_socket_types);
         break;
       case PROP_TRANSFERRED_BYTES:
-        g_value_set_uint (value, self->priv->transferred_bytes);
+        g_value_set_uint64 (value, self->priv->transferred_bytes);
+        break;
+      case PROP_SOCKET_PATH:
+        g_value_set_string (value, self->priv->socket_path);
         break;
       default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -301,6 +306,9 @@ salut_file_channel_set_property (GObject *object,
         /* This should not be writeable with the new request API */
         self->priv->available_socket_types = g_value_get_boxed (value);
         break;
+      case PROP_SOCKET_PATH:
+        self->priv->socket_path = g_value_dup_string (value);
+        break;
       default:
         G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
         break;
@@ -375,6 +383,7 @@ salut_file_channel_class_init (SalutFileChannelClass *salut_file_channel_class)
     { "ContentMD5", "content-md5", "content-md5" },
     { "Description", "description", "description" },
     { "AvailableSocketTypes", "available-socket-types", NULL },
+    { "SocketPath", "socket-path", "socket-path" },
     { NULL }
   };
 
@@ -592,6 +601,17 @@ salut_file_channel_class_init (SalutFileChannelClass *salut_file_channel_class)
       G_PARAM_STATIC_BLURB);
   g_object_class_install_property (object_class, PROP_TRANSFERRED_BYTES, param_spec);
 
+  param_spec = g_param_spec_string (
+      "socket-path",
+      "gchar *socket-path",
+      "UNIX socket path",
+      "",
+      G_PARAM_CONSTRUCT |
+      G_PARAM_READWRITE |
+      G_PARAM_STATIC_NICK |
+      G_PARAM_STATIC_BLURB);
+  g_object_class_install_property (object_class, PROP_SOCKET_PATH, param_spec);
+
   salut_file_channel_class->dbus_props_class.interfaces = prop_interfaces;
   tp_dbus_properties_mixin_class_init (object_class,
       G_STRUCT_OFFSET (SalutFileChannelClass, dbus_props_class));
-- 
1.5.6.5




More information about the Telepathy-commits mailing list