evolution r35658 - trunk/mail
- From: mcrha svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution r35658 - trunk/mail
- Date: Fri, 20 Jun 2008 13:21:34 +0000 (UTC)
Author: mcrha
Date: Fri Jun 20 13:21:33 2008
New Revision: 35658
URL: http://svn.gnome.org/viewvc/evolution?rev=35658&view=rev
Log:
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.
Modified:
trunk/mail/ChangeLog
trunk/mail/em-folder-tree-model.c
trunk/mail/em-folder-tree-model.h
trunk/mail/mail-vfolder.c
Modified: trunk/mail/em-folder-tree-model.c
==============================================================================
--- trunk/mail/em-folder-tree-model.c (original)
+++ trunk/mail/em-folder-tree-model.c Fri Jun 20 13:21:33 2008
@@ -857,24 +857,6 @@
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)
{
Modified: trunk/mail/em-folder-tree-model.h
==============================================================================
--- trunk/mail/em-folder-tree-model.h (original)
+++ trunk/mail/em-folder-tree-model.h Fri Jun 20 13:21:33 2008
@@ -147,7 +147,6 @@
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
}
Modified: trunk/mail/mail-vfolder.c
==============================================================================
--- trunk/mail/mail-vfolder.c (original)
+++ trunk/mail/mail-vfolder.c Fri Jun 20 13:21:33 2008
@@ -430,7 +430,7 @@
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 @@
}
}
+ if (context == NULL)
+ goto done;
+
rule = NULL;
while ((rule = rule_context_next_rule((RuleContext *)context, rule, NULL))) {
int found = FALSE;
@@ -505,6 +508,7 @@
}
}
+done:
UNLOCK();
if (folders != NULL)
@@ -524,7 +528,7 @@
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 @@
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 @@
}
}
+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 @@
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 @@
(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 @@
/* 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]