aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-04-24 22:58:35 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-04-24 22:58:35 +0800
commitc2119e513bc7482fc0150287af8502a5ff67191a (patch)
tree9bb636e61736c3d4f993160934a379952309b36d /widgets
parent611ed0f3cfe8cfe29d8ed8e0830905cef96d9082 (diff)
downloadgsoc2013-evolution-c2119e513bc7482fc0150287af8502a5ff67191a.tar
gsoc2013-evolution-c2119e513bc7482fc0150287af8502a5ff67191a.tar.gz
gsoc2013-evolution-c2119e513bc7482fc0150287af8502a5ff67191a.tar.bz2
gsoc2013-evolution-c2119e513bc7482fc0150287af8502a5ff67191a.tar.lz
gsoc2013-evolution-c2119e513bc7482fc0150287af8502a5ff67191a.tar.xz
gsoc2013-evolution-c2119e513bc7482fc0150287af8502a5ff67191a.tar.zst
gsoc2013-evolution-c2119e513bc7482fc0150287af8502a5ff67191a.zip
Fix a couple more attachment issues.
Propagate attachment property changes to the CamelMimePart and emit a "notify::file-info" signal to refresh the row in the attachment model. Also, only fall back to showing the attachment's file name if its description is -empty- (not just NULL).
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-attachment-dialog.c14
-rw-r--r--widgets/misc/e-attachment.c3
2 files changed, 16 insertions, 1 deletions
diff --git a/widgets/misc/e-attachment-dialog.c b/widgets/misc/e-attachment-dialog.c
index dd39a253c9..e8c599aeea 100644
--- a/widgets/misc/e-attachment-dialog.c
+++ b/widgets/misc/e-attachment-dialog.c
@@ -212,6 +212,7 @@ attachment_dialog_response (GtkDialog *dialog,
EAttachment *attachment;
GtkToggleButton *button;
GFileInfo *file_info;
+ CamelMimePart *mime_part;
const gchar *attribute;
const gchar *text;
gboolean active;
@@ -226,18 +227,31 @@ attachment_dialog_response (GtkDialog *dialog,
file_info = e_attachment_get_file_info (attachment);
g_return_if_fail (G_IS_FILE_INFO (file_info));
+ mime_part = e_attachment_get_mime_part (attachment);
+
attribute = G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME;
text = gtk_entry_get_text (GTK_ENTRY (priv->display_name_entry));
g_file_info_set_attribute_string (file_info, attribute, text);
+ if (mime_part != NULL)
+ camel_mime_part_set_filename (mime_part, text);
+
attribute = G_FILE_ATTRIBUTE_STANDARD_DESCRIPTION;
text = gtk_entry_get_text (GTK_ENTRY (priv->description_entry));
g_file_info_set_attribute_string (file_info, attribute, text);
+ if (mime_part != NULL)
+ camel_mime_part_set_description (mime_part, text);
+
button = GTK_TOGGLE_BUTTON (priv->disposition_checkbox);
active = gtk_toggle_button_get_active (button);
text = active ? "inline" : "attachment";
e_attachment_set_disposition (attachment, text);
+
+ if (mime_part != NULL)
+ camel_mime_part_set_disposition (mime_part, text);
+
+ g_object_notify (G_OBJECT (attachment), "file-info");
}
static void
diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c
index ee5446e699..537a3470d7 100644
--- a/widgets/misc/e-attachment.c
+++ b/widgets/misc/e-attachment.c
@@ -168,7 +168,8 @@ attachment_update_file_info_columns (EAttachment *attachment)
display_size = g_format_size_for_display (size);
description = e_attachment_get_description (attachment);
- description = (description != NULL) ? description : display_name;
+ if (description == NULL || *description == '\0')
+ description = display_name;
if (size > 0)
caption = g_strdup_printf (