aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-selector.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-12-04 00:27:06 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-12-04 00:27:06 +0800
commit5b7662b8c7a5e988c74ad142d7e5f63aee4085fa (patch)
tree73cb6a51e76a7837c94f52bf8c23ad8831902228 /mail/em-folder-selector.c
parentaf58db7c0f3ca69e3e876e00581e4d2612fc458e (diff)
downloadgsoc2013-evolution-5b7662b8c7a5e988c74ad142d7e5f63aee4085fa.tar.gz
gsoc2013-evolution-5b7662b8c7a5e988c74ad142d7e5f63aee4085fa.tar.zst
gsoc2013-evolution-5b7662b8c7a5e988c74ad142d7e5f63aee4085fa.zip
Fixed a FIXME by using the CamelProvider url flags to determine if the url
2003-12-03 Jeffrey Stedfast <fejj@ximian.com> * em-folder-selector.c (em_folder_selector_get_selected_uri): Fixed a FIXME by using the CamelProvider url flags to determine if the url used url->fragment or url->path as the folder path. svn path=/trunk/; revision=23604
Diffstat (limited to 'mail/em-folder-selector.c')
-rw-r--r--mail/em-folder-selector.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/mail/em-folder-selector.c b/mail/em-folder-selector.c
index b91fc1ce5b..dea2603e2f 100644
--- a/mail/em-folder-selector.c
+++ b/mail/em-folder-selector.c
@@ -270,7 +270,7 @@ em_folder_selector_set_selected (EMFolderSelector *emfs, const char *uri)
const char *
em_folder_selector_get_selected_uri (EMFolderSelector *emfs)
{
- const char *uri;
+ const char *uri, *name;
if (!(uri = em_folder_tree_get_selected_uri (emfs->emft))) {
d(printf ("no selected folder?\n"));
@@ -278,18 +278,29 @@ em_folder_selector_get_selected_uri (EMFolderSelector *emfs)
}
if (uri && emfs->name_entry) {
+ CamelProvider *provider;
+ CamelException ex;
CamelURL *url;
char *newpath;
+ camel_exception_init (&ex);
+ provider = camel_session_get_provider (session, uri, &ex);
+ camel_exception_clear (&ex);
+
+ name = gtk_entry_get_text (emfs->name_entry);
+
url = camel_url_new (uri, NULL);
- /* FIXME: if we try to create a toplevel folder on a
- * store that uses fragments, url->fragment will be
- * NULL and so the resultant url will be incorrect */
- newpath = g_strdup_printf ("%s/%s", url->fragment ? url->fragment : url->path, gtk_entry_get_text (emfs->name_entry));
- if (url->fragment)
+ if (provider && (provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH)) {
+ if (url->fragment)
+ newpath = g_strdup_printf ("%s/%s", url->fragment, name);
+ else
+ newpath = g_strdup (name);
+
camel_url_set_fragment (url, newpath);
- else
+ } else {
+ newpath = g_strdup_printf ("%s/%s", url->path ? url->path : "", name);
camel_url_set_path (url, newpath);
+ }
g_free (emfs->selected_path);
emfs->selected_path = newpath;