diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-10-24 12:09:30 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-10-24 12:09:30 +0800 |
commit | e58630b14194b487c90a9995f10a98f93e88f9a8 (patch) | |
tree | c8a5f417c2f68d0f62b01c4ecfae3353b06f8302 /mail/component-factory.c | |
parent | 5c99202e0b92d33db44720df655d593df4095ed2 (diff) | |
download | gsoc2013-evolution-e58630b14194b487c90a9995f10a98f93e88f9a8.tar.gz gsoc2013-evolution-e58630b14194b487c90a9995f10a98f93e88f9a8.tar.zst gsoc2013-evolution-e58630b14194b487c90a9995f10a98f93e88f9a8.zip |
Unref the global search_context. (owner_set_cb): create the global
2001-10-23 Jeffrey Stedfast <fejj@ximian.com>
* component-factory.c (owner_unset_cb): Unref the global
search_context.
(owner_set_cb): create the global search_context.
* folder-browser.c (folder_browser_gui_init): Pass along the
global search_context to the e_filter_bar_new call.
svn path=/trunk/; revision=13976
Diffstat (limited to 'mail/component-factory.c')
-rw-r--r-- | mail/component-factory.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/mail/component-factory.c b/mail/component-factory.c index c4be75f94d..ccd6f81461 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -64,6 +64,8 @@ char *evolution_dir; EvolutionShellClient *global_shell_client = NULL; +RuleContext *search_context = NULL; + static GHashTable *storages_hash; static EvolutionShellComponent *shell_component; @@ -719,6 +721,24 @@ owner_set_cb (EvolutionShellComponent *shell_component, } mail_autoreceive_setup (); + + { + /* setup the global quick-search context */ + char *user = g_strdup_printf ("%s/searches.xml", evolution_dir); + char *system = g_strdup (EVOLUTION_DATADIR "/evolution/vfoldertypes.xml"); + + search_context = rule_context_new (); + gtk_object_set_data_full (GTK_OBJECT (search_context), "user", user, g_free); + gtk_object_set_data_full (GTK_OBJECT (search_context), "system", system, g_free); + + rule_context_add_part_set (search_context, "partset", filter_part_get_type (), + rule_context_add_part, rule_context_next_part); + + rule_context_add_rule_set (search_context, "ruleset", filter_rule_get_type (), + rule_context_add_rule, rule_context_next_rule); + + rule_context_load (search_context, system, user); + } if (mail_config_is_corrupt ()) { GtkWidget *dialog; @@ -841,19 +861,22 @@ static void owner_unset_cb (EvolutionShellComponent *shell_component, gpointer user_data) { int i; - + for (i=0;i<sizeof(shell_component_handlers)/sizeof(shell_component_handlers[0]);i++) gtk_signal_disconnect((GtkObject *)shell_component, shell_component_handlers[i].hand); - + if (mail_config_get_empty_trash_on_exit ()) empty_trash (NULL, NULL, NULL); unref_standard_folders (); mail_importer_uninit (); - + global_shell_client = NULL; mail_session_enable_interaction (FALSE); - + + gtk_object_unref (GTK_OBJECT (search_context)); + search_context = NULL; + g_idle_add_full (G_PRIORITY_LOW, idle_quit, NULL, NULL); } |