diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-11-09 19:36:46 +0000 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-11-11 10:50:53 +0000 |
commit | c5ba5036d032967e0bc1bb1a26e9d5f0be31bf4c (patch) | |
tree | df596f0de84c311fb0f0181f252a073a04a9487c | |
parent | 69cc5afe3dc1d47742337c8463cf379aae85c2a7 (diff) |
ft-channel: update to newer metadata draft
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r-- | telepathy-glib/file-transfer-channel.c | 8 | ||||
-rw-r--r-- | tests/dbus/file-transfer-channel.c | 9 | ||||
-rw-r--r-- | tests/lib/file-transfer-chan.c | 2 |
3 files changed, 11 insertions, 8 deletions
diff --git a/telepathy-glib/file-transfer-channel.c b/telepathy-glib/file-transfer-channel.c index 7c1cd1da0..1db98b525 100644 --- a/telepathy-glib/file-transfer-channel.c +++ b/telepathy-glib/file-transfer-channel.c @@ -118,7 +118,7 @@ struct _TpFileTransferChannelPrivate goffset initial_offset; /* Metadata */ const gchar *service_name; - const GHashTable *metadata; /* const gchar* => const gchar* */ + const GHashTable *metadata; /* const gchar* => const gchar* const* */ /* Streams and sockets for sending and receiving the actual file */ GSocket *client_socket; @@ -565,7 +565,7 @@ tp_file_transfer_channel_constructed (GObject *obj) self->priv->metadata = tp_asv_get_boxed (properties, TP_PROP_CHANNEL_INTERFACE_FILE_TRANSFER_METADATA_METADATA, - TP_HASH_TYPE_STRING_STRING_MAP); + TP_HASH_TYPE_METADATA); if (self->priv->metadata == NULL) { DEBUG ("Channel %s doesn't have Chan.I.FileTransfer.Metadata.Metadata " @@ -896,7 +896,7 @@ tp_file_transfer_channel_class_init (TpFileTransferChannelClass *klass) param_spec = g_param_spec_boxed ("metadata", "Metadata", "The Metadata.Metadata property of this channel", - TP_HASH_TYPE_STRING_STRING_MAP, + TP_HASH_TYPE_METADATA, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_METADATA, param_spec); @@ -1577,7 +1577,7 @@ tp_file_transfer_channel_get_service_name (TpFileTransferChannel *self) * * Return the #TpFileTransferChannel:metadata property * - * Returns: (transfer none) (element-type utf8 utf8): the + * Returns: (transfer none) (element-type utf8 GObject.Strv): the * value of the #TpFileTransferChannel:metadata property * * Since: 0.16.UNRELEASED diff --git a/tests/dbus/file-transfer-channel.c b/tests/dbus/file-transfer-channel.c index d86dc519d..cd668abd0 100644 --- a/tests/dbus/file-transfer-channel.c +++ b/tests/dbus/file-transfer-channel.c @@ -158,6 +158,7 @@ create_file_transfer_channel (Test *test, GHashTable *sockets; GHashTable *metadata; GQuark features[] = { TP_FILE_TRANSFER_CHANNEL_FEATURE_CORE, 0}; + const gchar * const metadata_values[] = { "cheese", NULL }; /* Create service-side file transfer channel object */ tp_proxy_get_object_path (test->connection); @@ -177,7 +178,7 @@ create_file_transfer_channel (Test *test, sockets = create_available_socket_types_hash (address_type, access_control); metadata = g_hash_table_new (g_str_hash, g_str_equal); - g_hash_table_insert (metadata, "banana", "cheese"); + g_hash_table_insert (metadata, "banana", (gpointer) metadata_values); test->chan_service = g_object_new ( TP_TESTS_TYPE_FILE_TRANSFER_CHANNEL, @@ -383,6 +384,7 @@ test_properties (Test *test, TpFileTransferStateChangeReason reason; const GError *error = NULL; const GHashTable *metadata; + const gchar * const *metadata_values; create_file_transfer_channel (test, FALSE, TP_SOCKET_ADDRESS_TYPE_UNIX, TP_SOCKET_ACCESS_CONTROL_LOCALHOST); @@ -415,8 +417,9 @@ test_properties (Test *test, metadata = tp_file_transfer_channel_get_metadata (test->channel); g_assert_cmpuint (g_hash_table_size ((GHashTable *) metadata), ==, 1); - g_assert_cmpstr (g_hash_table_lookup ((GHashTable *) metadata, "banana"), - ==, "cheese"); + metadata_values = g_hash_table_lookup ((GHashTable *) metadata, "banana"); + g_assert_cmpuint (g_strv_length ((GStrv) metadata_values), ==, 1); + g_assert_cmpstr (metadata_values[0], ==, "cheese"); error = tp_proxy_get_invalidated (test->channel); g_assert_no_error (error); diff --git a/tests/lib/file-transfer-chan.c b/tests/lib/file-transfer-chan.c index 2749d171c..ba2678b55 100644 --- a/tests/lib/file-transfer-chan.c +++ b/tests/lib/file-transfer-chan.c @@ -703,7 +703,7 @@ tp_tests_file_transfer_channel_class_init ( param_spec = g_param_spec_boxed ("metadata", "Metadata", "The Metadata.Metadata property of this channel", - TP_HASH_TYPE_STRING_STRING_MAP, + TP_HASH_TYPE_METADATA, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_METADATA, param_spec); |