aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-attachment.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2005-08-16 11:47:55 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2005-08-16 11:47:55 +0800
commiteb491088f8aabcc369f09fd95c46a5794c575d6f (patch)
tree88e9981291487703a9915644d07dcb7bfba95669 /widgets/misc/e-attachment.c
parente77ae6c0f59b94265a3487eacea32abb1c312ab0 (diff)
downloadgsoc2013-evolution-eb491088f8aabcc369f09fd95c46a5794c575d6f.tar
gsoc2013-evolution-eb491088f8aabcc369f09fd95c46a5794c575d6f.tar.gz
gsoc2013-evolution-eb491088f8aabcc369f09fd95c46a5794c575d6f.tar.bz2
gsoc2013-evolution-eb491088f8aabcc369f09fd95c46a5794c575d6f.tar.lz
gsoc2013-evolution-eb491088f8aabcc369f09fd95c46a5794c575d6f.tar.xz
gsoc2013-evolution-eb491088f8aabcc369f09fd95c46a5794c575d6f.tar.zst
gsoc2013-evolution-eb491088f8aabcc369f09fd95c46a5794c575d6f.zip
Fix for bug #312545
2005-08-16 Srinivasa Ragavan <sragavan@novell.com> * mail/em-format-html-display.c: * widgets/misc/e-attachment*.c: Fix for bug #312545 svn path=/trunk/; revision=30126
Diffstat (limited to 'widgets/misc/e-attachment.c')
-rw-r--r--widgets/misc/e-attachment.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c
index 8dc2a089af..a5082cc6c2 100644
--- a/widgets/misc/e-attachment.c
+++ b/widgets/misc/e-attachment.c
@@ -74,12 +74,11 @@ finalise(GObject *object)
} else {
if (attachment->handle)
gnome_vfs_async_cancel(attachment->handle);
- if (attachment->file_name)
- g_free (attachment->file_name);
- if (attachment->description)
- g_free (attachment->description);
+ g_free (attachment->description);
}
+ g_free (attachment->file_name);
+
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -264,7 +263,6 @@ e_attachment_new (const char *file_name,
camel_mime_part_set_disposition (part, disposition);
filename = g_path_get_basename (file_name);
camel_mime_part_set_filename (part, filename);
- g_free (filename);
#if 0
/* Note: Outlook 2002 is broken with respect to Content-Ids on
@@ -284,6 +282,7 @@ e_attachment_new (const char *file_name,
new->guessed_type = TRUE;
new->handle = NULL;
new->is_available_local = TRUE;
+ new->file_name = filename;
uri = g_strdup_printf("file://%s\r\n", file_name);
g_object_set_data_full((GObject *)new, "e-drag-uri", uri, g_free);
@@ -485,10 +484,8 @@ e_attachment_build_remote_file (const char *file_name,
attachment->body = part;
attachment->size = statbuf.st_size;
attachment->guessed_type = TRUE;
- if (attachment->file_name) {
- g_free (attachment->file_name);
- attachment->file_name = NULL;
- }
+ g_free (attachment->file_name);
+ attachment->file_name = g_strdup (filename);
uri = g_strdup_printf("file://%s\r\n", file_name);
g_object_set_data_full((GObject *)attachment, "e-drag-uri", uri, g_free);
@@ -515,6 +512,7 @@ e_attachment_new_from_mime_part (CamelMimePart *part)
new->guessed_type = FALSE;
new->is_available_local = TRUE;
new->size = 0;
+ new->file_name = g_strdup (camel_mime_part_get_filename(part));
return new;
}
@@ -594,20 +592,16 @@ ok_cb (GtkWidget *widget, gpointer data)
attachment = dialog_data->attachment;
str = gtk_entry_get_text (dialog_data->file_name_entry);
- if (attachment->is_available_local) {
+ if (attachment->is_available_local)
camel_mime_part_set_filename (attachment->body, str);
- } else {
- if (attachment->file_name)
- g_free (attachment->file_name);
- attachment->file_name = g_strdup (str);
- }
+ g_free (attachment->file_name);
+ attachment->file_name = g_strdup (str);
str = gtk_entry_get_text (dialog_data->description_entry);
if (attachment->is_available_local) {
camel_mime_part_set_description (attachment->body, str);
} else {
- if (attachment->description)
- g_free (attachment->description);
+ g_free (attachment->description);
attachment->description = g_strdup (str);
}