[evolution] Bug 791203 - Add file extension to pasted image in Plain Text mode



commit e3b946fe252b7e2333ce19b9f2b00cc7ba113c4e
Author: Milan Crha <mcrha redhat com>
Date:   Mon Dec 4 14:33:48 2017 +0100

    Bug 791203 - Add file extension to pasted image in Plain Text mode

 src/e-util/e-misc-utils.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/e-util/e-misc-utils.c b/src/e-util/e-misc-utils.c
index 8e96911..c6f4e10 100644
--- a/src/e-util/e-misc-utils.c
+++ b/src/e-util/e-misc-utils.c
@@ -3479,6 +3479,7 @@ gchar *
 e_util_save_image_from_clipboard (GtkClipboard *clipboard)
 {
        GdkPixbuf *pixbuf = NULL;
+       gchar *tmpl;
        gchar *filename = NULL;
        gchar *uri = NULL;
        GError *error = NULL;
@@ -3489,8 +3490,13 @@ e_util_save_image_from_clipboard (GtkClipboard *clipboard)
        pixbuf = gtk_clipboard_wait_for_image (clipboard);
        g_return_val_if_fail (pixbuf != NULL, FALSE);
 
+       tmpl = g_strconcat (_("Image"), "-XXXXXX.png", NULL);
+
        /* Reserve a temporary file. */
-       filename = e_mktemp (NULL);
+       filename = e_mktemp (tmpl);
+
+       g_free (tmpl);
+
        if (filename == NULL) {
                g_set_error (
                        &error, G_FILE_ERROR,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]