From 4af35fe51f3e6717c0006d2d6d9ff593ae7836f9 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sat, 21 May 2011 16:05:08 +0300 Subject: [PATCH] * widget/mu-msg-*: update for mu_msg_save_mime_part API change --- widgets/mu-msg-attach-view.c | 7 ++++--- widgets/mu-msg-body-view.c | 11 ++++++++--- widgets/mu-msg-view.c | 10 +++++++++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/widgets/mu-msg-attach-view.c b/widgets/mu-msg-attach-view.c index c9d4c6ec..ee30a68d 100644 --- a/widgets/mu-msg-attach-view.c +++ b/widgets/mu-msg-attach-view.c @@ -127,16 +127,17 @@ accumulate_parts (MuMsgAttachView *self, GtkTreePath *path, GSList **lst) if (gtk_tree_model_get_iter (model, &iter, path)) { gchar *filepath; gint idx; - gtk_tree_model_get (model, &iter, PARTNUM_COL, &idx, -1); + gtk_tree_model_get (model, &iter, PARTNUM_COL, &idx, -1); filepath = mu_msg_part_filepath_cache (self->_priv->_msg, idx); if (filepath) { if (mu_msg_part_save (self->_priv->_msg, filepath, - idx, FALSE, TRUE)) { + idx, FALSE, TRUE, NULL)) { GFile *file; file = g_file_new_for_path (filepath); *lst = g_slist_prepend (*lst, g_file_get_uri(file)); g_object_unref (file); - } + } else + g_warning ("error saving msg part"); g_free (filepath); } } diff --git a/widgets/mu-msg-body-view.c b/widgets/mu-msg-body-view.c index f3053e78..00148f90 100644 --- a/widgets/mu-msg-body-view.c +++ b/widgets/mu-msg-body-view.c @@ -103,6 +103,7 @@ save_file_for_cid (MuMsg *msg, const char* cid) gint idx; gchar *filepath; gboolean rv; + GError *err; g_return_val_if_fail (msg, NULL); g_return_val_if_fail (cid, NULL); @@ -118,10 +119,14 @@ save_file_for_cid (MuMsg *msg, const char* cid) g_warning ("%s: cannot create filepath", filepath); return NULL; } - - rv = mu_msg_part_save (msg, filepath, idx, FALSE, TRUE); + + err = NULL; + rv = mu_msg_part_save (msg, filepath, idx, FALSE, TRUE, &err); if (!rv) { - g_warning ("%s: failed to save %s", __FUNCTION__, filepath); + g_warning ("%s: failed to save %s: %s", __FUNCTION__, filepath, + err&&err->message?err->message:"error"); + if (err) + g_error_free (err); g_free (filepath); filepath = NULL; } diff --git a/widgets/mu-msg-view.c b/widgets/mu-msg-view.c index 0f4ef7ce..712fdb6a 100644 --- a/widgets/mu-msg-view.c +++ b/widgets/mu-msg-view.c @@ -112,7 +112,15 @@ on_attach_activated (GtkWidget *w, guint partnum, MuMsg *msg) filepath = mu_msg_part_filepath_cache (msg, partnum); if (filepath) { - mu_msg_part_save (msg, filepath, partnum, FALSE, TRUE); + GError *err; + err = NULL; + if (!mu_msg_part_save (msg, filepath, partnum, FALSE, TRUE, &err)) { + g_warning ("failed to save %s: %s", filepath, + err&&err->message?err->message:"error"); + if (err) + g_error_free(err); + } + mu_util_play (filepath, TRUE, FALSE); g_free (filepath); }