aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html-display.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2005-12-18 16:24:26 +0800
committerTor Lillqvist <tml@src.gnome.org>2005-12-18 16:24:26 +0800
commit448d624c00f0c4e12917a4d31babd10555b2e8a4 (patch)
treec44c6e6864f1e0cd34455da2e71fc33ca13d61e6 /mail/em-format-html-display.c
parent2f1a024be76933ba28ab80e76a52ff46358e33dd (diff)
downloadgsoc2013-evolution-448d624c00f0c4e12917a4d31babd10555b2e8a4.tar.gz
gsoc2013-evolution-448d624c00f0c4e12917a4d31babd10555b2e8a4.tar.zst
gsoc2013-evolution-448d624c00f0c4e12917a4d31babd10555b2e8a4.zip
em-folder-browser.c em-folder-view.c em-format-html.c
2005-12-18 Tor Lillqvist <tml@novell.com> * 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
Diffstat (limited to 'mail/em-format-html-display.c')
-rw-r--r--mail/em-format-html-display.c46
1 files changed, 38 insertions, 8 deletions
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 <string.h>
+#include <glib.h>
+#include <glib/gstdio.h>
+
+#ifdef G_OS_WIN32
+/* Work around 'DATADIR' and 'interface' lossage in <windows.h> */
+#define DATADIR crap_DATADIR
+#include <windows.h>
+#undef DATADIR
+#undef interface
+#endif
+
#include <gtkhtml/gtkhtml.h>
#include <gtkhtml/gtkhtml-embedded.h>
#include <gtkhtml/gtkhtml-search.h>
@@ -68,8 +79,8 @@
#include <camel/camel-folder.h>
#include <camel/camel-string-utils.h>
-/* should this be in e-util rather than gal? */
#include <e-util/e-util.h>
+#include <e-util/e-util-private.h>
#include <libedataserver/e-msgport.h>
#include <e-util/e-gui-utils.h>
@@ -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);
}
}