mirror of https://github.com/djcb/mu.git
* widget/mu-msg-*: update for mu_msg_save_mime_part API change
This commit is contained in:
parent
e103a23c1f
commit
4af35fe51f
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue