[evolution] I#1935 - Mail: Add option to print attachment content



commit 6688230dd36da13ca06e24f1af93fd2fe8779369
Author: Milan Crha <mcrha redhat com>
Date:   Fri Jun 17 12:34:37 2022 +0200

    I#1935 - Mail: Add option to print attachment content
    
    Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1935

 data/org.gnome.evolution.mail.gschema.xml.in | 5 +++++
 src/em-format/e-mail-formatter-attachment.c  | 8 ++++++++
 2 files changed, 13 insertions(+)
---
diff --git a/data/org.gnome.evolution.mail.gschema.xml.in b/data/org.gnome.evolution.mail.gschema.xml.in
index cfcbc83a93..f82cdb37fa 100644
--- a/data/org.gnome.evolution.mail.gschema.xml.in
+++ b/data/org.gnome.evolution.mail.gschema.xml.in
@@ -876,6 +876,11 @@
       <_summary>Whether to preserve expand state of the folders when calling Copy/Move to Folder.</_summary>
       <_description>If enabled, the Copy/Move to Folder dialog will preserve the expand state of the folders 
in the dialog, otherwise all the folders will be expanded.</_description>
     </key>
+    <key name="print-attachments" type="b">
+      <default>false</default>
+      <_summary>Whether to print attachments.</_summary>
+      <_description>If enabled, and possible, attachment content is printed with the message.</_description>
+    </key>
     <key name="preview-text-size-limit" type="i">
       <default>512</default>
       <_summary>Size limit for text attachments to show</_summary>
diff --git a/src/em-format/e-mail-formatter-attachment.c b/src/em-format/e-mail-formatter-attachment.c
index 81da3e8047..43e5a09651 100644
--- a/src/em-format/e-mail-formatter-attachment.c
+++ b/src/em-format/e-mail-formatter-attachment.c
@@ -132,9 +132,17 @@ emfe_attachment_format (EMailFormatterExtension *extension,
                        gchar *name;
                        EAttachment *attachment;
                        GFileInfo *file_info;
+                       GSettings *settings;
                        const gchar *display_name;
                        gchar *description;
 
+                       settings = e_util_ref_settings ("org.gnome.evolution.mail");
+                       if (!g_settings_get_boolean (settings, "print-attachments")) {
+                               g_clear_object (&settings);
+                               return TRUE;
+                       }
+                       g_clear_object (&settings);
+
                        attachment = e_mail_part_attachment_ref_attachment (
                                E_MAIL_PART_ATTACHMENT (part));
 


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