X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fev-sidebar-attachments.c;h=aaaea31c99c2fb8298aec45ef7bcce1440d0a66f;hb=d937b8505ff14af15ae0372ab40a0e81a93b728c;hp=d89617b1d6471ffc126b558e83376abeab009727;hpb=34148304a0237fd9fd7c4ea05ca2e053d9ddd3ff;p=evince.git diff --git a/shell/ev-sidebar-attachments.c b/shell/ev-sidebar-attachments.c index d89617b1..aaaea31c 100644 --- a/shell/ev-sidebar-attachments.c +++ b/shell/ev-sidebar-attachments.c @@ -410,7 +410,7 @@ ev_sidebar_attachments_drag_data_get (GtkWidget *widget, GtkTreePath *path; GtkTreeIter iter; GFile *file; - gchar *filename; + gchar *template; GError *error = NULL; path = (GtkTreePath *) l->data; @@ -421,13 +421,12 @@ ev_sidebar_attachments_drag_data_get (GtkWidget *widget, COLUMN_ATTACHMENT, &attachment, -1); - filename = g_build_filename (ev_tmp_dir (), - ev_attachment_get_name (attachment), - NULL); - file = g_file_new_for_path (filename); - g_free (filename); + /* FIXMEchpe: convert to filename encoding first! */ + template = g_strdup_printf ("%s.XXXXXX", ev_attachment_get_name (attachment)); + file = ev_mkstemp_file (template, &error); + g_free (template); - if (ev_attachment_save (attachment, file, &error)) { + if (file != NULL && ev_attachment_save (attachment, file, &error)) { gchar *uri; uri = g_file_get_uri (file);