diff options
author | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-06-21 02:04:10 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-06-21 02:04:10 +0800 |
commit | 8f881bd9d5bf26d3534174fa238030e8026ff749 (patch) | |
tree | 021c6e63f408d9c90a8e5e156b3433d370b9890a /mail | |
parent | b7f2532c93a1d3dc9667c62a38a19b07b9e2714c (diff) | |
download | gsoc2013-evolution-8f881bd9d5bf26d3534174fa238030e8026ff749.tar.gz gsoc2013-evolution-8f881bd9d5bf26d3534174fa238030e8026ff749.tar.zst gsoc2013-evolution-8f881bd9d5bf26d3534174fa238030e8026ff749.zip |
working on getting IMAP folder selection working
svn path=/trunk/; revision=3648
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 8 | ||||
-rw-r--r-- | mail/component-factory.c | 17 | ||||
-rw-r--r-- | mail/folder-browser.c | 20 |
3 files changed, 29 insertions, 16 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 21130219ed..17595dcee6 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2000-06-20 Jeffrey Stedfast <fejj@helixcode.com> + + * folder-browser.c (folder_browser_load_folder): Working on getting + this to work :) + + * component-factory.c (create_imap_storage): Should now correctly + construct the folder path allowing the selection of a folder. + 2000-06-20 Ettore Perazzoli <ettore@helixcode.com> * mail-format.c (mail_generate_reply): Declare `evolution_dir'. diff --git a/mail/component-factory.c b/mail/component-factory.c index a12a7f8c58..4681d93365 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -253,16 +253,16 @@ create_imap_storage (EvolutionShellComponent *shell_component) extern gchar *evolution_dir; Evolution_Shell corba_shell; EvolutionStorage *storage; - char *path, *source, *server, *p; + char *cpath, *source, *server, *p; CamelStore *store; CamelFolder *folder; CamelException *ex; GPtrArray *lsub; int i, max; - path = g_strdup_printf ("=%s/config=/mail/source", evolution_dir); - source = gnome_config_get_string (path); - g_free (path); + cpath = g_strdup_printf ("=%s/config=/mail/source", evolution_dir); + source = gnome_config_get_string (cpath); + g_free (cpath); if (strncasecmp (source, "imap://", 7)) return; @@ -311,16 +311,17 @@ create_imap_storage (EvolutionShellComponent *shell_component) /* we need a way to set the namespace */ lsub = camel_folder_get_subfolder_names (folder, ex); - evolution_storage_new_folder (storage, "/INBOX", "mail", source, "description"); + p = g_strdup_printf ("%s/INBOX", source); + evolution_storage_new_folder (storage, "/INBOX", "mail", p, "description"); max = lsub->len; - fprintf (stderr, "\n************* We have %d folders\n\n", max + 1); for (i = 0; i < max; i++) { - char *path; + char *path, *buf; path = g_strdup_printf ("/%s", (char *)lsub->pdata[i]); + buf = g_strdup_printf ("%s/mail%s", source, path); g_print ("Adding %s\n", path); - evolution_storage_new_folder (storage, path, "mail", source, "description"); + evolution_storage_new_folder (storage, path, "mail", buf, "description"); } cleanup: diff --git a/mail/folder-browser.c b/mail/folder-browser.c index 2831f8bc24..613a3b00fa 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -102,18 +102,22 @@ folder_browser_load_folder (FolderBrowser *fb, const char *name) } else if (!strncmp(name, "imap:", 5)) { /* uhm, I'm just guessing here - this code might be wrong */ + char *service, *ptr; + fprintf (stderr, "\n****** name = %s ******\n\n", name); - store = camel_session_get_store (session, name, ex); + service = g_strdup (name); + for (ptr = service + 7; *ptr && *ptr != '/'; ptr++); + *ptr = '\0'; + fprintf (stderr, "\n****** service = %s ******\n\n", service); + store = camel_session_get_store (session, service, ex); + g_free (service); if (store) { char *folder_name; - folder_name = strstr (name, "//"); - if (folder_name) { - for (folder_name += 2; *folder_name && *folder_name != '/'; folder_name++); - if (*folder_name) { - folder_name++; - new_folder = camel_store_get_folder (store, folder_name, TRUE, ex); - } + for (ptr = name + 7; *ptr && *ptr != '/'; ptr++); + if (*ptr == '/') { + folder_name = ptr + 1; + new_folder = camel_store_get_folder (store, folder_name, TRUE, ex); } } } else if (!strncmp(name, "file:", 5)) { |