aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-02-20 05:00:10 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-02-20 05:00:10 +0800
commit778498a42da755757f33740ea5f03e089864dd41 (patch)
tree37892cf8f9526f706dab6f5cb8dd1d3ef5710eb9
parent10fba20de92e3cb8c7346452e804c9fa11ffd343 (diff)
downloadgsoc2013-evolution-778498a42da755757f33740ea5f03e089864dd41.tar.gz
gsoc2013-evolution-778498a42da755757f33740ea5f03e089864dd41.tar.zst
gsoc2013-evolution-778498a42da755757f33740ea5f03e089864dd41.zip
Dont do the thaw/freeze set here. (update_folders): "
2001-02-16 Not Zed <NotZed@Ximian.com> * mail-send-recv.c (receive_status): Dont do the thaw/freeze set here. (update_folders): " * mail-vfolder.c (vfolder_refresh): Setup the virtual 'unmatched' folder by default. (vfolder_uri_to_folder): HAndle UNMATCHED folder specially, it has no explicit sources. svn path=/trunk/; revision=8277
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/mail-send-recv.c8
-rw-r--r--mail/mail-vfolder.c72
3 files changed, 59 insertions, 31 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 96fea5fa92..f0d2afe754 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,13 @@
+2001-02-16 Not Zed <NotZed@Ximian.com>
+
+ * mail-send-recv.c (receive_status): Dont do the thaw/freeze set here.
+ (update_folders): "
+
+ * mail-vfolder.c (vfolder_refresh): Setup the virtual
+ 'unmatched' folder by default.
+ (vfolder_uri_to_folder): HAndle UNMATCHED folder specially, it has
+ no explicit sources.
+
2001-02-16 Jeffrey Stedfast <fejj@ximian.com>
* mail-send-recv.c (receive_get_folder): Not sure it makes any
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index 6eace378d3..299a07289a 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -346,8 +346,8 @@ update_folders(char *uri, struct _folder_info *info, void *data)
/* we back off slowly as we progress */
if (now > info->update+10+info->count*5) {
printf("upating a folder: %s\n", info->uri);
- camel_folder_thaw(info->folder);
- camel_folder_freeze(info->folder);
+ /*camel_folder_thaw(info->folder);
+ camel_folder_freeze(info->folder);*/
info->update = now;
info->count++;
}
@@ -417,8 +417,8 @@ receive_status (CamelFilterDriver *driver, enum camel_filter_status_t status, in
if (info->data->inbox && now > info->data->inbox_update+20) {
printf("updating inbox too\n");
/* this doesn't seem to work right :( */
- camel_folder_thaw(info->data->inbox);
- camel_folder_freeze(info->data->inbox);
+ /*camel_folder_thaw(info->data->inbox);
+ camel_folder_freeze(info->data->inbox);*/
info->data->inbox_update = now;
}
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index 7f654d2da5..e420a24178 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -125,6 +125,26 @@ vfolder_refresh(void)
g_free(info->query);
l = g_list_next(l);
}
+
+ /* setup the virtual unmatched folder */
+ info = vfolder_find("UNMATCHED");
+ if (info == NULL) {
+ char *uri, *path;
+
+ info = g_malloc(sizeof(*info));
+ info->name = g_strdup("UNMATCHED");
+ info->query = g_strdup("UNMATCHED");
+ d(printf("Adding new vfolder: %s %s\n", info->name, info->query));
+
+ uri = g_strdup_printf("vfolder:%s", info->name);
+ path = g_strdup_printf("/%s", info->name);
+ evolution_storage_new_folder(vfolder_storage, path, g_basename(path),
+ "mail", uri, info->name, FALSE);
+ g_free(uri);
+ g_free(path);
+ }
+ head = g_list_append(head, info);
+
g_list_free(available_vfolders);
available_vfolders = head;
g_string_free(expr, TRUE);
@@ -203,34 +223,32 @@ vfolder_uri_to_folder(const char *uri, CamelException *ex)
bonobo_object_ref (BONOBO_OBJECT (vfolder_storage));
mail_hash_storage ((CamelService *)folder->parent_store, vfolder_storage);
- sourceuri = NULL;
- sources = 0;
- while ( (sourceuri = vfolder_rule_next_source(rule, sourceuri)) ) {
- d(printf("adding vfolder source: %s\n", sourceuri));
- sourcefolder = mail_tool_uri_to_folder (sourceuri, ex);
- printf("source folder = %p\n", sourcefolder);
- if (sourcefolder) {
- sources++;
- mail_tool_camel_lock_up ();
- camel_vee_folder_add_folder(folder, sourcefolder);
- mail_tool_camel_lock_down ();
- } else {
- /* we'll just silently ignore now-missing sources */
- camel_exception_clear(ex);
+ if (strcmp(uri+8, "UNMATCHED") != 0) {
+ sourceuri = NULL;
+ sources = 0;
+ while ( (sourceuri = vfolder_rule_next_source(rule, sourceuri)) ) {
+ d(printf("adding vfolder source: %s\n", sourceuri));
+ sourcefolder = mail_tool_uri_to_folder (sourceuri, ex);
+ printf("source folder = %p\n", sourcefolder);
+ if (sourcefolder) {
+ sources++;
+ camel_vee_folder_add_folder(folder, sourcefolder);
+ } else {
+ /* we'll just silently ignore now-missing sources */
+ camel_exception_clear(ex);
+ }
}
- }
- /* if we didn't have any sources, just use Inbox as the default */
- if (sources == 0) {
- char *defaulturi;
-
- defaulturi = g_strdup_printf("file://%s/local/Inbox", evolution_dir);
- d(printf("No sources configured/found, using default: %s\n", defaulturi));
- sourcefolder = mail_tool_uri_to_folder (defaulturi, ex);
- g_free(defaulturi);
- if (sourcefolder) {
- mail_tool_camel_lock_up ();
- camel_vee_folder_add_folder(folder, sourcefolder);
- mail_tool_camel_lock_down ();
+ /* if we didn't have any sources, just use Inbox as the default */
+ if (sources == 0) {
+ char *defaulturi;
+
+ defaulturi = g_strdup_printf("file://%s/local/Inbox", evolution_dir);
+ d(printf("No sources configured/found, using default: %s\n", defaulturi));
+ sourcefolder = mail_tool_uri_to_folder (defaulturi, ex);
+ g_free(defaulturi);
+ if (sourcefolder) {
+ camel_vee_folder_add_folder(folder, sourcefolder);
+ }
}
}