From 448d624c00f0c4e12917a4d31babd10555b2e8a4 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 18 Dec 2005 08:24:26 +0000 Subject: em-folder-browser.c em-folder-view.c em-format-html.c 2005-12-18 Tor Lillqvist * em-folder-browser.c * em-folder-view.c * em-format-html.c * em-format-html-display.c * em-mailer-prefs.c * em-message-browser.c * em-migrate.c * em-subscribe-editor.c * em-sync-stream.c * em-utils.c * em-vfolder-editor.c * em-vfolder-rule.c * mail-autofilter.c * mail-component.c * mail-config.c * mail-folder-cache.c: Use gstdio wrappers. Construct pathnames of glade, xml, etspec and png files at run-time. Use g_filename_{to,from}_uri(). * em-folder-browser.c (emfb_init) * em-folder-view.c (emfv_finalise) * em-message-browser.c (emmb_init): As EMFolderView::ui_files now always is a list of filenames constructed with g_build_filename(), use g_free() on each list entry before calling g_slist_free() on the list. * em-folder-tree-model.c (em_folder_tree_model_load_state): Use e_xml_parse_file(). * em-migrate.c: Bypass all the code for upgrading from 1.x on Win32. (emm_setup_initial): Use GDir instead of dirent. * em-sync-stream.c * mail-folder-cache.c: Use pthread_equal() to compare pthread_t values. * em-vfs-stream.c: No EINPROGRESS or ELOOP on Win32. svn path=/trunk/; revision=30854 --- mail/em-format-html-display.c | 46 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) (limited to 'mail/em-format-html-display.c') diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index ec26935242..e485631ee4 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -26,6 +26,17 @@ #include +#include +#include + +#ifdef G_OS_WIN32 +/* Work around 'DATADIR' and 'interface' lossage in */ +#define DATADIR crap_DATADIR +#include +#undef DATADIR +#undef interface +#endif + #include #include #include @@ -68,8 +79,8 @@ #include #include -/* should this be in e-util rather than gal? */ #include +#include #include #include @@ -545,13 +556,19 @@ em_format_html_display_search(EMFormatHTMLDisplay *efhd) { struct _EMFormatHTMLDisplayPrivate *p = efhd->priv; GladeXML *xml; + char *gladefile; if (p->search_dialog) { gdk_window_raise(((GtkWidget *)p->search_dialog)->window); return; } - xml = glade_xml_new (EVOLUTION_GLADEDIR "/mail-dialogs.glade", "search_message_dialog", NULL); + gladefile = g_build_filename (EVOLUTION_GLADEDIR, + "mail-dialogs.glade", + NULL); + xml = glade_xml_new (gladefile, "search_message_dialog", NULL); + g_free (gladefile); + if (xml == NULL) { g_warning("Cannot open search dialog glade file"); /* ?? */ @@ -855,12 +872,18 @@ efhd_xpkcs7mime_validity_clicked(GtkWidget *button, EMFormatHTMLPObject *pobject struct _smime_pobject *po = (struct _smime_pobject *)pobject; GladeXML *xml; GtkWidget *vbox, *w; + char *gladefile; if (po->widget) /* FIXME: window raise? */ return; - xml = glade_xml_new(EVOLUTION_GLADEDIR "/mail-dialogs.glade", "message_security_dialog", NULL); + gladefile = g_build_filename (EVOLUTION_GLADEDIR, + "mail-dialogs.glade", + NULL); + xml = glade_xml_new(gladefile, "message_security_dialog", NULL); + g_free (gladefile); + po->widget = glade_xml_get_widget(xml, "message_security_dialog"); vbox = glade_xml_get_widget(xml, "signature_vbox"); @@ -1285,7 +1308,7 @@ static void efhd_drag_data_get(GtkWidget *w, GdkDragContext *drag, GtkSelectionData *data, guint info, guint time, EMFormatHTMLPObject *pobject) { CamelMimePart *part = pobject->part; - char *uri, *path; + char *uri, *uri_crlf, *path; CamelStream *stream; switch (info) { @@ -1319,10 +1342,12 @@ efhd_drag_data_get(GtkWidget *w, GdkDragContext *drag, GtkSelectionData *data, g if (path == NULL) return; - uri = g_strdup_printf("file://%s\r\n", path); + uri = g_filename_to_uri(path, NULL, NULL); g_free(path); - gtk_selection_data_set(data, data->target, 8, uri, strlen(uri)); - g_object_set_data_full((GObject *)w, "e-drag-uri", uri, g_free); + uri_crlf = g_strconcat(uri, "\r\n", NULL); + g_free(uri); + gtk_selection_data_set(data, data->target, 8, uri_crlf, strlen(uri_crlf)); + g_object_set_data_full((GObject *)w, "e-drag-uri", uri_crlf, g_free); break; default: abort(); @@ -1338,7 +1363,12 @@ efhd_drag_data_delete(GtkWidget *w, GdkDragContext *drag, EMFormatHTMLPObject *p if (uri) { /* NB: this doesn't kill the dnd directory */ /* NB: is this ever called? */ - unlink(uri+7); + /* NB even more: doesn't the e-drag-uri have \r\n + * appended? (see efhd_drag_data_get()) + */ + char *filename = g_filename_from_uri (uri, NULL, NULL); + g_unlink(filename); + g_free(filename); g_object_set_data((GObject *)w, "e-drag-uri", NULL); } } -- cgit v1.2.3