aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/e-msg-composer-attachment.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>1999-11-12 11:15:30 +0800
committerEttore Perazzoli <ettore@src.gnome.org>1999-11-12 11:15:30 +0800
commit15b4b77c8ae5dabda4e3c4eb30e4345d5effdfb1 (patch)
treec88b3bcb07f06d85a25627a8e6ce58b9aebf92ee /widgets/e-msg-composer-attachment.c
parent0ebe0334b1aefd2082dbcdadda2742eeaaf17943 (diff)
downloadgsoc2013-evolution-15b4b77c8ae5dabda4e3c4eb30e4345d5effdfb1.tar
gsoc2013-evolution-15b4b77c8ae5dabda4e3c4eb30e4345d5effdfb1.tar.gz
gsoc2013-evolution-15b4b77c8ae5dabda4e3c4eb30e4345d5effdfb1.tar.bz2
gsoc2013-evolution-15b4b77c8ae5dabda4e3c4eb30e4345d5effdfb1.tar.lz
gsoc2013-evolution-15b4b77c8ae5dabda4e3c4eb30e4345d5effdfb1.tar.xz
gsoc2013-evolution-15b4b77c8ae5dabda4e3c4eb30e4345d5effdfb1.tar.zst
gsoc2013-evolution-15b4b77c8ae5dabda4e3c4eb30e4345d5effdfb1.zip
Some message composer improvements.
svn path=/trunk/; revision=1382
Diffstat (limited to 'widgets/e-msg-composer-attachment.c')
-rw-r--r--widgets/e-msg-composer-attachment.c20
1 files changed, 20 insertions, 0 deletions
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 <sys/stat.h>
+
#include <gnome.h>
+
#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;