From f9804e11931411358ce98ad5a7726de6d68f2115 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Tue, 12 Nov 2002 14:59:35 +0000 Subject: Commented out stuff that doesn't build yet. Also fixed idl build rule. 2002-11-13 Not Zed * Makefile.am: Commented out stuff that doesn't build yet. Also fixed idl build rule. importers still not built. * main.c (main): bonobactivationise. remove push visual/colormap. (main): no longer activate activation, let bonobo_init do it. * mail-signature-editor.c (menu_help): Change help api. * mail-session.c (user_message_destroy_noreply): removed. Not used? * mail-local.c (load_metainfo): xml root->children. * mail-format.c (g_string_append_len): Removed, it exists now. 2002-11-12 Not Zed * subscribe-dialog.c: gnome2ised, use gtkdialog. (subscribe_get_global_extras): use a weak ref rather than destroy signal. * message-tag-followup.c: gnome2ised. * message-tag-editor.c: gnome2ised & converted to gtkdialog. * message-list.c: gnome2ised. (message_list_finalise): From destroy method. maybe should be destroy still. * message-browser.c: port to gnome2 (message_browser_finalise): renamed from destroy method. * mail-stream-gtkhtml.c: removed redundant camel_class_get_global_classfuncs() call. * mail-signature-editor.c: gtkdialogised, & bonobo api changes. * mail-search-dialogue.c: gtkdialogised. * mail-folder-cache.c: cleaned up camel ref/hook casts. * mail-composer-prefs.c (mail_composer_prefs_get_type): convert to gtype. * mail-font-prefs.c (mail_font_prefs_destroy): from finalise. * mail-config.c: s/bonobo_config/e_config_listener/ Added /apps/Evolution prefix to the evolution keys. Changed to use e_config_listener, etc. (mail_config_init): remove bonobo_config stuff. (mail_config_check_service): gtk dialogise. (check_response): from check_cancelled. * mail-config-druid.c (mail_config_druid_destroy): renamed from _finalize, turned into destroy handler. (construct): set type to toplevel, GTK_WINDOW_DIALOG no longer exists. * mail-config-factory.c (mail_config_register_factory): bonobo api changes. * mail-crypto.c (mail_crypto_get_pgp_cipher_context): cleaned up unref casts. * mail-display.c (write_data_to_file): gnome->gtkdialog. (on_link_clicked): use ascii_str*cmp on url. (save_part): g_path stuff. (launch_cb): gtk dialog. (pixmap_press): de-oafify. (pixbuf_for_mime_type): gnome-vfs api changes. (do_attachment_header): Change the pixmap to a gtkimage. (do_signature): " (pixbuf_gen_idle): " (do_attachment_header): ascii_str*cmp (do_attachment_header): gnome pixmap->gtkimage. (mail_display_destroy): protect against gtk mentalness. (html_button_press_event): ascii_str*cmp (drag_data_get_cb): added comment for translators of filename. * mail-format.c (component_supports): de-oafise. (is_anonymous): ascii_strncmp (attachment_header): remove utf8<>locale stuff, and gnomevfs api changes. (format_mime_part): fix g_strdown call. (write_field_row_begin): kill utf8->gtk stuff. (write_address): " (default_header_index): ascii_strcasecmp (handle_text_plain): " (handle_text_enriched): " (handle_multipart_encrypted): remove utf/gtk stuff. (handle_message_external_body): ascii_str*cmp * mail-identify.c (mail_identify_mime_part): (identify_by_magic): gnome vfs api changes. * mail-importer.c: Converted. * mail-local.c (load_metainfo): xml childs -> children. (mls_get_folder): g_strerror. (mls_delete_folder): g_strerror. (reconfigure_got_folder): Gnome->GtkDialog (reconfigure_response): from reconfigure_clicked. * mail-mt.c (mail_msg_check_error): gnome -> gtk dialog (error_response): renmae from error_gone. destroy widget on any response. * mail-offline-handler.c (impl_finalise): renamed from impl_destroy since thats what it should be anyway. * mail-ops.c: removed utf8 widget conversion & camel_object_un/ref casts. * mail-preferences.c (mail_preferences_get_type): glib2'ised. * mail-search.c (mail_search_finalise): renmaed from destroy & properly chain. (mail_search_get_type): glib2 & make gtkdialog parent. (entry_run_search): run search when entry activated. not sure if gtkdialog has anohter way to do this on an arbitrary widget. * mail-send-recv.c (dialogue_response): renamed from clicked. Use gtkdialog. * mail-session.c (request_password_deleted): removed, redundant. (pass_response): rename from pass_got, changed for gtkdialog. (user_message_destroy): Removed, redundant. (user_message_response): Renamed from user_message_clicked. 2002-11-11 Not Zed * mail-stream-gtkhtml.c (mail_stream_gtkhtml_class_init): dont use get_global_classfuncs, just get the type * mail-tools.c: converted gnome2 api's. * mail-vfolder.c (vfolder_editor_response): clicked->response. (vfolder_editor_destroy): Removed. (vfolder_edit): gtk dialog api (edit_rule_response): clicked->response. (vfolder_edit_rule): gnomedialog->gtkdialog. (vfolder_gui_add_rule): " (new_rule_clicked): clicked->response svn path=/trunk/; revision=18723 --- mail/mail-format.c | 190 ++++++++++++++++++++--------------------------------- 1 file changed, 73 insertions(+), 117 deletions(-) (limited to 'mail/mail-format.c') diff --git a/mail/mail-format.c b/mail/mail-format.c index 7590e717be..ba2f4571c5 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -30,10 +30,8 @@ #include #include -#include #include #include -#include #include #include #include @@ -44,7 +42,6 @@ #include #include #include -#include #include "mail.h" #include "mail-tools.h" @@ -354,18 +351,19 @@ setup_mime_tables (void) } static gboolean -component_supports (OAF_ServerInfo *component, const char *mime_type) +component_supports (Bonobo_ServerInfo *component, const char *mime_type) { - OAF_Property *prop; + Bonobo_ActivationProperty *prop; CORBA_sequence_CORBA_string stringv; int i; - prop = oaf_server_info_prop_find (component, "repo_ids"); - if (!prop || prop->v._d != OAF_P_STRINGV) + prop = bonobo_server_info_prop_find (component, "repo_ids"); + if (!prop || prop->v._d != Bonobo_ACTIVATION_P_STRINGV) return FALSE; stringv = prop->v._u.value_stringv; for (i = 0; i < stringv._length; i++) { + /* FIXME: ascii_strcasecmp? */ if (!g_strcasecmp ("IDL:Bonobo/PersistStream:1.0", stringv._buffer[i])) break; } @@ -375,9 +373,9 @@ component_supports (OAF_ServerInfo *component, const char *mime_type) if (i >= stringv._length) return FALSE; - prop = oaf_server_info_prop_find (component, - "bonobo:supported_mime_types"); - if (!prop || prop->v._d != OAF_P_STRINGV) + prop = bonobo_server_info_prop_find (component, + "bonobo:supported_mime_types"); + if (!prop || prop->v._d != Bonobo_ACTIVATION_P_STRINGV) return FALSE; stringv = prop->v._u.value_stringv; @@ -448,7 +446,7 @@ mail_lookup_handler (const char *mime_type) if (component_supports (iter->data, mime_type)) { handler->generic = FALSE; handler->builtin = handle_via_bonobo; - handler->component = OAF_ServerInfo_duplicate (iter->data); + handler->component = Bonobo_ServerInfo_duplicate (iter->data); gnome_vfs_mime_component_list_free (components); goto reg; } @@ -505,11 +503,12 @@ mail_lookup_handler (const char *mime_type) static gboolean is_anonymous (CamelMimePart *part, const char *mime_type) { - if (!g_strncasecmp (mime_type, "multipart/", 10) || - !g_strncasecmp (mime_type, "message/", 8)) + /* FIXME: should use CamelContentType stuff */ + if (!g_ascii_strncasecmp (mime_type, "multipart/", 10) || + !g_ascii_strncasecmp (mime_type, "message/", 8)) return TRUE; - if (!g_strncasecmp (mime_type, "text/", 5) && + if (!g_ascii_strncasecmp (mime_type, "text/", 5) && !camel_mime_part_get_filename (part)) return TRUE; @@ -533,7 +532,7 @@ mail_part_is_inline (CamelMimePart *part) /* If it has an explicit disposition, return that. */ disposition = camel_mime_part_get_disposition (part); if (disposition) - return g_strcasecmp (disposition, "inline") == 0; + return g_ascii_strcasecmp (disposition, "inline") == 0; /* Certain types should default to inline. FIXME: this should * be customizable. @@ -630,7 +629,7 @@ static void attachment_header (CamelMimePart *part, const char *mime_type, MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream) { - char *htmlinfo, *html_str, *fmt; + char *htmlinfo; const char *info; /* Start the table, create the pop-up object. */ @@ -649,14 +648,10 @@ attachment_header (CamelMimePart *part, const char *mime_type, MailDisplay *md, /* Write the MIME type */ - info = gnome_vfs_mime_get_value (mime_type, "description"); - html_str = e_text_to_html (info ? info : mime_type, 0); - htmlinfo = e_utf8_from_locale_string (html_str); - g_free (html_str); - fmt = e_utf8_from_locale_string (_("%s attachment")); - gtk_html_stream_printf (stream, fmt, htmlinfo); + info = gnome_vfs_mime_get_description(mime_type); + htmlinfo = e_text_to_html (info ? info : mime_type, 0); + gtk_html_stream_printf (stream, _("%s attachment"), htmlinfo); g_free (htmlinfo); - g_free (fmt); /* Write the name, if we have it. */ info = camel_mime_part_get_filename (part); @@ -684,7 +679,7 @@ format_mime_part (CamelMimePart *part, MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream) { CamelDataWrapper *wrapper; - char *mime_type; + char *mime_type, *tmp; MailMimeHandler *handler; gboolean output; int inline_flags; @@ -698,14 +693,15 @@ format_mime_part (CamelMimePart *part, MailDisplay *md, if (CAMEL_IS_MULTIPART (wrapper) && camel_multipart_get_number (CAMEL_MULTIPART (wrapper)) == 0) { - mail_error_printf (html, stream, "\n%s\n", U_("Could not parse MIME message. Displaying as source.")); + mail_error_printf (html, stream, "\n%s\n", _("Could not parse MIME message. Displaying as source.")); if (mail_content_loaded (wrapper, md, TRUE, NULL, html, NULL)) handle_text_plain (part, "text/plain", md, html, stream); return TRUE; } - mime_type = camel_data_wrapper_get_mime_type (wrapper); - g_strdown (mime_type); + tmp = camel_data_wrapper_get_mime_type (wrapper); + mime_type = g_ascii_strdown (tmp, strlen(tmp)); + g_free(tmp); handler = mail_lookup_handler (mime_type); if (!handler) { @@ -753,23 +749,18 @@ enum { static void write_field_row_begin (const char *name, gint flags, GtkHTML *html, GtkHTMLStream *stream) { - char *encoded_name; gboolean bold = (flags & WRITE_BOLD); gboolean nocolumns = (flags & WRITE_NOCOLUMNS); - encoded_name = e_utf8_from_gtk_string (GTK_WIDGET (html), name); - if (nocolumns) { gtk_html_stream_printf (stream, "%s%s:%s ", - bold ? "" : "", encoded_name, + bold ? "" : "", name, bold ? "" : ""); } else { gtk_html_stream_printf (stream, "<%s align=\"right\" valign=\"top\">%s:" " ", bold ? "th" : "td", - encoded_name, bold ? "th" : "td"); + name, bold ? "th" : "td"); } - - g_free (encoded_name); } static void @@ -828,7 +819,7 @@ write_address (MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream, camel_internet_address_add (subaddr, name, email); addr_txt = camel_address_format (CAMEL_ADDRESS (subaddr)); addr_url = camel_url_encode (addr_txt, TRUE, NULL); - camel_object_unref (CAMEL_OBJECT (subaddr)); + camel_object_unref (subaddr); if (have_name) { name_disp = e_text_to_html (name, 0); @@ -865,11 +856,7 @@ write_address (MailDisplay *md, GtkHTML *html, GtkHTMLStream *stream, } } else { - char *str; - - str = e_utf8_from_locale_string (_("Bad Address")); - gtk_html_stream_printf (stream, "%s", str); - g_free (str); + gtk_html_stream_printf (stream, "%s", _("Bad Address")); } g_free (name_disp); @@ -895,7 +882,7 @@ default_header_index(const char *name) int i; for (i=0;irawtext || (mail_display && mail_display->charset)) { CamelMimeFilterCharset *filter; @@ -1144,7 +1131,7 @@ mail_format_get_data_wrapper_text (CamelDataWrapper *wrapper, MailDisplay *mail_ filter = camel_mime_filter_charset_new_convert ("utf-8", charset); if (filter) { camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (filter)); - camel_object_unref (CAMEL_OBJECT (filter)); + camel_object_unref (filter); } } @@ -1157,13 +1144,13 @@ mail_format_get_data_wrapper_text (CamelDataWrapper *wrapper, MailDisplay *mail_ filter = camel_mime_filter_charset_new_convert (charset, "utf-8"); if (filter) { camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (filter)); - camel_object_unref (CAMEL_OBJECT (filter)); + camel_object_unref (filter); } } camel_data_wrapper_write_to_stream (wrapper, CAMEL_STREAM (filtered_stream)); camel_stream_flush (CAMEL_STREAM (filtered_stream)); - camel_object_unref (CAMEL_OBJECT (filtered_stream)); + camel_object_unref (filtered_stream); for (text = ba->data, end = text + ba->len; text < end; text++) { if (!isspace ((unsigned char) *text)) @@ -1240,6 +1227,7 @@ handle_text_plain (CamelMimePart *part, const char *mime_type, g_byte_array_free (bytes, FALSE); /* Check to see if this is a broken text/html part with content-type text/plain */ + /* NOTE: isn't this done in camel now ? */ start = text; while (isspace ((unsigned) *start)) start++; @@ -1259,7 +1247,7 @@ handle_text_plain (CamelMimePart *part, const char *mime_type, * has decided to call text/plain because it starts with English * text...) */ - check_specials = !g_strcasecmp (mime_type, "text/plain"); + check_specials = !g_ascii_strcasecmp (mime_type, "text/plain"); p = text; while (p && check_specials) { @@ -1400,10 +1388,10 @@ fake_mime_part_from_data (const char *data, int len, const char *type, wrapper = camel_data_wrapper_new (); camel_data_wrapper_construct_from_stream (wrapper, memstream); camel_data_wrapper_set_mime_type (wrapper, type); - camel_object_unref (CAMEL_OBJECT (memstream)); + camel_object_unref (memstream); part = camel_mime_part_new (); camel_medium_set_content_object (CAMEL_MEDIUM (part), wrapper); - camel_object_unref (CAMEL_OBJECT (wrapper)); + camel_object_unref (wrapper); camel_mime_part_set_disposition (part, "inline"); g_hash_table_insert (fake_parts, GUINT_TO_POINTER (offset), part); @@ -1468,8 +1456,7 @@ try_uudecoding (char *start, CamelMimePart *mime_part, g_free (out); camel_mime_part_set_filename (part, filename); g_free (filename); - camel_object_hook_event (CAMEL_OBJECT (md->current_message), - "finalize", destroy_part, part); + camel_object_hook_event (md->current_message, "finalize", destroy_part, part); write_hr (html, stream); format_mime_part (part, md, html, stream); @@ -1498,8 +1485,7 @@ try_inline_binhex (char *start, CamelMimePart *mime_part, part = fake_mime_part_from_data (start, p - start, "application/mac-binhex40", offset, md); - camel_object_hook_event (CAMEL_OBJECT (md->current_message), - "finalize", destroy_part, part); + camel_object_hook_event (md->current_message, "finalize", destroy_part, part); write_hr (html, stream); format_mime_part (part, md, html, stream); @@ -1507,18 +1493,6 @@ try_inline_binhex (char *start, CamelMimePart *mime_part, return p; } -static void -g_string_append_len (GString *string, const char *str, int len) -{ - char *tmp; - - tmp = g_malloc (len + 1); - tmp[len] = 0; - memcpy (tmp, str, len); - g_string_append (string, tmp); - g_free (tmp); -} - /* text/enriched (RFC 1896) or text/richtext (included in RFC 1341) */ static gboolean handle_text_enriched (CamelMimePart *part, const char *mime_type, @@ -1535,7 +1509,8 @@ handle_text_enriched (CamelMimePart *part, const char *mime_type, if (!translations) { translations = g_hash_table_new (g_strcase_hash, g_strcase_equal); - + + /* FIXME: this should be read from a table */ g_hash_table_insert (translations, "bold", ""); g_hash_table_insert (translations, "/bold", ""); g_hash_table_insert (translations, "italic", ""); @@ -1570,7 +1545,7 @@ handle_text_enriched (CamelMimePart *part, const char *mime_type, if (!bytes) return FALSE; - if (!g_strcasecmp (mime_type, "text/richtext")) { + if (!g_ascii_strcasecmp (mime_type, "text/richtext")) { enriched = FALSE; mail_html_write (html, stream, "\n\n"); @@ -1665,8 +1640,7 @@ handle_text_enriched (CamelMimePart *part, const char *mime_type, g_free (text); ba = g_byte_array_new (); - g_byte_array_append (ba, (const guint8 *)string->str, - string->len); + g_byte_array_append (ba, (const guint8 *)string->str, string->len); g_string_free (string, TRUE); xed = g_strdup_printf ("x-evolution-data:%p", part); @@ -1727,7 +1701,7 @@ handle_multipart_mixed (CamelMimePart *part, const char *mime_type, gboolean output = FALSE; if (!CAMEL_IS_MULTIPART (wrapper)) { - mail_error_printf (html, stream, "\n%s\n", U_("Could not parse MIME message. Displaying as source.")); + mail_error_printf (html, stream, "\n%s\n", _("Could not parse MIME message. Displaying as source.")); if (mail_content_loaded (wrapper, md, TRUE, NULL, html, NULL)) handle_text_plain (part, "text/plain", md, html, stream); return TRUE; @@ -1773,13 +1747,7 @@ handle_multipart_encrypted (CamelMimePart *part, const char *mime_type, camel_object_unref (cipher); if (camel_exception_is_set (&ex)) { - char *error; - - error = e_utf8_from_locale_string (camel_exception_get_description (&ex)); - - mail_error_printf (html, stream, "\n%s\n", error); - g_free (error); - + mail_error_printf (html, stream, "\n%s\n", camel_exception_get_description(&ex)); camel_exception_clear (&ex); return TRUE; } @@ -1802,7 +1770,7 @@ handle_multipart_signed (CamelMimePart *part, const char *mime_type, wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part)); if (!CAMEL_IS_MULTIPART_SIGNED (wrapper)) { - mail_error_printf (html, stream, "\n%s\n", U_("Could not parse MIME message. Displaying as source.")); + mail_error_printf (html, stream, "\n%s\n", _("Could not parse MIME message. Displaying as source.")); if (mail_content_loaded (wrapper, md, TRUE, NULL, html, NULL)) handle_text_plain (part, "text/plain", md, html, stream); return TRUE; @@ -1845,8 +1813,8 @@ handle_multipart_signed (CamelMimePart *part, const char *mime_type, mail_display_add_url (md, "part_urls", url, subpart); mail_html_write (html, stream, - U_("This message is digitally signed. " - "Click the lock icon for more information.")); + _("This message is digitally signed. " + "Click the lock icon for more information.")); mail_html_write (html, stream, "" @@ -1864,7 +1832,7 @@ handle_multipart_signed (CamelMimePart *part, const char *mime_type, cipher = camel_gpg_context_new (session); if (cipher) { valid = camel_multipart_signed_verify (mps, cipher, &ex); - camel_object_unref (CAMEL_OBJECT (cipher)); + camel_object_unref (cipher); if (valid) { good = camel_cipher_validity_get_valid (valid); message = camel_cipher_validity_get_description (valid); @@ -1872,7 +1840,7 @@ handle_multipart_signed (CamelMimePart *part, const char *mime_type, message = camel_exception_get_description (&ex); } } else { - message = U_("Could not create a PGP verfication context"); + message = _("Could not create a PGP verfication context"); } if (good) { @@ -1881,16 +1849,16 @@ handle_multipart_signed (CamelMimePart *part, const char *mime_type, "" "
%s

", mail_display_get_url_for_icon (md, EVOLUTION_ICONSDIR "/pgp-signature-ok.png"), - U_("This message is digitally signed and " - "has been found to be authentic.")); + _("This message is digitally signed and " + "has been found to be authentic.")); } else { gtk_html_stream_printf (stream, "" "" "
%s

", mail_display_get_url_for_icon (md, EVOLUTION_ICONSDIR "/pgp-signature-bad.png"), - U_("This message is digitally signed but can " - "not be proven to be authentic.")); + _("This message is digitally signed but can " + "not be proven to be authentic.")); } if (message) { @@ -1922,7 +1890,7 @@ handle_multipart_related (CamelMimePart *part, const char *mime_type, int ret; if (!CAMEL_IS_MULTIPART (wrapper)) { - mail_error_printf (html, stream, "\n%s\n", U_("Could not parse MIME message. Displaying as source.")); + mail_error_printf (html, stream, "\n%s\n", _("Could not parse MIME message. Displaying as source.")); if (mail_content_loaded (wrapper, md, TRUE, NULL, html, NULL)) handle_text_plain (part, "text/plain", md, html, stream); return TRUE; @@ -2047,7 +2015,7 @@ handle_multipart_alternative (CamelMimePart *part, const char *mime_type, CamelMimePart *mime_part; if (!CAMEL_IS_MULTIPART (wrapper)) { - mail_error_printf (html, stream, "\n%s\n", U_("Could not parse MIME message. Displaying as source.")); + mail_error_printf (html, stream, "\n%s\n", _("Could not parse MIME message. Displaying as source.")); if (mail_content_loaded (wrapper, md, TRUE, NULL, html, NULL)) handle_text_plain (part, "text/plain", md, html, stream); return TRUE; @@ -2072,7 +2040,7 @@ handle_multipart_appledouble (CamelMimePart *part, const char *mime_type, CamelMultipart *multipart; if (!CAMEL_IS_MULTIPART (wrapper)) { - mail_error_printf (html, stream, "\n%s\n", U_("Could not parse MIME message. Displaying as source.")); + mail_error_printf (html, stream, "\n%s\n", _("Could not parse MIME message. Displaying as source.")); if (mail_content_loaded (wrapper, md, TRUE, NULL, html, NULL)) handle_text_plain (part, "text/plain", md, html, stream); return TRUE; @@ -2111,15 +2079,14 @@ handle_message_external_body (CamelMimePart *part, const char *mime_type, CamelContentType *type; const char *access_type; char *url = NULL, *desc = NULL; - char *fmt; - + type = camel_mime_part_get_content_type (part); access_type = header_content_type_param (type, "access-type"); if (!access_type) goto fallback; - if (!g_strcasecmp (access_type, "ftp") || - !g_strcasecmp (access_type, "anon-ftp")) { + if (!g_ascii_strcasecmp (access_type, "ftp") || + !g_ascii_strcasecmp (access_type, "anon-ftp")) { const char *name, *site, *dir, *mode, *ftype; char *path; @@ -2154,10 +2121,8 @@ handle_message_external_body (CamelMimePart *part, const char *mime_type, url = g_strdup_printf ("ftp://%s%s%s", site, path, ftype); g_free (path); - fmt = e_utf8_from_locale_string (_("Pointer to FTP site (%s)")); - desc = g_strdup_printf (fmt, url); - g_free (fmt); - } else if (!g_strcasecmp (access_type, "local-file")) { + desc = g_strdup_printf (_("Pointer to FTP site (%s)"), url); + } else if (!g_ascii_strcasecmp (access_type, "local-file")) { const char *name, *site; name = header_content_type_param (type, "name"); @@ -2168,16 +2133,12 @@ handle_message_external_body (CamelMimePart *part, const char *mime_type, url = g_strdup_printf ("file://%s%s", *name == '/' ? "" : "/", name); if (site) { - fmt = e_utf8_from_locale_string (_("Pointer to local file (%s) " - "valid at site \"%s\"")); - desc = g_strdup_printf (fmt, name, site); - g_free (fmt); + desc = g_strdup_printf(_("Pointer to local file (%s) " + "valid at site \"%s\""), name, site); } else { - fmt = e_utf8_from_locale_string (_("Pointer to local file (%s)")); - desc = g_strdup_printf (fmt, name); - g_free (fmt); + desc = g_strdup_printf(_("Pointer to local file (%s)"), name); } - } else if (!g_strcasecmp (access_type, "URL")) { + } else if (!g_ascii_strcasecmp (access_type, "URL")) { const char *urlparam; char *s, *d; @@ -2202,20 +2163,15 @@ handle_message_external_body (CamelMimePart *part, const char *mime_type, } *d = *s; - fmt = e_utf8_from_locale_string (_("Pointer to remote data (%s)")); - desc = g_strdup_printf (fmt, url); - g_free (fmt); + desc = g_strdup_printf(_("Pointer to remote data (%s)"), url); } fallback: if (!desc) { - if (access_type) { - fmt = e_utf8_from_locale_string (_("Pointer to unknown external data " - "(\"%s\" type)")); - desc = g_strdup_printf (fmt, access_type); - g_free (fmt); - } else - desc = e_utf8_from_locale_string (_("Malformed external-body part.")); + if (access_type) + desc = g_strdup_printf (_("Pointer to unknown external data (\"%s\" type)"), access_type); + else + desc = g_strdup(_("Malformed external-body part.")); } #if 0 /* FIXME */ -- cgit