From 15b4b77c8ae5dabda4e3c4eb30e4345d5effdfb1 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Fri, 12 Nov 1999 03:15:30 +0000 Subject: Some message composer improvements. svn path=/trunk/; revision=1382 --- widgets/e-msg-composer-attachment.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'widgets/e-msg-composer-attachment.c') diff --git a/widgets/e-msg-composer-attachment.c b/widgets/e-msg-composer-attachment.c index c9e5029c9b..4ab8de42c4 100644 --- a/widgets/e-msg-composer-attachment.c +++ b/widgets/e-msg-composer-attachment.c @@ -21,7 +21,16 @@ * Author: Ettore Perazzoli */ +/* This is the object representing an email attachment. It is implemented as a + GtkObject to make it easier for the application to handle it. For example, + the "changed" signal is emitted whenever something changes in the + attachment. Also, this contains the code to let users edit the + attachment manually. */ + +#include + #include + #include "e-msg-composer-attachment.h" @@ -122,6 +131,11 @@ class_init (EMsgComposerAttachmentClass *klass) static void init (EMsgComposerAttachment *msg_composer_attachment) { + msg_composer_attachment->editor_gui = NULL; + msg_composer_attachment->file_name = NULL; + msg_composer_attachment->description = NULL; + msg_composer_attachment->mime_type = NULL; + msg_composer_attachment->size = 0; } GtkType @@ -158,6 +172,7 @@ EMsgComposerAttachment * e_msg_composer_attachment_new (const gchar *file_name) { EMsgComposerAttachment *new; + struct stat statbuf; g_return_val_if_fail (file_name != NULL, NULL); @@ -168,6 +183,11 @@ e_msg_composer_attachment_new (const gchar *file_name) new->file_name = g_strdup (file_name); new->description = g_strdup (g_basename (new->file_name)); + if (stat (file_name, &statbuf) < 0) + new->size = 0; + else + new->size = statbuf.st_size; + init_mime_type (new); return new; -- cgit v1.2.3