aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-tools.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-01-29 14:26:30 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-01-29 14:26:30 +0800
commita59ee4cd30692aa5d653ad9f3deccb306c583a7d (patch)
tree68137535a21f81ab5724a42dea0a097aa452b9a3 /mail/mail-tools.c
parent3629f67f594ac7d21a777f01317cf2cb95774588 (diff)
downloadgsoc2013-evolution-a59ee4cd30692aa5d653ad9f3deccb306c583a7d.tar.gz
gsoc2013-evolution-a59ee4cd30692aa5d653ad9f3deccb306c583a7d.tar.zst
gsoc2013-evolution-a59ee4cd30692aa5d653ad9f3deccb306c583a7d.zip
** See bug #53320 and probably others
2004-01-29 Not Zed <NotZed@Ximian.com> ** See bug #53320 and probably others * message-list.c (message_list_set_folder): NULL out message_list->folder when we clear it so it isn't left for another free when we switch again. 2004-01-29 Not Zed <NotZed@Ximian.com> ** See bug #52190. * message-list.c: Added folder/folder uri to the data stored for primary/secondary selection, uses a struct to store the data now. This is needed so when you cut/copy messages, and paste them, it doesn't end up 'pasting' the messages from the current folder, but from the one where the copy/cut took place. (clear_selection): helper to free data inside selection struct. 2004-01-29 Not Zed <NotZed@Ximian.com> ** See bug #53506. * mail-tools.c (mail_tools_folder_to_url): use a camelurl to do this properly, and handle fragment folder-paths. * em-composer-utils.c (em_utils_composer_send_cb): removed outbox_folder local, not necessary. svn path=/trunk/; revision=24511
Diffstat (limited to 'mail/mail-tools.c')
-rw-r--r--mail/mail-tools.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index 0a16a27e0f..2e797f2ee5 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -363,7 +363,6 @@ mail_tool_uri_to_folder (const char *uri, guint32 flags, CamelException *ex)
return folder;
}
-
/**
* mail_tools_x_evolution_message_parse:
* @in: GtkSelectionData->data
@@ -405,25 +404,26 @@ mail_tools_x_evolution_message_parse (char *in, unsigned int inlen, GPtrArray **
return folder;
}
-
char *
mail_tools_folder_to_url (CamelFolder *folder)
{
- char *service_url, *url;
- const char *full_name;
- CamelService *service;
-
+ CamelURL *url;
+ char *out;
+
g_return_val_if_fail (CAMEL_IS_FOLDER (folder), NULL);
-
- full_name = folder->full_name;
- while (*full_name == '/')
- full_name++;
-
- service = (CamelService *) folder->parent_store;
- service_url = camel_url_to_string (service->url, CAMEL_URL_HIDE_ALL);
- url = g_strdup_printf ("%s%s%s", service_url, service_url[strlen (service_url)-1] != '/' ? "/" : "",
- full_name);
- g_free (service_url);
-
- return url;
+
+ url = camel_url_copy(((CamelService *)folder->parent_store)->url);
+ if (((CamelService *)folder->parent_store)->provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH) {
+ camel_url_set_fragment(url, folder->full_name);
+ } else {
+ char *name = g_alloca(strlen(folder->full_name)+2);
+
+ sprintf(name, "/%s", folder->full_name);
+ camel_url_set_path(url, name);
+ }
+
+ out = camel_url_to_string(url, CAMEL_URL_HIDE_ALL);
+ camel_url_free(url);
+
+ return out;
}