[Pkg-telepathy-commits] [telepathy-glib-1] 118/212: Remove tp_message_set in favour of tp_message_set_variant
Simon McVittie
smcv at debian.org
Wed May 14 12:09:03 UTC 2014
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian
in repository telepathy-glib-1.
commit ae62786bd1a7d7722b72c36063067c4137659621
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date: Fri Apr 4 14:57:25 2014 +0100
Remove tp_message_set in favour of tp_message_set_variant
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77139
Reviewed-by: Xavier Claessens
---
.../telepathy-glib/telepathy-glib-sections.txt | 1 -
examples/cm/echo-message-parts/chan.c | 19 ++++++++++----
telepathy-glib/message.c | 29 ----------------------
telepathy-glib/message.h | 2 --
telepathy-glib/versions/main-1.0.abi | 1 -
5 files changed, 14 insertions(+), 38 deletions(-)
diff --git a/docs/reference/telepathy-glib/telepathy-glib-sections.txt b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
index 63dc3f6..56c3c1e 100644
--- a/docs/reference/telepathy-glib/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib/telepathy-glib-sections.txt
@@ -2112,7 +2112,6 @@ tp_message_is_mutable
tp_message_append_part
tp_message_delete_key
tp_message_delete_part
-tp_message_set
tp_message_set_variant
tp_message_set_boolean
tp_message_set_bytes
diff --git a/examples/cm/echo-message-parts/chan.c b/examples/cm/echo-message-parts/chan.c
index 3c128e8..a077890 100644
--- a/examples/cm/echo-message-parts/chan.c
+++ b/examples/cm/echo-message-parts/chan.c
@@ -423,15 +423,24 @@ sms_get_sms_length (TpSvcChannelInterfaceSMS1 *self,
for (i = 0; i < parts->len; i++)
{
- GHashTableIter iter;
- gpointer key, value;
+ GVariant *vardict;
+ GVariantIter iter;
+ gchar *key;
+ GVariant *value;
+
+ vardict = g_variant_ref_sink (tp_asv_to_vardict (
+ g_ptr_array_index (parts, i)));
tp_message_append_part (message);
- g_hash_table_iter_init (&iter, g_ptr_array_index (parts, i));
- while (g_hash_table_iter_next (&iter, &key, &value))
+
+ g_variant_iter_init (&iter, vardict);
+
+ while (g_variant_iter_loop (&iter, "{sv}", &key, &value))
{
- tp_message_set (message, i, key, value);
+ tp_message_set_variant (message, i, key, value);
}
+
+ g_variant_unref (vardict);
}
txt = tp_message_to_text (message);
diff --git a/telepathy-glib/message.c b/telepathy-glib/message.c
index e43ecf7..937995a 100644
--- a/telepathy-glib/message.c
+++ b/telepathy-glib/message.c
@@ -487,35 +487,6 @@ tp_message_set_bytes (TpMessage *self,
/**
- * tp_message_set:
- * @self: a message
- * @part: a part number, which must be strictly less than the number
- * returned by tp_message_count_parts()
- * @key: a key in the mapping representing the part
- * @source: a value, encoded as dbus-glib would
- *
- * Set @key in part @part of @self to have a copy of @source as its value.
- *
- * In high-level language bindings, use tp_message_set_variant() instead.
- *
- * Since: 0.7.21
- */
-void
-tp_message_set (TpMessage *self,
- guint part,
- const gchar *key,
- const GValue *source)
-{
- g_return_if_fail (part < self->parts->len);
- g_return_if_fail (key != NULL);
- g_return_if_fail (source != NULL);
- g_return_if_fail (self->priv->mutable);
-
- g_hash_table_insert (g_ptr_array_index (self->parts, part),
- g_strdup (key), tp_g_value_slice_dup (source));
-}
-
-/**
* tp_message_set_variant:
* @self: a message
* @part: a part number, which must be strictly less than the number
diff --git a/telepathy-glib/message.h b/telepathy-glib/message.h
index 0086de2..602398b 100644
--- a/telepathy-glib/message.h
+++ b/telepathy-glib/message.h
@@ -70,8 +70,6 @@ void tp_message_set_string_printf (TpMessage *self, guint part,
const gchar *key, const gchar *fmt, ...) G_GNUC_PRINTF (4, 5);
void tp_message_set_bytes (TpMessage *self, guint part, const gchar *key,
guint len, gconstpointer bytes);
-void tp_message_set (TpMessage *self, guint part, const gchar *key,
- const GValue *source);
_TP_AVAILABLE_IN_0_20
void tp_message_set_variant (TpMessage *self, guint part, const gchar *key,
GVariant *value);
diff --git a/telepathy-glib/versions/main-1.0.abi b/telepathy-glib/versions/main-1.0.abi
index 3f864e7..28e75e9 100644
--- a/telepathy-glib/versions/main-1.0.abi
+++ b/telepathy-glib/versions/main-1.0.abi
@@ -986,7 +986,6 @@ tp_message_mixin_maybe_send_gone
tp_message_mixin_sent
tp_message_mixin_set_rescued
tp_message_mixin_take_received
-tp_message_set
tp_message_set_boolean
tp_message_set_bytes
tp_message_set_int32
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/telepathy-glib-1.git
More information about the Pkg-telepathy-commits
mailing list