aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-11-22 00:16:51 +0800
committerxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-11-22 00:16:51 +0800
commita445349adec22869ac1bbd078f2c5f8f0cfebc4c (patch)
tree7525f1d0d759fee671346bc8d4d72aec9b4f9a74
parentafaa449ceabab1fcae833b4e3324075ab8a285d3 (diff)
downloadgsoc2013-empathy-a445349adec22869ac1bbd078f2c5f8f0cfebc4c.tar
gsoc2013-empathy-a445349adec22869ac1bbd078f2c5f8f0cfebc4c.tar.gz
gsoc2013-empathy-a445349adec22869ac1bbd078f2c5f8f0cfebc4c.tar.bz2
gsoc2013-empathy-a445349adec22869ac1bbd078f2c5f8f0cfebc4c.tar.lz
gsoc2013-empathy-a445349adec22869ac1bbd078f2c5f8f0cfebc4c.tar.xz
gsoc2013-empathy-a445349adec22869ac1bbd078f2c5f8f0cfebc4c.tar.zst
gsoc2013-empathy-a445349adec22869ac1bbd078f2c5f8f0cfebc4c.zip
Added ContentHashType channel property, and renamed ContentMD5 to ContentHash. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk> git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@1785 4ee84921-47dd-4033-b63a-18d7a039a3e4
-rw-r--r--libempathy/empathy-tp-file.c38
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)