aboutsummaryrefslogtreecommitdiffstats
path: root/mail/folder-browser.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@HelixCode.com>2000-05-28 14:18:11 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-05-28 14:18:11 +0800
commit5b887fe6dc36d6ec21c8d86af60d29b7cbbbc871 (patch)
tree445d86e047f7e1e04433283403e8feae1e6b37d6 /mail/folder-browser.c
parentd11f78c349719e66a6eb569f6f1a65d268a6dec4 (diff)
downloadgsoc2013-evolution-5b887fe6dc36d6ec21c8d86af60d29b7cbbbc871.tar
gsoc2013-evolution-5b887fe6dc36d6ec21c8d86af60d29b7cbbbc871.tar.gz
gsoc2013-evolution-5b887fe6dc36d6ec21c8d86af60d29b7cbbbc871.tar.bz2
gsoc2013-evolution-5b887fe6dc36d6ec21c8d86af60d29b7cbbbc871.tar.lz
gsoc2013-evolution-5b887fe6dc36d6ec21c8d86af60d29b7cbbbc871.tar.xz
gsoc2013-evolution-5b887fe6dc36d6ec21c8d86af60d29b7cbbbc871.tar.zst
gsoc2013-evolution-5b887fe6dc36d6ec21c8d86af60d29b7cbbbc871.zip
vfolder gui! So you can define them,k they show up in the list (well,
after a restart), but they always come up empty - doesn't search any folders yet. 2000-05-27 Not Zed <NotZed@HelixCode.com> * Makefile.am (SHELL_OBJS): Include mail storage so we can initialise folders. * component-factory.c (create_test_storage): Parses vfolder defintions and adds them to the storage. Definetly needs more work. * folder-browser-factory.c (control_activate): Add the VFolder druid menu item. (control_deactivate): And remove it. * mail-ops.c (vfolder_editor_clicked): For editing vfolder definitions (rather like filters, oddly enough :). Tries to update the shell but it doesn't seem to work properly - requires a mail component restart to take effect. * folder-browser.c (folder_browser_load_folder): Handle vfolder: urls' appropriately and map to camel. Still needs a way to tell the vfolder what folders to search! (all vfolders come up empty!). svn path=/trunk/; revision=3241
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r--mail/folder-browser.c48
1 files changed, 36 insertions, 12 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index 297279c73f..f435d0cf50 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -67,35 +67,59 @@ folder_browser_load_folder (FolderBrowser *fb, const char *name)
{
char *store_name, *msg;
CamelStore *store;
- CamelFolder *new_folder;
+ CamelFolder *new_folder = NULL;
CamelException *ex;
gboolean new_folder_exists = FALSE;
- if (strncmp (name, "file:", 5) != 0) {
+ ex = camel_exception_new ();
+
+ if (!strncmp(name, "vfolder:", 8)) {
+ char *query, *newquery;
+ store_name = g_strdup(name);
+ query = strchr(store_name, '?');
+ if (query) {
+ *query++ = 0;
+ } else {
+ query = "";
+ }
+ newquery = g_strdup_printf("mbox?%s", query);
+ store = camel_session_get_store (session, store_name, ex);
+
+ if (store) {
+ new_folder = camel_store_get_folder (store, newquery, ex);
+ }
+ g_free(newquery);
+ g_free(store_name);
+
+ /* FIXME: Add the mbox folders we search!!! */
+ } 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);
+ g_free (store_name);
+ if (store) {
+ new_folder = camel_store_get_folder (store, "mbox", ex);
+ }
+ } else {
char *msg;
msg = g_strdup_printf ("Can't open URI %s", name);
gnome_error_dialog (msg);
g_free (msg);
+ camel_exception_free (ex);
return FALSE;
}
-
- /* Change "file:" to "mbox:". */
- store_name = g_strdup_printf ("mbox:%s", name + 5);
-
- ex = camel_exception_new ();
- store = camel_session_get_store (session, store_name, ex);
- g_free (store_name);
- if (store) {
- new_folder = camel_store_get_folder (store, "mbox", ex);
+
+ if (store)
gtk_object_unref (GTK_OBJECT (store));
- }
if (camel_exception_get_id (ex)) {
msg = g_strdup_printf ("Unable to get folder %s: %s\n", name,
camel_exception_get_description (ex));
gnome_error_dialog (msg);
camel_exception_free (ex);
+ if (new_folder)
+ gtk_object_unref((GtkObject *)new_folder);
return FALSE;
}