aboutsummaryrefslogtreecommitdiffstats
path: root/mail/folder-browser.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-06-23 05:55:14 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-06-23 05:55:14 +0800
commitafa7176eab5a2c495a8f10de4c430f443cdcfb99 (patch)
tree59be2ee4a647cc55f83ee2ac46cb50ede25b5b2a /mail/folder-browser.c
parenta7f40b2f5ff709b9c0d3f5f487cdba6d6d3aa7b6 (diff)
downloadgsoc2013-evolution-afa7176eab5a2c495a8f10de4c430f443cdcfb99.tar
gsoc2013-evolution-afa7176eab5a2c495a8f10de4c430f443cdcfb99.tar.gz
gsoc2013-evolution-afa7176eab5a2c495a8f10de4c430f443cdcfb99.tar.bz2
gsoc2013-evolution-afa7176eab5a2c495a8f10de4c430f443cdcfb99.tar.lz
gsoc2013-evolution-afa7176eab5a2c495a8f10de4c430f443cdcfb99.tar.xz
gsoc2013-evolution-afa7176eab5a2c495a8f10de4c430f443cdcfb99.tar.zst
gsoc2013-evolution-afa7176eab5a2c495a8f10de4c430f443cdcfb99.zip
Updated to prepend url-> path if it exists for that imap store.
2000-06-22 Jeffrey Stedfast <fejj@helixcode.com> * folder-browser.c (folder_browser_load_folder): Updated to prepend url-> path if it exists for that imap store. * component-factory.c (create_imap_storage): Modified to not prepend a hard-coded namespace. svn path=/trunk/; revision=3701
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r--mail/folder-browser.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index 6a90b23b30..b880a867b6 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -64,10 +64,10 @@ folder_browser_load_folder (FolderBrowser *fb, const char *name)
ex = camel_exception_new ();
- if (!strncmp(name, "vfolder:", 8)) {
+ if (!strncmp (name, "vfolder:", 8)) {
char *query, *newquery;
- store_name = g_strdup(name);
- query = strchr(store_name, '?');
+ store_name = g_strdup (name);
+ query = strchr (store_name, '?');
if (query) {
*query++ = 0;
} else {
@@ -92,15 +92,15 @@ folder_browser_load_folder (FolderBrowser *fb, const char *name)
if (st) {
source_folder = camel_store_get_folder (st, "mbox", FALSE, ex);
if (source_folder) {
- camel_vee_folder_add_folder(new_folder, source_folder);
+ camel_vee_folder_add_folder (new_folder, source_folder);
}
}
}
}
- g_free(newquery);
- g_free(store_name);
+ g_free (newquery);
+ g_free (store_name);
- } else if (!strncmp(name, "imap:", 5)) {
+ } else if (!strncmp (name, "imap:", 5)) {
/* uhm, I'm just guessing here - this code might be wrong */
char *service, *ptr;
@@ -113,16 +113,25 @@ folder_browser_load_folder (FolderBrowser *fb, const char *name)
store = camel_session_get_store (session, service, ex);
g_free (service);
if (store) {
+ CamelURL *url = CAMEL_SERVICE (store)->url;
char *folder_name;
- for (ptr = name + 7; *ptr && *ptr != '/'; ptr++);
+ for (ptr = (char *)(name + 7); *ptr && *ptr != '/'; ptr++);
if (*ptr == '/') {
- folder_name = ptr + 1;
+ if (url && url->path) {
+ fprintf (stderr, "namespace = %s\n", url->path);
+ ptr += strlen (url->path);
+ }
+
+ ptr++;
+ folder_name = g_strdup (ptr);
+
fprintf (stderr, "getting folder: %s\n", folder_name);
new_folder = camel_store_get_folder (store, folder_name, TRUE, ex);
+ g_free (folder_name);
}
}
- } else if (!strncmp(name, "file:", 5)) {
+ } else if (!strncmp (name, "file:", 5)) {
/* Change "file:" to "mbox:". */
store_name = g_strdup_printf ("mbox:%s", name + 5);
store = camel_session_get_store (session, store_name, ex);