summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-03-13 15:41:20 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2014-03-13 15:41:20 +0100
commit10259fa5d3b5dddc3b2202a36e4b6b621890fab1 (patch)
tree41a098a2fb03143b8134ad46e2a74b4b28969742
parent087e1043269d361b1f349b1cf123ac10506e4bbc (diff)
parent86db955eede16bf794c3ba7b3355183ca11a5a17 (diff)
downloadtelepathy-glib-10259fa5d3b5dddc3b2202a36e4b6b621890fab1.tar.gz
Merge branch 'telepathy-glib-0.22'
Conflicts: telepathy-glib/contact.c
-rw-r--r--telepathy-glib/contact.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c
index 1f881c2a6..20f4bf681 100644
--- a/telepathy-glib/contact.c
+++ b/telepathy-glib/contact.c
@@ -2886,10 +2886,11 @@ mime_file_written (GObject *source_object,
}
else
{
+ gchar *data_path = g_file_get_path (avatar_data->file);
+
DEBUG ("Saved avatar '%s' of MIME type '%s' still used by '%s' to '%s'",
avatar_data->token, avatar_data->mime_type,
- self->priv->identifier,
- g_file_get_path (avatar_data->file));
+ self->priv->identifier, data_path);
g_clear_object (&self->priv->avatar_file);
self->priv->avatar_file = g_object_ref (avatar_data->file);
@@ -2902,6 +2903,7 @@ mime_file_written (GObject *source_object,
g_object_notify ((GObject *) self, "avatar-file");
g_object_unref (self);
+ g_free (data_path);
}
write_avatar_data_free (avatar_data);
@@ -2915,26 +2917,29 @@ avatar_file_written (GObject *source_object,
GError *error = NULL;
WriteAvatarData *avatar_data = user_data;
GFile *file = G_FILE (source_object);
+ gchar *path = g_file_get_path (file);
g_assert (file == avatar_data->file);
if (!g_file_replace_contents_finish (file, res, NULL, &error))
{
DEBUG ("Failed to store avatar in cache (%s): %s",
- g_file_get_path (file), error->message);
+ path, error->message);
DEBUG ("Storing the MIME type anyway");
g_clear_error (&error);
}
else
{
DEBUG ("Contact avatar stored in cache: %s",
- g_file_get_path (file));
+ path);
}
g_file_replace_contents_async (avatar_data->mime_file,
avatar_data->mime_type, strlen (avatar_data->mime_type),
NULL, FALSE, G_FILE_CREATE_PRIVATE|G_FILE_CREATE_REPLACE_DESTINATION,
NULL, mime_file_written, avatar_data);
+
+ g_free (path);
}
static void