aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFridrich Strba <FStrba@novell.com>2009-05-04 13:20:43 +0800
committerBharath Acharya <abharath@novell.com>2009-05-04 13:20:43 +0800
commitb1ce347c60977b7e39080f441f5183939e12be79 (patch)
treed17423f3a1da80ca066708267b0d6daa5d53f291
parent63fbfd1d428e57955f066683d3610e91bf051ae2 (diff)
downloadgsoc2013-evolution-b1ce347c60977b7e39080f441f5183939e12be79.tar
gsoc2013-evolution-b1ce347c60977b7e39080f441f5183939e12be79.tar.gz
gsoc2013-evolution-b1ce347c60977b7e39080f441f5183939e12be79.tar.bz2
gsoc2013-evolution-b1ce347c60977b7e39080f441f5183939e12be79.tar.lz
gsoc2013-evolution-b1ce347c60977b7e39080f441f5183939e12be79.tar.xz
gsoc2013-evolution-b1ce347c60977b7e39080f441f5183939e12be79.tar.zst
gsoc2013-evolution-b1ce347c60977b7e39080f441f5183939e12be79.zip
Assure that the filename <-> uri conversion are done
with g_filename_{to,from}_uri and not by concatenating strings which is broken with win32-style uris.
-rw-r--r--calendar/gui/e-cal-popup.c2
-rw-r--r--calendar/gui/migration.c2
-rw-r--r--composer/e-msg-composer.c2
-rw-r--r--mail/em-format-html-display.c2
-rw-r--r--mail/mail-ops.c4
5 files changed, 6 insertions, 6 deletions
diff --git a/calendar/gui/e-cal-popup.c b/calendar/gui/e-cal-popup.c
index b9f0d5f8d5..f7508bb963 100644
--- a/calendar/gui/e-cal-popup.c
+++ b/calendar/gui/e-cal-popup.c
@@ -136,7 +136,7 @@ temp_save_part(CamelMimePart *part, char *path, gboolean file)
if (strstr (path, "://"))
usepath = path;
else
- usepath = g_strjoin (NULL, "file://", path, NULL);
+ usepath = g_filename_to_uri (path, NULL, NULL);
wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (part));
stream = camel_stream_vfs_new_with_uri (usepath, CAMEL_STREAM_VFS_CREATE);
diff --git a/calendar/gui/migration.c b/calendar/gui/migration.c
index 80d58b67fd..c0059a79fe 100644
--- a/calendar/gui/migration.c
+++ b/calendar/gui/migration.c
@@ -317,7 +317,7 @@ migrate_ical_folder_to_source (char *old_path, ESource *new_source, ECalSourceTy
ECal *old_ecal = NULL, *new_ecal = NULL;
ESource *old_source;
ESourceGroup *group;
- char *old_uri = g_strdup_printf ("file://%s", old_path);
+ char *old_uri = g_filename_to_uri (old_path, NULL, NULL);
GError *error = NULL;
gboolean retval = FALSE;
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index b509a97ce8..7063861e93 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -2498,7 +2498,7 @@ msg_composer_paste_clipboard (GtkhtmlEditor *editor)
if (filename && gdk_pixbuf_save (pixbuf, filename, "png", NULL, NULL)) {
if (gtkhtml_editor_get_html_mode (editor)) {
- char *uri = g_strconcat ("file://", filename, NULL);
+ char *uri = g_filename_to_uri (filename, NULL, NULL);
/* this loads image async, thus cannot remove file from this */
gtkhtml_editor_insert_image (editor, uri);
g_free (uri);
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index bef662452f..b7ed95b951 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -815,7 +815,7 @@ efhd_get_uri_puri (GtkWidget *html, GdkEventButton *event, EMFormatHTMLDisplay *
if (img_url) {
if (!(strstr (img_url, "://") || g_ascii_strncasecmp (img_url, "cid:", 4) == 0)) {
- char *u = g_strconcat ("file://", img_url, NULL);
+ char *u = g_filename_to_uri (img_url, NULL, NULL);
g_free (img_url);
img_url = u;
}
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 5d9386b6c0..9368ee61c8 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -2062,7 +2062,7 @@ save_messages_exec (struct _save_messages_msg *m)
if (strstr (m->path, "://"))
path = m->path;
else
- path = g_strjoin (NULL, "file://", m->path, NULL);
+ path = g_filename_to_uri (m->path, NULL, NULL);
stream = camel_stream_vfs_new_with_uri (path, CAMEL_STREAM_VFS_CREATE);
from_filter = camel_mime_filter_from_new();
@@ -2176,7 +2176,7 @@ save_part_exec (struct _save_part_msg *m)
if (strstr (m->path, "://"))
path = m->path;
else
- path = g_strjoin (NULL, "file://", m->path, NULL);
+ path = g_filename_to_uri (m->path, NULL, NULL);
if(!m->readonly){
if (!(stream = camel_stream_vfs_new_with_uri (path, CAMEL_STREAM_VFS_CREATE))) {