aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-06-20 21:21:33 +0800
committerMilan Crha <mcrha@src.gnome.org>2008-06-20 21:21:33 +0800
commitb6b9772a2a813d47c5e70e4e6819c5c56d897144 (patch)
treeb3bb11b8e0f73a58ba9d1f2e9f0fb9496a537677 /mail
parent3f7fbeb14aa0ca80c692b6cf8a544878fd2ea781 (diff)
downloadgsoc2013-evolution-b6b9772a2a813d47c5e70e4e6819c5c56d897144.tar.gz
gsoc2013-evolution-b6b9772a2a813d47c5e70e4e6819c5c56d897144.tar.zst
gsoc2013-evolution-b6b9772a2a813d47c5e70e4e6819c5c56d897144.zip
** Fix for bug #534039
2008-06-20 Milan Crha <mcrha@redhat.com> ** Fix for bug #534039 * em-folder-tree-model.h: (em_folder_tree_model_signal_block): * em-folder-tree-model.c: (em_folder_tree_model_signal_block): Removed obsolete function. * mail-vfolder.c: (vfolder_load_storage): Add storage to the tree model when everything is loaded, thus everything will be shown when enabling the Search Folders on demand. Also ensure the Search Folders to be enabled next start. * mail-vfolder.c: (mail_vfolder_add_uri), (mail_vfolder_delete_uri): Track folders even when Search Folders disabled, to have them known when enabling Search Folders on demand. svn path=/trunk/; revision=35658
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog15
-rw-r--r--mail/em-folder-tree-model.c18
-rw-r--r--mail/em-folder-tree-model.h1
-rw-r--r--mail/mail-vfolder.c37
4 files changed, 37 insertions, 34 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 33232d1008..707064cfd1 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,18 @@
+2008-06-20 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #534039
+
+ * em-folder-tree-model.h: (em_folder_tree_model_signal_block):
+ * em-folder-tree-model.c: (em_folder_tree_model_signal_block):
+ Removed obsolete function.
+ * mail-vfolder.c: (vfolder_load_storage):
+ Add storage to the tree model when everything is loaded, thus
+ everything will be shown when enabling the Search Folders on demand.
+ Also ensure the Search Folders to be enabled next start.
+ * mail-vfolder.c: (mail_vfolder_add_uri), (mail_vfolder_delete_uri):
+ Track folders even when Search Folders disabled, to have them
+ known when enabling Search Folders on demand.
+
2008-06-19 Milan Crha <mcrha@redhat.com>
** Fix for bug #382783
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index b0a5206d7f..ee9c24cb66 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -857,24 +857,6 @@ em_folder_tree_model_add_store (EMFolderTreeModel *model, CamelStore *store, con
gtk_tree_path_free (path);
}
-void
-em_folder_tree_model_signal_block (EMFolderTreeModel *model, CamelStore *store, gboolean block)
-{
- struct _EMFolderTreeModelStoreInfo *si;
-
- si = g_hash_table_lookup (model->store_hash, store);
- if (!si)
- return;
-
- if (block) {
- if (si->created_id)
- camel_object_unhook_event (store, "folder_created", CAMEL_CALLBACK (folder_created_cb), model);
- si->created_id = 0;
- } else {
- si->created_id = camel_object_hook_event (store, "folder_created", CAMEL_CALLBACK (folder_created_cb), model);
- }
-}
-
static void
em_folder_tree_model_remove_uri (EMFolderTreeModel *model, const char *uri)
{
diff --git a/mail/em-folder-tree-model.h b/mail/em-folder-tree-model.h
index fb35b2f13d..33fe50999f 100644
--- a/mail/em-folder-tree-model.h
+++ b/mail/em-folder-tree-model.h
@@ -147,7 +147,6 @@ void em_folder_tree_model_expand_foreach (EMFolderTreeModel *model, EMFTModelExp
void em_folder_tree_model_set_unread_count (EMFolderTreeModel *model, CamelStore *store, const char *path, int unread);
gboolean em_folder_tree_model_is_type_inbox (EMFolderTreeModel *model, CamelStore *store, const char *full);
char * em_folder_tree_model_get_folder_name (EMFolderTreeModel *model, CamelStore *store, const char *full);
-void em_folder_tree_model_signal_block (EMFolderTreeModel *model, CamelStore *store, gboolean block);
#ifdef __cplusplus
}
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index 0a57324c76..cfc09a7ff3 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -430,7 +430,7 @@ mail_vfolder_add_uri(CamelStore *store, const char *curi, int remove)
char *uri;
uri = em_uri_from_camel(curi);
- if (context == NULL || uri_is_spethal(store, curi)) {
+ if (uri_is_spethal (store, curi)) {
g_free(uri);
return;
}
@@ -469,6 +469,9 @@ mail_vfolder_add_uri(CamelStore *store, const char *curi, int remove)
}
}
+ if (context == NULL)
+ goto done;
+
rule = NULL;
while ((rule = rule_context_next_rule((RuleContext *)context, rule, NULL))) {
int found = FALSE;
@@ -505,6 +508,7 @@ mail_vfolder_add_uri(CamelStore *store, const char *curi, int remove)
}
}
+done:
UNLOCK();
if (folders != NULL)
@@ -524,7 +528,7 @@ mail_vfolder_delete_uri(CamelStore *store, const char *curi)
char *uri;
GList *link;
- if (context == NULL || uri_is_spethal(store, curi))
+ if (uri_is_spethal (store, curi))
return;
uri = em_uri_from_camel(curi);
@@ -537,6 +541,9 @@ mail_vfolder_delete_uri(CamelStore *store, const char *curi)
LOCK();
+ if (context == NULL)
+ goto done;
+
/* see if any rules directly reference this removed uri */
rule = NULL;
while ((rule = rule_context_next_rule ((RuleContext *) context, rule, NULL))) {
@@ -569,6 +576,7 @@ mail_vfolder_delete_uri(CamelStore *store, const char *curi)
}
}
+done:
if ((link = mv_find_folder(source_folders_remote, store, curi)) != NULL) {
g_free(link->data);
source_folders_remote = g_list_remove_link(source_folders_remote, link);
@@ -902,7 +910,7 @@ vfolder_load_storage(void)
char *user, *storeuri;
FilterRule *rule;
char *xmlfile;
- struct _EMFolderTreeModel *model = mail_component_peek_tree_model (mail_component_peek ());
+ GConfClient *gconf;
pthread_mutex_lock (&lock);
@@ -932,7 +940,6 @@ vfolder_load_storage(void)
(CamelObjectEventHookFunc)store_folder_renamed, NULL);
d(printf("got store '%s' = %p\n", storeuri, vfolder_store));
- mail_component_load_store_by_uri (mail_component_peek (), storeuri, _("Search Folders"));
/* load our rules */
user = g_strdup_printf ("%s/vfolders.xml", mail_component_peek_base_directory (mail_component_peek ()));
@@ -951,23 +958,23 @@ vfolder_load_storage(void)
/* and setup the rules we have */
rule = NULL;
-
- d(printf("rule added: %s\n", rule->name));
-
- /* Note: We block the signal handlers to be exact folder_created, since
- * there is a race betweeen folder_created emitted through camel_store_get_folder and
- * the store info that is fetched and added for vfolder. Due to this, two vfolders
- * appear on the search folder. See bug BGO #511488 */
- em_folder_tree_model_signal_block (model, vfolder_store, TRUE);
while ( (rule = rule_context_next_rule((RuleContext *)context, rule, NULL)) ) {
- if (rule->name)
+ if (rule->name) {
+ d(printf("rule added: %s\n", rule->name));
context_rule_added((RuleContext *)context, rule);
- else
+ } else
d(printf("invalid rule (%p) encountered: rule->name is NULL\n", rule));
}
- em_folder_tree_model_signal_block (model, vfolder_store, FALSE);
+
+ /* load store to mail component at the end, when everything is loaded */
+ mail_component_load_store_by_uri (mail_component_peek (), storeuri, _("Search Folders"));
g_free(storeuri);
+
+ /* reenable the feature if required */
+ gconf = mail_config_get_gconf_client();
+ if (!gconf_client_get_bool (gconf, "/apps/evolution/mail/display/enable_vfolders", NULL))
+ gconf_client_set_bool (gconf, "/apps/evolution/mail/display/enable_vfolders", TRUE, NULL);
}
void