From 2a88606f5d7bf0ce98b930d489e54157663751f3 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 18 Sep 2003 17:05:23 +0000 Subject: updated for camel namespace changes 2003-09-18 Jeffrey Stedfast * component-factory.c: updated for camel namespace changes * em-folder-view.c: updated for camel namespace changes * em-format-html-display.c: updated for camel namespace changes * em-format-html-quote.c: updated for camel namespace changes * em-format.c: updated for camel namespace changes * em-popup.c: updated for camel namespace changes * em-utils.c: updated for camel namespace changes * mail-autofilter.c: updated for camel namespace changes * mail-ops.c: updated for camel namespace changes * mail-session.c: updated for camel namespace changes * message-list.c: updated for camel namespace changes * message-tag-followup.c: updated for camel namespace changes * importers/evolution-mbox-importer.c: updated for camel namespace changes 2003-09-18 Jeffrey Stedfast * em-popup.c (emp_standard_menu_factory): Don't forget to initialise/increment 'i' when using it as an object id in the for-loop. * em-format.c (em_format_format_text): Initialise charset to NULL or it may be used uninitialised. Also include gnome-vfs-mime-handlers.h for gnome_vfs_mime_type_get_description(). svn path=/trunk/; revision=22610 --- mail/ChangeLog | 33 +++++++++++++++++++++++++++++++ mail/component-factory.c | 2 +- mail/em-folder-view.c | 2 +- mail/em-format-html-display.c | 6 +++--- mail/em-format-html-quote.c | 2 +- mail/em-format-html.c | 34 ++++++++++++++++---------------- mail/em-format-quote.c | 4 ++-- mail/em-format.c | 18 ++++++++--------- mail/em-popup.c | 10 ++++++++-- mail/em-utils.c | 4 ++-- mail/importers/evolution-mbox-importer.c | 2 +- mail/mail-autofilter.c | 2 +- mail/mail-ops.c | 6 +++--- mail/mail-session.c | 1 - mail/message-list.c | 4 ++-- mail/message-tag-followup.c | 8 ++++---- 16 files changed, 88 insertions(+), 50 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 34b4f5f3c6..081419944d 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,38 @@ 2003-09-18 Jeffrey Stedfast + * component-factory.c: updated for camel namespace changes + + * em-folder-view.c: updated for camel namespace changes + + * em-format-html-display.c: updated for camel namespace changes + + * em-format-html-quote.c: updated for camel namespace changes + + * em-format.c: updated for camel namespace changes + + * em-popup.c: updated for camel namespace changes + + * em-utils.c: updated for camel namespace changes + + * mail-autofilter.c: updated for camel namespace changes + + * mail-ops.c: updated for camel namespace changes + + * mail-session.c: updated for camel namespace changes + + * message-list.c: updated for camel namespace changes + + * message-tag-followup.c: updated for camel namespace changes + + * importers/evolution-mbox-importer.c: updated for camel namespace + changes + +2003-09-18 Jeffrey Stedfast + + * em-popup.c (emp_standard_menu_factory): Don't forget to + initialise/increment 'i' when using it as an object id in the + for-loop. + * em-format.c (em_format_format_text): Initialise charset to NULL or it may be used uninitialised. Also include gnome-vfs-mime-handlers.h for gnome_vfs_mime_type_get_description(). diff --git a/mail/component-factory.c b/mail/component-factory.c index 9fda34bec0..a1d0c322eb 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -534,7 +534,7 @@ message_rfc822_dnd (CamelFolder *dest, CamelStream *stream, CamelException *ex) camel_mime_parser_scan_from (mp, TRUE); camel_mime_parser_init_with_stream (mp, stream); - while (camel_mime_parser_step (mp, 0, 0) == HSCAN_FROM) { + while (camel_mime_parser_step (mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM) { CamelMessageInfo *info; CamelMimeMessage *msg; diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index 7122f3da36..d2e6ba629f 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -973,7 +973,7 @@ emfv_message_reply(EMFolderView *emfv, int mode) if (FALSE /*gtk_clipboard_get_owner(clip) == (GObject *)emfv->preview*/ && ((EMFormatHTML *)emfv->preview)->html->engine->primary) { CamelMimeMessage *msg, *src; - struct _header_raw *header; + struct _camel_header_raw *header; HTMLEngineSaveState *state; src = (CamelMimeMessage *)((EMFormat *)emfv->preview)->message; diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index 2b59f09e85..d7497cfac5 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -795,7 +795,7 @@ efhd_drag_data_get(GtkWidget *w, GdkDragContext *drag, GtkSelectionData *data, g stream = camel_stream_mem_new(); /* TODO: shoudl format_format_text run on the content-object? */ /* TODO: should we just do format_content? */ - if (header_content_type_is(((CamelDataWrapper *)part)->mime_type, "text", "*")) + if (camel_content_type_is (((CamelDataWrapper *)part)->mime_type, "text", "*")) /* FIXME: this should be an em_utils method, it only needs a default charset param */ em_format_format_text((EMFormat *)pobject->format, stream, (CamelDataWrapper *)part); else { @@ -903,12 +903,12 @@ efhd_attachment_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObje gtk_box_pack_start((GtkBox *)mainbox, button, TRUE, TRUE, 0); /* FIXME: loses any snoop info */ - simple_type = header_content_type_simple(((CamelDataWrapper *)pobject->part)->mime_type); + simple_type = camel_content_type_simple (((CamelDataWrapper *)pobject->part)->mime_type); camel_strdown(simple_type); /* cache? */ /* FIXME: offline parts, just get icon */ - if (header_content_type_is(((CamelDataWrapper *)pobject->part)->mime_type, "image", "*")) { + if (camel_content_type_is (((CamelDataWrapper *)pobject->part)->mime_type, "image", "*")) { EMFormatHTMLJob *job; job = em_format_html_job_new(efh, efhd_write_icon_job, pobject); diff --git a/mail/em-format-html-quote.c b/mail/em-format-html-quote.c index 4333251186..d00b8bf5f7 100644 --- a/mail/em-format-html-quote.c +++ b/mail/em-format-html-quote.c @@ -194,7 +194,7 @@ efhq_multipart_related(EMFormat *emf, CamelStream *stream, CamelMimePart *part, /* FIXME: put in a function */ nparts = camel_multipart_get_number(mp); content_type = camel_mime_part_get_content_type(part); - start = header_content_type_param(content_type, "start"); + start = camel_content_type_param (content_type, "start"); if (start && strlen(start)>2) { int len; const char *cid; diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 9fa0210813..69d5a5497a 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -560,8 +560,8 @@ efh_text_plain(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFo /* Check for RFC 2646 flowed text. */ type = camel_mime_part_get_content_type(part); - if (header_content_type_is(type, "text", "plain") - && (format = header_content_type_param(type, "format")) + if (camel_content_type_is (type, "text", "plain") + && (format = camel_content_type_param (type, "format")) && !g_ascii_strcasecmp(format, "flowed")) flags |= CAMEL_MIME_FILTER_TOHTML_FORMAT_FLOWED; @@ -606,7 +606,7 @@ efh_text_plain(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFo CamelMimePart *newpart = camel_multipart_get_part(mp, i); type = camel_mime_part_get_content_type(newpart); - if (header_content_type_is(type, "text", "plain")) { + if (camel_content_type_is (type, "text", "plain")) { camel_stream_write_string(stream, "
\n"); em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, camel_medium_get_content_object((CamelMedium *)newpart)); camel_stream_flush((CamelStream *)filtered_stream); @@ -697,7 +697,7 @@ efh_message_external(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part /* needs to be cleaner */ type = camel_mime_part_get_content_type(part); - access_type = header_content_type_param(type, "access-type"); + access_type = camel_content_type_param (type, "access-type"); if (!access_type) { camel_stream_printf(stream, _("Malformed external-body part.")); return; @@ -709,10 +709,10 @@ efh_message_external(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part char *path; char ftype[16]; - name = header_content_type_param(type, "name"); - site = header_content_type_param(type, "site"); - dir = header_content_type_param(type, "directory"); - mode = header_content_type_param(type, "mode"); + name = camel_content_type_param (type, "name"); + site = camel_content_type_param (type, "site"); + dir = camel_content_type_param (type, "directory"); + mode = camel_content_type_param (type, "mode"); if (name == NULL || site == NULL) goto fail; @@ -733,8 +733,8 @@ efh_message_external(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part } else if (!g_ascii_strcasecmp (access_type, "local-file")) { const char *name, *site; - name = header_content_type_param (type, "name"); - site = header_content_type_param (type, "site"); + name = camel_content_type_param (type, "name"); + site = camel_content_type_param (type, "site"); if (name == NULL) goto fail; @@ -749,7 +749,7 @@ efh_message_external(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part /* RFC 2017 */ - urlparam = header_content_type_param (type, "url"); + urlparam = camel_content_type_param (type, "url"); if (urlparam == NULL) goto fail; @@ -830,7 +830,7 @@ efh_multipart_related(EMFormat *emf, CamelStream *stream, CamelMimePart *part, c nparts = camel_multipart_get_number(mp); content_type = camel_mime_part_get_content_type(part); - start = header_content_type_param(content_type, "start"); + start = camel_content_type_param (content_type, "start"); if (start && strlen(start)>2) { int len; const char *cid; @@ -1022,7 +1022,7 @@ static EMFormatHandler type_builtin_table[] = { { "text/plain", (EMFormatFunc)efh_text_plain }, { "text/html", (EMFormatFunc)efh_text_html }, { "text/richtext", (EMFormatFunc)efh_text_enriched }, - /*{ "text/*", (EMFormatFunc)efh_text_plain },*/ + /*{ "text/ *", (EMFormatFunc)efh_text_plain },*/ { "message/external-body", (EMFormatFunc)efh_message_external }, { "multipart/signed", (EMFormatFunc)efh_multipart_signed }, { "multipart/related", (EMFormatFunc)efh_multipart_related }, @@ -1376,7 +1376,7 @@ efh_format_header(EMFormat *emf, CamelStream *stream, CamelMedium *part, const c return; /* Show the local timezone equivalent in brackets if the sender is remote */ - msg_date = header_decode_date(date, &msg_offset); + msg_date = camel_header_decode_date (date, &msg_offset); e_localtime_with_offset(msg_date, &local, &local_tz); /* Convert message offset to minutes (e.g. -0400 --> -240) */ @@ -1408,7 +1408,7 @@ efh_format_header(EMFormat *emf, CamelStream *stream, CamelMedium *part, const c flags |= EM_FORMAT_HEADER_BOLD; } else { txt = camel_medium_get_header(part, name); - value = header_decode_string(txt, charset); + value = camel_header_decode_string (txt, charset); txt = value; label = namein; } @@ -1429,7 +1429,7 @@ em_format_html_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMediu #define emf ((EMFormat *)efh) ct = camel_mime_part_get_content_type((CamelMimePart *)part); - charset = header_content_type_param(ct, "charset"); + charset = camel_content_type_param (ct, "charset"); charset = e_iconv_charset_name(charset); if (!efh->simple_headers) @@ -1447,7 +1447,7 @@ em_format_html_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMediu /* dump selected headers */ h = (EMFormatHeader *)emf->header_list.head; if (h->next == NULL || emf->mode == EM_FORMAT_ALLHEADERS) { - struct _header_raw *header; + struct _camel_header_raw *header; header = ((CamelMimePart *)part)->headers; while (header) { diff --git a/mail/em-format-quote.c b/mail/em-format-quote.c index 113d854fc5..1b26ff255e 100644 --- a/mail/em-format-quote.c +++ b/mail/em-format-quote.c @@ -214,8 +214,8 @@ emfq_text_plain(EMFormatQuote *emfq, CamelStream *stream, CamelMimePart *part, E /* Check for RFC 2646 flowed text. */ type = camel_mime_part_get_content_type(part); - if (header_content_type_is(type, "text", "plain") - && (format = header_content_type_param(type, "format")) + if (camel_content_type_is (type, "text", "plain") + && (format = camel_content_type_param (type, "format")) && !g_ascii_strcasecmp(format, "flowed")) flags |= CAMEL_MIME_FILTER_TOHTML_FORMAT_FLOWED; diff --git a/mail/em-format.c b/mail/em-format.c index 1c53377829..42fe1a2971 100644 --- a/mail/em-format.c +++ b/mail/em-format.c @@ -717,9 +717,9 @@ int em_format_is_attachment(EMFormat *emf, CamelMimePart *part) CamelDataWrapper *dw = camel_medium_get_content_object((CamelMedium *)part); /*printf("checking is attachment %s/%s\n", ct->type, ct->subtype);*/ - return !(/*header_content_type_is(ct, "message", "*") - ||*/ header_content_type_is(dw->mime_type, "multipart", "*") - || (header_content_type_is(dw->mime_type, "text", "*") + return !(/*camel_content_type_is (ct, "message", "*") + ||*/ camel_content_type_is (dw->mime_type, "multipart", "*") + || (camel_content_type_is (dw->mime_type, "text", "*") && camel_mime_part_get_filename(part) == NULL)); } @@ -754,7 +754,7 @@ int em_format_is_inline(EMFormat *emf, CamelMimePart *part) /* messages are always inline? */ ct = camel_mime_part_get_content_type(part); - return header_content_type_is(ct, "message", "*"); + return camel_content_type_is (ct, "message", "*"); } /** @@ -778,7 +778,7 @@ em_format_format_content(EMFormat *emf, CamelStream *stream, CamelMimePart *part { CamelDataWrapper *dw = camel_medium_get_content_object((CamelMedium *)part); - if (header_content_type_is(dw->mime_type, "text", "*")) + if (camel_content_type_is (dw->mime_type, "text", "*")) em_format_format_text(emf, stream, dw); else camel_data_wrapper_decode_to_stream(dw, stream); @@ -803,7 +803,7 @@ em_format_format_text(EMFormat *emf, CamelStream *stream, CamelDataWrapper *dw) if (emf->charset) { charset = emf->charset; } else if (dw->mime_type - && (charset = header_content_type_param(dw->mime_type, "charset")) + && (charset = camel_content_type_param (dw->mime_type, "charset")) && g_ascii_strncasecmp(charset, "iso-8859-", 9) == 0) { CamelMimeFilterWindows *windows; CamelStream *null; @@ -985,7 +985,7 @@ emf_multipart_alternative(EMFormat *emf, CamelStream *stream, CamelMimePart *par for (i = 0; i < nparts; i++) { CamelMimePart *part = camel_multipart_get_part(mp, i); CamelContentType *type = camel_mime_part_get_content_type (part); - char *mime_type = header_content_type_simple (type); + char *mime_type = camel_content_type_simple (type); camel_strdown (mime_type); @@ -1015,7 +1015,7 @@ emf_multipart_encrypted(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const char *protocol; /* Currently we only handle RFC2015-style PGP encryption. */ - protocol = header_content_type_param (((CamelDataWrapper *) part)->mime_type, "protocol"); + protocol = camel_content_type_param (((CamelDataWrapper *) part)->mime_type, "protocol"); if (!protocol || strcmp (protocol, "application/pgp-encrypted") != 0) return emf_multipart_mixed(emf, stream, part, info); @@ -1070,7 +1070,7 @@ emf_multipart_related(EMFormat *emf, CamelStream *stream, CamelMimePart *part, c /* FIXME: put this stuff in a shared function */ nparts = camel_multipart_get_number(mp); content_type = camel_mime_part_get_content_type(part); - start = header_content_type_param(content_type, "start"); + start = camel_content_type_param (content_type, "start"); if (start && strlen(start)>2) { int len; const char *cid; diff --git a/mail/em-popup.c b/mail/em-popup.c index d2b2ca1e6e..a7d8a90179 100644 --- a/mail/em-popup.c +++ b/mail/em-popup.c @@ -760,7 +760,9 @@ emp_standard_menu_factory(EMPopup *emp, EMPopupTarget *target, void *data) /* FIXME: use the snoop_part stuff from em-format.c */ if (apps == NULL && strcmp(target->data.part.mime_type, "application/octet-stream") == 0) { - const char *filename = camel_mime_part_get_filename(target->data.part.part), *name_type; + const char *filename, *name_type; + + filename = camel_mime_part_get_filename(target->data.part.part); if (filename) { /* GNOME-VFS will misidentify TNEF attachments as MPEG */ @@ -780,7 +782,7 @@ emp_standard_menu_factory(EMPopup *emp, EMPopupTarget *target, void *data) menus = g_slist_prepend(menus, (void *)&emp_standard_part_apps_bar); - for (l=apps;l;l=l->next) { + for (l = apps, i = 0; l; l = l->next, i++) { GnomeVFSMimeApplication *app = l->data; struct _open_in_item *item; @@ -809,6 +811,10 @@ emp_standard_menu_factory(EMPopup *emp, EMPopupTarget *target, void *data) items = emp_standard_object_popups; len = LEN(emp_standard_object_popups); break; } + default: + items = NULL; + len = 0; + g_assert_not_reached (); } for (i=0;ilen; i++) { @@ -1707,7 +1707,7 @@ em_utils_read_messages_from_stream(CamelFolder *folder, CamelStream *stream) camel_mime_parser_init_with_stream(mp, stream); camel_object_unref(stream); - while (camel_mime_parser_step(mp, 0, 0) == HSCAN_FROM) { + while (camel_mime_parser_step(mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM) { CamelMimeMessage *msg; /* NB: de-from filter, once written */ diff --git a/mail/importers/evolution-mbox-importer.c b/mail/importers/evolution-mbox-importer.c index ef31667e64..134f6b9233 100644 --- a/mail/importers/evolution-mbox-importer.c +++ b/mail/importers/evolution-mbox-importer.c @@ -133,7 +133,7 @@ process_item_fn (EvolutionImporter *eimporter, } ex = camel_exception_new (); - if (camel_mime_parser_step (mbi->mp, 0, 0) == HSCAN_FROM) { + if (camel_mime_parser_step (mbi->mp, 0, 0) == CAMEL_MIME_PARSER_STATE_FROM) { /* Import the next message */ CamelMimeMessage *msg; CamelMessageInfo *info; diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c index f396b00d43..ac116aea7d 100644 --- a/mail/mail-autofilter.c +++ b/mail/mail-autofilter.c @@ -265,7 +265,7 @@ rule_from_message (FilterRule *rule, RuleContext *context, CamelMimeMessage *msg if (flags & AUTO_MLIST) { char *name, *mlist; - mlist = header_raw_check_mailing_list(&((CamelMimePart *)msg)->headers); + mlist = camel_header_raw_check_mailing_list (&((CamelMimePart *)msg)->headers); if (mlist) { rule_match_mlist(context, rule, mlist); name = g_strdup_printf (_("%s mailing list"), mlist); diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 41fe74df55..605dce794e 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -1926,7 +1926,7 @@ save_prepare_part (CamelMimePart *mime_part) /* We want to save textual parts as 8bit instead of encoded */ type = camel_data_wrapper_get_mime_type_field (wrapper); - if (header_content_type_is (type, "text", "*")) + if (camel_content_type_is (type, "text", "*")) camel_mime_part_set_encoding (mime_part, CAMEL_MIME_PART_ENCODING_8BIT); } } @@ -2074,8 +2074,8 @@ save_part_save (struct _mail_msg *mm) data = camel_medium_get_content_object (CAMEL_MEDIUM (m->part)); content_type = camel_mime_part_get_content_type (m->part); - if (header_content_type_is (content_type, "text", "*") - && (charset = header_content_type_param (content_type, "charset")) + if (camel_content_type_is (content_type, "text", "*") + && (charset = camel_content_type_param (content_type, "charset")) && strcasecmp (charset, "utf-8") != 0) { charsetfilter = camel_mime_filter_charset_new_convert ("utf-8", charset); filtered_stream = (CamelStream *) camel_stream_filter_new_with_stream (stream_fs); diff --git a/mail/mail-session.c b/mail/mail-session.c index 66a41099b9..c2b233b1c6 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -579,7 +579,6 @@ main_get_filter_driver (CamelSession *session, const char *type, CamelException char *user, *system; GConfClient *gconf; RuleContext *fc; - long notify; gconf = mail_config_get_gconf_client (); diff --git a/mail/message-list.c b/mail/message-list.c index 80bedfb406..a462f412fb 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -1090,7 +1090,7 @@ ml_tree_value_at (ETreeModel *etm, ETreePath path, int col, void *model_data) tag = camel_tag_get ((CamelTag **) &msg_info->user_tags, "due-by"); if (tag && *tag) { - due_by = header_decode_date (tag, NULL); + due_by = camel_header_decode_date (tag, NULL); return GINT_TO_POINTER (due_by); } else { return GINT_TO_POINTER (0); @@ -1160,7 +1160,7 @@ ml_tree_value_at (ETreeModel *etm, ETreePath path, int col, void *model_data) time_t now = time (NULL); time_t target_date; - target_date = header_decode_date (due_by, NULL); + target_date = camel_header_decode_date (due_by, NULL); if (now >= target_date) { /* FIXME: extract from the xpm somehow. */ colour = "#A7453E"; diff --git a/mail/message-tag-followup.c b/mail/message-tag-followup.c index 6c8472bad5..6a2f62eaf6 100644 --- a/mail/message-tag-followup.c +++ b/mail/message-tag-followup.c @@ -149,7 +149,7 @@ get_tag_list (MessageTagEditor *editor) date = e_date_edit_get_time (followup->target_date); if (date != (time_t) -1) { - text = header_format_date (date, 0); + text = camel_header_format_date (date, 0); camel_tag_set (&tags, "due-by", text); g_free (text); } else { @@ -157,7 +157,7 @@ get_tag_list (MessageTagEditor *editor) } if (gtk_toggle_button_get_active (followup->completed)) { - text = header_format_date (followup->completed_date, 0); + text = camel_header_format_date (followup->completed_date, 0); camel_tag_set (&tags, "completed-on", text); g_free (text); } else { @@ -180,7 +180,7 @@ set_tag_list (MessageTagEditor *editor, CamelTag *tags) text = camel_tag_get (&tags, "due-by"); if (text && *text) { - date = header_decode_date (text, NULL); + date = camel_header_decode_date (text, NULL); e_date_edit_set_time (followup->target_date, date); } else { e_date_edit_set_time (followup->target_date, (time_t) -1); @@ -188,7 +188,7 @@ set_tag_list (MessageTagEditor *editor, CamelTag *tags) text = camel_tag_get (&tags, "completed-on"); if (text && *text) { - date = header_decode_date (text, NULL); + date = camel_header_decode_date (text, NULL); if (date != (time_t) 0) { gtk_toggle_button_set_active (followup->completed, TRUE); followup->completed_date = date; -- cgit v1.2.3