[evolution] Remove dead composer code.
- From: Matthew Barnes <mbarnes src gnome org>
- To: svn-commits-list gnome org
- Subject: [evolution] Remove dead composer code.
- Date: Mon, 4 May 2009 16:03:49 -0400 (EDT)
commit ba2cf0efba5fa98421088b7bb7d0a364aefaf042
Author: Matthew Barnes <mbarnes redhat com>
Date: Mon May 4 16:03:22 2009 -0400
Remove dead composer code.
---
composer/e-msg-composer.c | 176 ---------------------------------------------
1 files changed, 0 insertions(+), 176 deletions(-)
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 3195255..3079e8e 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1595,182 +1595,6 @@ struct _drop_data {
unsigned int aborted:1;
};
-#if 0 /* FIXME */
-static void
-drop_action (EMsgComposer *composer,
- GdkDragContext *context,
- guint32 action,
- GtkSelectionData *selection,
- guint info,
- guint time,
- gboolean html_dnd)
-{
- char *tmp, *str, **urls;
- CamelMimePart *mime_part;
- CamelStream *stream;
- CamelMimeMessage *msg;
- char *content_type;
- int i, success = FALSE, delete = FALSE;
- EMsgComposerPrivate *p = composer->priv;
-
- switch (info) {
- case DND_TYPE_MESSAGE_RFC822:
- d (printf ("dropping a message/rfc822\n"));
- /* write the message (s) out to a CamelStream so we can use it */
- stream = camel_stream_mem_new ();
- camel_stream_write (stream, (const gchar *)selection->data, selection->length);
- camel_stream_reset (stream);
-
- msg = camel_mime_message_new ();
- if (camel_data_wrapper_construct_from_stream ((CamelDataWrapper *)msg, stream) != -1) {
- msg_composer_attach_message (composer, msg);
- success = TRUE;
- delete = action == GDK_ACTION_MOVE;
- }
-
- camel_object_unref (msg);
- camel_object_unref (stream);
- break;
- case DND_TYPE_NETSCAPE_URL:
- d (printf ("dropping a _NETSCAPE_URL\n"));
- tmp = g_strndup ((const gchar *) selection->data, selection->length);
- urls = g_strsplit (tmp, "\n", 2);
- g_free (tmp);
-
- /* _NETSCAPE_URL is represented as "URI\nTITLE" */
- handle_uri (composer, urls[0], html_dnd);
-
- g_strfreev (urls);
- success = TRUE;
- break;
- case DND_TYPE_TEXT_URI_LIST:
- d (printf ("dropping a text/uri-list\n"));
- tmp = g_strndup ((const gchar *) selection->data, selection->length);
- urls = g_strsplit (tmp, "\n", 0);
- g_free (tmp);
-
- for (i = 0; urls[i] != NULL; i++) {
- str = g_strstrip (urls[i]);
- if (str[0] == '#' || str[0] == '\0')
- continue;
-
- handle_uri (composer, str, html_dnd);
- }
-
- g_strfreev (urls);
- success = TRUE;
- break;
- case DND_TYPE_TEXT_VCARD:
- case DND_TYPE_TEXT_CALENDAR:
- content_type = gdk_atom_name (selection->type);
- d (printf ("dropping a %s\n", content_type));
-
- mime_part = camel_mime_part_new ();
- camel_mime_part_set_content (mime_part, (const gchar *)selection->data, selection->length, content_type);
- camel_mime_part_set_disposition (mime_part, "inline");
-
- e_attachment_bar_attach_mime_part (E_ATTACHMENT_BAR (p->attachment_bar), mime_part);
-
- camel_object_unref (mime_part);
- g_free (content_type);
-
- success = TRUE;
- break;
- case DND_TYPE_X_UID_LIST: {
- GPtrArray *uids;
- char *inptr, *inend;
- CamelFolder *folder;
- CamelException ex = CAMEL_EXCEPTION_INITIALISER;
-
- /* NB: This all runs synchronously, could be very slow/hang/block the ui */
-
- uids = g_ptr_array_new ();
-
- inptr = (char*)selection->data;
- inend = (char*)(selection->data + selection->length);
- while (inptr < inend) {
- char *start = inptr;
-
- while (inptr < inend && *inptr)
- inptr++;
-
- if (start > (char *)selection->data)
- g_ptr_array_add (uids, g_strndup (start, inptr-start));
-
- inptr++;
- }
-
- if (uids->len > 0) {
- folder = mail_tool_uri_to_folder ((const gchar *)selection->data, 0, &ex);
- if (folder) {
- if (uids->len == 1) {
- msg = camel_folder_get_message (folder, uids->pdata[0], &ex);
- if (msg == NULL)
- goto fail;
- msg_composer_attach_message (composer, msg);
- } else {
- CamelMultipart *mp = camel_multipart_new ();
- char *desc;
-
- camel_data_wrapper_set_mime_type ((CamelDataWrapper *)mp, "multipart/digest");
- camel_multipart_set_boundary (mp, NULL);
- for (i=0;i<uids->len;i++) {
- msg = camel_folder_get_message (folder, uids->pdata[i], &ex);
- if (msg) {
- mime_part = camel_mime_part_new ();
- camel_mime_part_set_disposition (mime_part, "inline");
- camel_medium_set_content_object ((CamelMedium *)mime_part, (CamelDataWrapper *)msg);
- camel_mime_part_set_content_type (mime_part, "message/rfc822");
- camel_multipart_add_part (mp, mime_part);
- camel_object_unref (mime_part);
- camel_object_unref (msg);
- } else {
- camel_object_unref (mp);
- goto fail;
- }
- }
- mime_part = camel_mime_part_new ();
- camel_medium_set_content_object ((CamelMedium *)mime_part, (CamelDataWrapper *)mp);
- /* translators, this count will always be >1 */
- desc = g_strdup_printf (ngettext ("Attached message", "%d attached messages", uids->len), uids->len);
- camel_mime_part_set_description (mime_part, desc);
- g_free (desc);
- e_attachment_bar_attach_mime_part (E_ATTACHMENT_BAR(p->attachment_bar), mime_part);
- camel_object_unref (mime_part);
- camel_object_unref (mp);
- }
- success = TRUE;
- delete = action == GDK_ACTION_MOVE;
- fail:
- if (camel_exception_is_set (&ex)) {
- char *name;
-
- camel_object_get (folder, NULL, CAMEL_FOLDER_NAME, &name, NULL);
- e_error_run ((GtkWindow *)composer, "mail-composer:attach-nomessages",
- name?name:(char *)selection->data, camel_exception_get_description (&ex), NULL);
- camel_object_free (folder, CAMEL_FOLDER_NAME, name);
- }
- camel_object_unref (folder);
- } else {
- e_error_run ((GtkWindow *)composer, "mail-composer:attach-nomessages",
- (const gchar*)selection->data, camel_exception_get_description (&ex), NULL);
- }
-
- camel_exception_clear (&ex);
- }
-
- g_ptr_array_free (uids, TRUE);
-
- break; }
- default:
- d (printf ("dropping an unknown\n"));
- break;
- }
-
- gtk_drag_finish (context, success, delete, time);
-}
-#endif
-
static void
msg_composer_notify_header_cb (EMsgComposer *composer)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]