From e58630b14194b487c90a9995f10a98f93e88f9a8 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 24 Oct 2001 04:09:30 +0000 Subject: Unref the global search_context. (owner_set_cb): create the global 2001-10-23 Jeffrey Stedfast * 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 --- mail/ChangeLog | 10 ++++++++++ mail/component-factory.c | 31 +++++++++++++++++++++++++++---- mail/folder-browser.c | 21 ++++++--------------- 3 files changed, 43 insertions(+), 19 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 01a7b6b0a4..e6ec5faf18 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +2001-10-23 Jeffrey Stedfast + + * 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. + 2001-10-24 * message-browser.c (message_browser_message_loaded): Call @@ -36,6 +45,7 @@ (folder_browser_ui_set_selection_state): And here too. 2001-10-23 Jeffrey Stedfast +>>>>>>> 1.1890 * mail-account-gui.c (service_check_supported): Don't allow an auth-type to be set when saving the service. 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;isearch = e_filter_bar_new (rc, system, user, folder_browser_config_search, fb); + fb->search = e_filter_bar_new (search_context, systemrules, userrules, + folder_browser_config_search, fb); e_search_bar_set_menu ((ESearchBar *)fb->search, folder_browser_search_menu_items); - /*e_search_bar_set_option((ESearchBar *)fb->search, folder_browser_search_option_items);*/ - g_free (user); - gtk_object_unref (GTK_OBJECT (rc)); } gtk_widget_show (GTK_WIDGET (fb->search)); -- cgit v1.2.3