diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2008-11-22 00:16:51 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-11-22 00:16:51 +0800 |
commit | b586f65b3426dcd186757a4256c0e4d5995ef5bc (patch) | |
tree | 7525f1d0d759fee671346bc8d4d72aec9b4f9a74 /libempathy | |
parent | fd3018ae75c0c58ef484a3048c9f9f6134957ee2 (diff) | |
download | gsoc2013-empathy-b586f65b3426dcd186757a4256c0e4d5995ef5bc.tar gsoc2013-empathy-b586f65b3426dcd186757a4256c0e4d5995ef5bc.tar.gz gsoc2013-empathy-b586f65b3426dcd186757a4256c0e4d5995ef5bc.tar.bz2 gsoc2013-empathy-b586f65b3426dcd186757a4256c0e4d5995ef5bc.tar.lz gsoc2013-empathy-b586f65b3426dcd186757a4256c0e4d5995ef5bc.tar.xz gsoc2013-empathy-b586f65b3426dcd186757a4256c0e4d5995ef5bc.tar.zst gsoc2013-empathy-b586f65b3426dcd186757a4256c0e4d5995ef5bc.zip |
Added ContentHashType channel property, and renamed ContentMD5 to ContentHash. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
svn path=/trunk/; revision=1785
Diffstat (limited to 'libempathy')
-rw-r--r-- | libempathy/empathy-tp-file.c | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c index f98f3c405..13048a92c 100644 --- a/libempathy/empathy-tp-file.c +++ b/libempathy/empathy-tp-file.c @@ -109,7 +109,8 @@ struct _EmpathyTpFilePriv { guint64 transferred_bytes; gint64 start_time; gchar *unix_socket_path; - gchar *content_md5; + gchar *content_hash; + EmpFileHashType content_hash_type; gchar *content_type; gchar *description; GCancellable *cancellable; @@ -125,7 +126,8 @@ enum { PROP_SIZE, PROP_CONTENT_TYPE, PROP_TRANSFERRED_BYTES, - PROP_CONTENT_MD5, + PROP_CONTENT_HASH_TYPE, + PROP_CONTENT_HASH, PROP_IN_STREAM, }; @@ -207,10 +209,20 @@ empathy_tp_file_class_init (EmpathyTpFileClass *klass) G_PARAM_READWRITE)); g_object_class_install_property (object_class, - PROP_CONTENT_MD5, - g_param_spec_string ("content-md5", - "file transfer md5sum", - "The md5 sum of the transfer's contents", + PROP_CONTENT_HASH_TYPE, + g_param_spec_uint ("content-hash-type", + "file transfer hash type", + "The type of the file transfer hash", + 0, + G_MAXUINT, + 0, + G_PARAM_READWRITE)); + + g_object_class_install_property (object_class, + PROP_CONTENT_HASH, + g_param_spec_string ("content-hash", + "file transfer hash", + "The hash of the transfer's contents", "", G_PARAM_READWRITE)); @@ -276,7 +288,7 @@ tp_file_finalize (GObject *object) g_free (priv->filename); g_free (priv->unix_socket_path); g_free (priv->description); - g_free (priv->content_md5); + g_free (priv->content_hash); g_free (priv->content_type); if (priv->in_stream) @@ -361,8 +373,8 @@ tp_file_constructor (GType type, priv->filename = g_value_dup_string (g_hash_table_lookup (properties, "Filename")); - priv->content_md5 = g_value_dup_string (g_hash_table_lookup (properties, - "ContentMD5")); + priv->content_hash = g_value_dup_string (g_hash_table_lookup (properties, + "ContentHash")); priv->description = g_value_dup_string (g_hash_table_lookup (properties, "Description")); @@ -458,10 +470,10 @@ tp_file_set_property (GObject *object, g_free (priv->content_type); priv->content_type = g_value_dup_string (value); break; - case PROP_CONTENT_MD5: - tp_file_channel_set_dbus_property (priv->channel, "ContentMD5", value); - g_free (priv->content_md5); - priv->content_md5 = g_value_dup_string (value); + case PROP_CONTENT_HASH: + tp_file_channel_set_dbus_property (priv->channel, "ContentHash", value); + g_free (priv->content_hash); + priv->content_hash = g_value_dup_string (value); break; case PROP_IN_STREAM: if (priv->in_stream) |