diff options
author | Dan Winship <danw@src.gnome.org> | 2000-04-24 01:12:18 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-04-24 01:12:18 +0800 |
commit | b33db409a60f49c61d035f7d3cc2e1232ec8a186 (patch) | |
tree | 56752e4afe9dd36674dd4f08eaddc3faed4de62b | |
parent | 5fcb83b5fb1294a781e3f7139200aa3486650db4 (diff) | |
download | gsoc2013-evolution-b33db409a60f49c61d035f7d3cc2e1232ec8a186.tar gsoc2013-evolution-b33db409a60f49c61d035f7d3cc2e1232ec8a186.tar.gz gsoc2013-evolution-b33db409a60f49c61d035f7d3cc2e1232ec8a186.tar.bz2 gsoc2013-evolution-b33db409a60f49c61d035f7d3cc2e1232ec8a186.tar.lz gsoc2013-evolution-b33db409a60f49c61d035f7d3cc2e1232ec8a186.tar.xz gsoc2013-evolution-b33db409a60f49c61d035f7d3cc2e1232ec8a186.tar.zst gsoc2013-evolution-b33db409a60f49c61d035f7d3cc2e1232ec8a186.zip |
build libcomposer static and don't install it.
* Makefile.am: build libcomposer static and don't install it.
* e-msg-composer-attachment-bar.c (attach_to_multipart): This was
only half-implemented. Finish it, mostly.
svn path=/trunk/; revision=2561
-rw-r--r-- | composer/ChangeLog | 7 | ||||
-rw-r--r-- | composer/Makefile.am | 3 | ||||
-rw-r--r-- | composer/e-msg-composer-attachment-bar.c | 33 |
3 files changed, 33 insertions, 10 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog index 3ed04bccbc..7f9000c2ab 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,10 @@ +2000-04-23 Dan Winship <danw@helixcode.com> + + * Makefile.am: build libcomposer static and don't install it. + + * e-msg-composer-attachment-bar.c (attach_to_multipart): This was + only half-implemented. Finish it, mostly. + 2000-04-22 Dan Winship <danw@helixcode.com> * e-msg-composer.c (e_msg_composer_add_header): new function to diff --git a/composer/Makefile.am b/composer/Makefile.am index 034b9ea1b2..b292516bc5 100644 --- a/composer/Makefile.am +++ b/composer/Makefile.am @@ -6,7 +6,8 @@ glade_DATA = \ libcomposerincludedir = $(includedir)/composer -lib_LTLIBRARIES = libcomposer.la +noinst_LTLIBRARIES = libcomposer.la +libcomposer_la_LDFLAGS = -static INCLUDES = \ -I$(top_srcdir) \ diff --git a/composer/e-msg-composer-attachment-bar.c b/composer/e-msg-composer-attachment-bar.c index b55a4cbad4..59785587fd 100644 --- a/composer/e-msg-composer-attachment-bar.c +++ b/composer/e-msg-composer-attachment-bar.c @@ -26,6 +26,8 @@ #include "e-msg-composer-attachment.h" #include "e-msg-composer-attachment-bar.h" +#include "camel/camel-simple-data-wrapper.h" +#include "camel/camel-stream-fs.h" #define ICON_WIDTH 64 @@ -603,19 +605,32 @@ attach_to_multipart (CamelMultipart *multipart, EMsgComposerAttachment *attachment) { CamelMimeBodyPart *part; - - /* FIXME encoding etc. etc. ? */ - /* FIXME I am not sure how to add an attachment through the Camel - API. :-/ */ + CamelDataWrapper *content; + CamelStream *stream; + char *filename; part = camel_mime_body_part_new (); camel_mime_part_set_disposition (CAMEL_MIME_PART (part), "attachment"); - camel_mime_part_set_filename (CAMEL_MIME_PART (part), - g_strdup (g_basename (attachment->file_name))); + filename = g_basename (attachment->file_name); + camel_mime_part_set_filename (CAMEL_MIME_PART (part), filename); + g_free (filename); camel_mime_part_set_description (CAMEL_MIME_PART (part), - g_strdup (attachment->description)); - camel_data_wrapper_set_mime_type (CAMEL_DATA_WRAPPER (part), - g_strdup (attachment->mime_type)); + attachment->description); + camel_mime_part_set_content_type (CAMEL_MIME_PART (part), + attachment->mime_type); + + content = CAMEL_DATA_WRAPPER (gtk_object_new (CAMEL_SIMPLE_DATA_WRAPPER_TYPE, + NULL)); + camel_data_wrapper_set_mime_type (content, attachment->mime_type); + stream = camel_stream_fs_new_with_name (attachment->file_name, + CAMEL_STREAM_FS_READ); + camel_data_wrapper_construct_from_stream (content, stream); + camel_stream_close (stream); + camel_medium_set_content_object (CAMEL_MEDIUM (part), content); + + /* FIXME: What about Content-Transfer-Encoding? */ + + camel_multipart_add_part (multipart, part); } void |