From fc7ad0c9a97377934f6f1c03c5fa805a6c471513 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 7 Aug 2001 23:19:20 +0000 Subject: This should return a GtkWidget not a GtkObject. 2001-08-07 Jeffrey Stedfast * subscribe-dialog.c (subscribe_dialog_new): This should return a GtkWidget not a GtkObject. * mail-session.c (get_filter_driver): Update to use user's logging preferences. * mail-accounts.c (filter_log_toggled): New. (filter_log_path_changed): New. (construct): Get and attach signals to the filter logging option widgets. * mail-config.c (config_read): Read in filter logging options. (mail_config_write_on_exit): Save filter logging options. (mail_config_set_filter_log_path): Implemented. (mail_config_get_filter_log_path): Implemented. (mail_config_set_filter_log): Implemented. (mail_config_get_filter_log): Implemented. svn path=/trunk/; revision=11751 --- mail/ChangeLog | 72 ++++++++++++++++++-------- mail/mail-accounts.c | 70 +++++++++++++++++-------- mail/mail-accounts.h | 10 ++-- mail/mail-config.c | 42 +++++++++++++++ mail/mail-config.glade | 105 +++++++++++++++++++++++++++++-------- mail/mail-config.h | 5 ++ mail/mail-ops.c | 134 ++++++++++++++++++++++++++---------------------- mail/mail-session.c | 13 ++--- mail/subscribe-dialog.c | 8 +-- mail/subscribe-dialog.h | 2 +- 10 files changed, 319 insertions(+), 142 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 2ce5672e61..46a0ab8fd0 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,39 +1,67 @@ +2001-08-07 Jeffrey Stedfast + + * subscribe-dialog.c (subscribe_dialog_new): This should return a + GtkWidget not a GtkObject. + + * mail-session.c (get_filter_driver): Update to use user's logging + preferences. + + * mail-accounts.c (filter_log_toggled): New. + (filter_log_path_changed): New. + (construct): Get and attach signals to the filter logging option + widgets. + + * mail-config.c (config_read): Read in filter logging options. + (mail_config_write_on_exit): Save filter logging options. + (mail_config_set_filter_log_path): Implemented. + (mail_config_get_filter_log_path): Implemented. + (mail_config_set_filter_log): Implemented. + (mail_config_get_filter_log): Implemented. + 2001-08-07 Peter Williams - * mail-callbacks.c (folder_created): Use bonobo_object_unref on the storage - since it's a bonobo object. + * subscribe-dialog.c (folder_etree_construct): Move + fe_create_root_node farther down, so we can check for its children + without problems. + + * mail-callbacks.c (folder_created): Use bonobo_object_unref on + the storage since it's a bonobo object. (mail_storage_create_folder): Same. (folder_deleted): Same. - * subscribe-dialog.c (fe_destroy): Unref the e_storage since lookup_store - gives us a ref. + * subscribe-dialog.c (fe_destroy): Unref the e_storage since + lookup_store gives us a ref. 2001-08-07 Peter Williams - * subscribe-dialog.c (folder_etree_construct): Move fe_create_root_node - farther down, so we can check for its children without problems. + * subscribe-dialog.c (folder_etree_construct): Move + fe_create_root_node farther down, so we can check for its children + without problems. (storage_tree_path): Removed, this was broken. - (subscribe_get_short_folderinfo): Use the queued thread instead of the - new thread. + (subscribe_get_short_folderinfo): Use the queued thread instead of + the new thread. (subscribe_do_subscribe_folder): Same. - (ftree_node_new_root): Don't create the path anymore; it was broken - and there's a better way to get it now. + (ftree_node_new_root): Don't create the path anymore; it was + broken and there's a better way to get it now. (fe_got_children): Remove some debugging output. (fe_check_for_children): Here too. - (fe_done_subscribing): Get the path from the URI instead of the ftree_node. - (_SubscribeDialogPrivate): Add all of our useful widgets as members. - (sc_refresh_pressed): Don't clear the search... that makes no sense now. - (sc_search_activated): Don't set the filter radio button as active now; - we use sensitivity instead. + (fe_done_subscribing): Get the path from the URI instead of the + ftree_node. + (_SubscribeDialogPrivate): Add all of our useful widgets as + members. + (sc_refresh_pressed): Don't clear the search... that makes no + sense now. + (sc_search_activated): Don't set the filter radio button as active + now; we use sensitivity instead. (sc_all_toggled): Make the search entry insensitive. (sc_filter_toggled): Make the search entry sensitive. - (kill_default_view): New function. Gets rid of the default view stuff and - makes all the widgetry sensitive. - (menu_item_selected): Check if we moved off of the default view and, if so, - call kill_default_view(). - (subscribe_dialog_construct): Initialize our new private widget members, and - by default insensitize most of the buttons because they make no sense in the - default view. + (kill_default_view): New function. Gets rid of the default view + stuff and makes all the widgetry sensitive. + (menu_item_selected): Check if we moved off of the default view + and, if so, call kill_default_view(). + (subscribe_dialog_construct): Initialize our new private widget + members, and by default insensitize most of the buttons because + they make no sense in the default view. 2001-08-06 Jeffrey Stedfast diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c index a35ec7586b..605b7e2eb9 100644 --- a/mail/mail-accounts.c +++ b/mail/mail-accounts.c @@ -635,6 +635,16 @@ pgp_path_changed (GtkEntry *entry, gpointer data) mail_config_set_pgp_type (type); } +static void +filter_log_path_changed (GtkEntry *entry, gpointer data) +{ + const char *path; + + path = gtk_entry_get_text (entry); + + mail_config_set_filter_log_path (path && *path ? path : NULL); +} + static void set_color (GnomeColorPicker *cp) { @@ -692,6 +702,12 @@ show_preview_toggled (GtkWidget *toggle, gpointer data) mail_config_set_show_preview (NULL, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle))); } +static void +filter_log_toggled (GtkWidget *toggle, gpointer data) +{ + mail_config_set_filter_log (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle))); +} + static void forward_style_activated (GtkWidget *item, gpointer data) { @@ -796,12 +812,12 @@ construct (MailAccountsDialog *dialog) set_color (dialog->citation_color); gtk_signal_connect (GTK_OBJECT (dialog->citation_color), "color_set", GTK_SIGNAL_FUNC (citation_color_set), dialog); - + dialog->timeout_toggle = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "checkMarkTimeout")); gtk_toggle_button_set_active (dialog->timeout_toggle, mail_config_get_do_seen_timeout ()); gtk_signal_connect (GTK_OBJECT (dialog->timeout_toggle), "toggled", GTK_SIGNAL_FUNC (timeout_toggled), dialog); - + dialog->timeout = GTK_SPIN_BUTTON (glade_xml_get_widget (gui, "spinMarkTimeout")); gtk_spin_button_set_value (dialog->timeout, (1.0 * mail_config_get_mark_as_seen_timeout ()) / 1000.0); gtk_signal_connect (GTK_OBJECT (dialog->timeout), "changed", @@ -820,6 +836,16 @@ construct (MailAccountsDialog *dialog) gtk_signal_connect (GTK_OBJECT (dialog->images_always), "toggled", GTK_SIGNAL_FUNC (images_radio_toggled), dialog); + dialog->thread_list = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkThreadedList")); + gtk_toggle_button_set_active (dialog->thread_list, mail_config_get_thread_list (NULL)); + gtk_signal_connect (GTK_OBJECT (dialog->thread_list), "toggled", + GTK_SIGNAL_FUNC (thread_list_toggled), dialog); + + dialog->show_preview = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkShowPreview")); + gtk_toggle_button_set_active (dialog->show_preview, mail_config_get_show_preview (NULL)); + gtk_signal_connect (GTK_OBJECT (dialog->show_preview), "toggled", + GTK_SIGNAL_FUNC (show_preview_toggled), dialog); + /* Composer page */ dialog->send_html = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkSendHTML")); gtk_toggle_button_set_active (dialog->send_html, mail_config_get_send_html ()); @@ -833,6 +859,16 @@ construct (MailAccountsDialog *dialog) gtk_container_foreach (GTK_CONTAINER (gtk_option_menu_get_menu (dialog->forward_style)), attach_forward_style_signal, &num); + dialog->prompt_empty_subject = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptEmptySubject")); + gtk_toggle_button_set_active (dialog->prompt_empty_subject, mail_config_get_prompt_empty_subject ()); + gtk_signal_connect (GTK_OBJECT (dialog->prompt_empty_subject), "toggled", + GTK_SIGNAL_FUNC (prompt_empty_subject_toggled), dialog); + + dialog->prompt_bcc_only = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptBccOnly")); + gtk_toggle_button_set_active (dialog->prompt_bcc_only, mail_config_get_prompt_only_bcc ()); + gtk_signal_connect (GTK_OBJECT (dialog->prompt_bcc_only), "toggled", + GTK_SIGNAL_FUNC (prompt_bcc_only_toggled), dialog); + /* Other page */ dialog->pgp_path = GNOME_FILE_ENTRY (glade_xml_get_widget (gui, "filePgpPath")); gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (dialog->pgp_path)), @@ -857,25 +893,17 @@ construct (MailAccountsDialog *dialog) gtk_signal_connect (GTK_OBJECT (dialog->empty_trash), "toggled", GTK_SIGNAL_FUNC (empty_trash_toggled), dialog); - dialog->prompt_empty_subject = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptEmptySubject")); - gtk_toggle_button_set_active (dialog->prompt_empty_subject, mail_config_get_prompt_empty_subject ()); - gtk_signal_connect (GTK_OBJECT (dialog->prompt_empty_subject), "toggled", - GTK_SIGNAL_FUNC (prompt_empty_subject_toggled), dialog); - - dialog->prompt_bcc_only = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptBccOnly")); - gtk_toggle_button_set_active (dialog->prompt_bcc_only, mail_config_get_prompt_only_bcc ()); - gtk_signal_connect (GTK_OBJECT (dialog->prompt_bcc_only), "toggled", - GTK_SIGNAL_FUNC (prompt_bcc_only_toggled), dialog); - - dialog->thread_list = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkThreadedList")); - gtk_toggle_button_set_active (dialog->thread_list, mail_config_get_thread_list (NULL)); - gtk_signal_connect (GTK_OBJECT (dialog->thread_list), "toggled", - GTK_SIGNAL_FUNC (thread_list_toggled), dialog); - - dialog->show_preview = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkShowPreview")); - gtk_toggle_button_set_active (dialog->show_preview, mail_config_get_show_preview (NULL)); - gtk_signal_connect (GTK_OBJECT (dialog->show_preview), "toggled", - GTK_SIGNAL_FUNC (show_preview_toggled), dialog); + dialog->filter_log = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkFilterLog")); + gtk_toggle_button_set_active (dialog->filter_log, mail_config_get_filter_log ()); + gtk_signal_connect (GTK_OBJECT (dialog->filter_log), "toggled", + GTK_SIGNAL_FUNC (filter_log_toggled), dialog); + + dialog->filter_log_path = GNOME_FILE_ENTRY (glade_xml_get_widget (gui, "fileFilterLog")); + gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (dialog->filter_log_path)), + mail_config_get_filter_log_path ()); + gnome_file_entry_set_default_path (dialog->filter_log_path, mail_config_get_filter_log_path ()); + gtk_signal_connect (GTK_OBJECT (gnome_file_entry_gtk_entry (dialog->filter_log_path)), + "changed", GTK_SIGNAL_FUNC (filter_log_path_changed), dialog); /* now to fill in the clists */ dialog->accounts_row = -1; diff --git a/mail/mail-accounts.h b/mail/mail-accounts.h index 227a887010..0db2acb3b8 100644 --- a/mail/mail-accounts.h +++ b/mail/mail-accounts.h @@ -78,18 +78,20 @@ struct _MailAccountsDialog { GtkToggleButton *timeout_toggle; GtkSpinButton *timeout; GtkToggleButton *images_always, *images_sometimes, *images_never; + GtkToggleButton *thread_list; + GtkToggleButton *show_preview; /* Composer page */ GtkToggleButton *send_html; GtkOptionMenu *forward_style; GtkOptionMenu *charset; + GtkToggleButton *prompt_empty_subject; + GtkToggleButton *prompt_bcc_only; /* Other page */ GtkToggleButton *empty_trash; - GtkToggleButton *prompt_empty_subject; - GtkToggleButton *prompt_bcc_only; - GtkToggleButton *thread_list; - GtkToggleButton *show_preview; + GtkToggleButton *filter_log; + GnomeFileEntry *filter_log_path; /* PGP page */ GnomeFileEntry *pgp_path; diff --git a/mail/mail-config.c b/mail/mail-config.c index fae3a8a0d0..40d0fc8cbc 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -85,6 +85,9 @@ typedef struct { GHashTable *threaded_hash; GHashTable *preview_hash; + + gboolean filter_log; + char *filter_log_path; } MailConfig; static MailConfig *config = NULL; @@ -551,6 +554,13 @@ config_read (void) /* Trash folders */ config->empty_trash_on_exit = bonobo_config_get_boolean_with_default ( config->db, "/Mail/Trash/empty_on_exit", FALSE, NULL); + + /* Filter logging */ + config->filter_log = bonobo_config_get_boolean_with_default ( + config->db, "/Mail/Filters/log", FALSE, NULL); + + config->filter_log_path = bonobo_config_get_string ( + config->db, "/Mail/Filters/log_path", NULL); } #define bonobo_config_set_string_wrapper(db, path, val, ev) bonobo_config_set_string (db, path, val ? val : "", ev) @@ -811,6 +821,13 @@ mail_config_write_on_exit (void) bonobo_config_set_boolean (config->db, "/Mail/Trash/empty_on_exit", config->empty_trash_on_exit, NULL); + /* Filter logging */ + bonobo_config_set_boolean (config->db, "/Mail/Filters/log", + config->filter_log, NULL); + + bonobo_config_set_string_wrapper (config->db, "/Mail/Filters/log_path", + config->filter_log_path, NULL); + g_hash_table_foreach_remove (config->threaded_hash, hash_save_state, "Threads"); @@ -987,6 +1004,31 @@ mail_config_set_thread_list (const char *uri, gboolean value) config->thread_list = value; } +gboolean +mail_config_get_filter_log (void) +{ + return config->filter_log; +} + +void +mail_config_set_filter_log (gboolean value) +{ + config->filter_log = value; +} + +const char * +mail_config_get_filter_log_path (void) +{ + return config->filter_log_path; +} + +void +mail_config_set_filter_log_path (const char *path) +{ + g_free (config->filter_log_path); + config->filter_log_path = g_strdup (path); +} + gboolean mail_config_get_hide_deleted (void) { diff --git a/mail/mail-config.glade b/mail/mail-config.glade index 48a78496ed..76fabd40c5 100644 --- a/mail/mail-config.glade +++ b/mail/mail-config.glade @@ -266,13 +266,14 @@ Click "Finish" to save your settings. GtkLabel management_name_label - + GTK_JUSTIFY_CENTER False 0.5 0.5 0 0 + management_name 0 False @@ -300,7 +301,7 @@ Click "Finish" to save your settings. GtkCheckButton management_default True - + False True @@ -389,13 +390,14 @@ Click "Finish" to save your settings. GtkLabel identity_address_label - + GTK_JUSTIFY_RIGHT False 1 0.5 0 0 + identity_address 0 1 @@ -415,13 +417,14 @@ Click "Finish" to save your settings. GtkLabel identity_full_name_label - + GTK_JUSTIFY_RIGHT False 1 0.5 0 0 + identity_full_name 0 1 @@ -501,13 +504,14 @@ Click "Finish" to save your settings. GtkLabel identity_organization_label - + GTK_JUSTIFY_RIGHT False 1 0.5 7 0 + identity_organization 0 1 @@ -528,7 +532,7 @@ Click "Finish" to save your settings. GtkCheckButton check_html_signature True - + False True @@ -585,13 +589,14 @@ Click "Finish" to save your settings. GtkLabel identity_signature_label - + GTK_JUSTIFY_RIGHT False 1 0.5 7 0 + entry_signature 0 1 @@ -793,13 +798,14 @@ None GtkLabel source_host_label - + GTK_JUSTIFY_RIGHT False 1 0.5 0 0 + source_host 0 1 @@ -819,13 +825,14 @@ None GtkLabel source_user_label - + GTK_JUSTIFY_RIGHT False 1 0.5 0 0 + source_user 0 1 @@ -893,13 +900,14 @@ None GtkLabel source_path_label - + GTK_JUSTIFY_RIGHT False 1 0.5 0 0 + source_path 0 1 @@ -920,7 +928,7 @@ None GtkCheckButton source_use_ssl True - + False True @@ -1083,7 +1091,7 @@ Kerberos GtkButton source_check_supported True - + GTK_RELIEF_NORMAL @@ -1093,7 +1101,7 @@ Kerberos GtkCheckButton source_remember_password True - + False True @@ -1149,7 +1157,7 @@ Kerberos GtkHBox hbox53 False - 0 + 4 0 False @@ -1160,7 +1168,7 @@ Kerberos GtkCheckButton extra_auto_check True - + False True @@ -1336,13 +1344,14 @@ Sendmail GtkLabel transport_host_label - + GTK_JUSTIFY_RIGHT False 1 0.5 0 0 + transport_host 0 1 @@ -1388,7 +1397,7 @@ Sendmail GtkCheckButton transport_use_ssl True - + False True @@ -1420,7 +1429,7 @@ Sendmail GtkCheckButton transport_needs_auth True - + False True @@ -1513,7 +1522,7 @@ Kerberos GtkButton transport_check_supported True - + GTK_RELIEF_NORMAL @@ -1533,13 +1542,14 @@ Kerberos GtkLabel transport_user_label - + GTK_JUSTIFY_RIGHT False 1 0.5 0 0 + transport_user 0 False @@ -1567,7 +1577,7 @@ Kerberos GtkCheckButton transport_remember_password True - + False True @@ -2783,7 +2793,7 @@ Quoted GtkLabel lblPgpPath - + GTK_JUSTIFY_CENTER False 0.5 @@ -2894,6 +2904,57 @@ Quoted False + + + GtkHBox + hbox57 + False + 0 + + 0 + False + True + + + + GtkCheckButton + chkFilterLog + True + + False + True + + 0 + False + False + + + + + GnomeFileEntry + fileFilterLog + 10 + Select Filter Log file... + False + True + + 0 + True + True + + + + GtkEntry + GnomeEntry:entry + combo-entry2 + True + True + True + 0 + + + + diff --git a/mail/mail-config.h b/mail/mail-config.h index a997802c6d..5f5fd78645 100644 --- a/mail/mail-config.h +++ b/mail/mail-config.h @@ -105,6 +105,11 @@ void mail_config_write_on_exit (void); /* General Accessor functions */ gboolean mail_config_is_configured (void); +gboolean mail_config_get_filter_log (void); +void mail_config_set_filter_log (gboolean value); +const char *mail_config_get_filter_log_path (void); +void mail_config_set_filter_log_path (const char *path); + gboolean mail_config_get_empty_trash_on_exit (void); void mail_config_set_empty_trash_on_exit (gboolean value); diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 0a3ea46293..b3b47d81d7 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -55,7 +55,7 @@ /* used both for fetching mail, and for filtering mail */ struct _filter_mail_msg { struct _mail_msg msg; - + CamelFolder *source_folder; /* where they come from */ GPtrArray *source_uids; /* uids to copy, or NULL == copy all */ CamelUIDCache *cache; /* UID cache if we are to cache the uids, NULL otherwise */ @@ -134,12 +134,12 @@ filter_folder_filter (struct _mail_msg *mm) } static void -filter_folder_filtered(struct _mail_msg *mm) +filter_folder_filtered (struct _mail_msg *mm) { } static void -filter_folder_free(struct _mail_msg *mm) +filter_folder_free (struct _mail_msg *mm) { struct _filter_mail_msg *m = (struct _filter_mail_msg *)mm; int i; @@ -190,7 +190,7 @@ mail_filter_folder (CamelFolder *source_folder, GPtrArray *uids, m->driver = camel_session_get_filter_driver (session, type, NULL); - e_thread_put(mail_thread_new, (EMsg *)m); + e_thread_put (mail_thread_new, (EMsg *)m); } /* convenience function for it */ @@ -354,11 +354,11 @@ static struct _mail_msg_op fetch_mail_op = { }; /* ouch, a 'do everything' interface ... */ -void mail_fetch_mail(const char *source, int keep, - const char *type, CamelOperation *cancel, - CamelFilterGetFolderFunc get_folder, void *get_data, - CamelFilterStatusFunc *status, void *status_data, - void (*done)(char *source, void *data), void *data) +void +mail_fetch_mail (const char *source, int keep, const char *type, CamelOperation *cancel, + CamelFilterGetFolderFunc get_folder, void *get_data, + CamelFilterStatusFunc *status, void *status_data, + void (*done)(char *source, void *data), void *data) { struct _fetch_mail_msg *m; struct _filter_mail_msg *fm; @@ -380,7 +380,7 @@ void mail_fetch_mail(const char *source, int keep, if (status) camel_filter_driver_set_status_func (fm->driver, status, status_data); - e_thread_put(mail_thread_new, (EMsg *)m); + e_thread_put (mail_thread_new, (EMsg *)m); } @@ -402,15 +402,15 @@ do_update_subfolders_rec (CamelStore *store, CamelFolderInfo *info, EvolutionSto mail_folder_cache_set_update_estorage (info->url, storage); mail_folder_cache_note_folderinfo (info->url, info); } - - path = g_strdup_printf("%s/%s", prefix, info->name); - + + path = g_strdup_printf ("%s/%s", prefix, info->name); + if (info->child) - do_update_subfolders_rec(store, info->child, storage, path); + do_update_subfolders_rec (store, info->child, storage, path); if (info->sibling) - do_update_subfolders_rec(store, info->sibling, storage, prefix); - - g_free(path); + do_update_subfolders_rec (store, info->sibling, storage, prefix); + + g_free (path); } static void @@ -419,14 +419,14 @@ do_update_subfolders (CamelStore *store, CamelFolderInfo *info, void *data) struct _update_info *uinfo = data; if (uinfo && info) { - do_update_subfolders_rec(store, info, uinfo->storage, ""); + do_update_subfolders_rec (store, info, uinfo->storage, ""); } - + if (uinfo->done) - uinfo->done(store, uinfo->data); - - gtk_object_unref((GtkObject *)uinfo->storage); - g_free(uinfo); + uinfo->done (store, uinfo->data); + + gtk_object_unref ((GtkObject *)uinfo->storage); + g_free (uinfo); } /* this interface is a little icky */ @@ -1153,11 +1153,12 @@ do_scan_subfolders (CamelStore *store, CamelFolderInfo *info, void *data) } /* synchronous function to scan the & and add folders in a store */ -void mail_scan_subfolders(CamelStore *store, EvolutionStorage *storage) +void +mail_scan_subfolders (CamelStore *store, EvolutionStorage *storage) { int id; - - id = mail_get_folderinfo(store, do_scan_subfolders, storage); + + id = mail_get_folderinfo (store, do_scan_subfolders, storage); /*mail_msg_wait(id);*/ } @@ -1168,7 +1169,8 @@ struct _build_data { void *data; }; -static void do_build_attachment(CamelFolder *folder, GPtrArray *uids, GPtrArray *messages, void *data) +static void +do_build_attachment (CamelFolder *folder, GPtrArray *uids, GPtrArray *messages, void *data) { struct _build_data *d = data; CamelMultipart *multipart; @@ -1235,37 +1237,41 @@ struct _get_folder_msg { void *data; }; -static char *get_folder_desc(struct _mail_msg *mm, int done) +static char * +get_folder_desc (struct _mail_msg *mm, int done) { struct _get_folder_msg *m = (struct _get_folder_msg *)mm; return g_strdup_printf(_("Opening folder %s"), m->uri); } -static void get_folder_get(struct _mail_msg *mm) +static void +get_folder_get (struct _mail_msg *mm) { struct _get_folder_msg *m = (struct _get_folder_msg *)mm; - - camel_operation_register(mm->cancel); - m->folder = mail_tool_uri_to_folder(m->uri, &mm->ex); - camel_operation_unregister(mm->cancel); + + camel_operation_register (mm->cancel); + m->folder = mail_tool_uri_to_folder (m->uri, &mm->ex); + camel_operation_unregister (mm->cancel); } -static void get_folder_got(struct _mail_msg *mm) +static void +get_folder_got (struct _mail_msg *mm) { struct _get_folder_msg *m = (struct _get_folder_msg *)mm; - + if (m->done) m->done (m->uri, m->folder, m->data); } -static void get_folder_free(struct _mail_msg *mm) +static void +get_folder_free (struct _mail_msg *mm) { struct _get_folder_msg *m = (struct _get_folder_msg *)mm; - - g_free(m->uri); + + g_free (m->uri); if (m->folder) - camel_object_unref((CamelObject *)m->folder); + camel_object_unref (CAMEL_OBJECT (m->folder)); } static struct _mail_msg_op get_folder_op = { @@ -1276,18 +1282,18 @@ static struct _mail_msg_op get_folder_op = { }; int -mail_get_folder(const char *uri, void (*done) (char *uri, CamelFolder *folder, void *data), void *data) +mail_get_folder (const char *uri, void (*done) (char *uri, CamelFolder *folder, void *data), void *data) { struct _get_folder_msg *m; int id; - - m = mail_msg_new(&get_folder_op, NULL, sizeof(*m)); - m->uri = g_strdup(uri); + + m = mail_msg_new (&get_folder_op, NULL, sizeof(*m)); + m->uri = g_strdup (uri); m->data = data; m->done = done; - + id = m->msg.seq; - e_thread_put(mail_thread_new, (EMsg *)m); + e_thread_put (mail_thread_new, (EMsg *)m); return id; } @@ -1302,37 +1308,41 @@ struct _get_store_msg { void *data; }; -static char *get_store_desc(struct _mail_msg *mm, int done) +static char * +get_store_desc (struct _mail_msg *mm, int done) { struct _get_store_msg *m = (struct _get_store_msg *)mm; return g_strdup_printf(_("Opening store %s"), m->uri); } -static void get_store_get(struct _mail_msg *mm) +static void +get_store_get (struct _mail_msg *mm) { struct _get_store_msg *m = (struct _get_store_msg *)mm; - - camel_operation_register(mm->cancel); - m->store = camel_session_get_store(session, m->uri, &mm->ex); - camel_operation_unregister(mm->cancel); + + camel_operation_register (mm->cancel); + m->store = camel_session_get_store (session, m->uri, &mm->ex); + camel_operation_unregister (mm->cancel); } -static void get_store_got(struct _mail_msg *mm) +static void +get_store_got (struct _mail_msg *mm) { struct _get_store_msg *m = (struct _get_store_msg *)mm; if (m->done) - m->done(m->uri, m->store, m->data); + m->done (m->uri, m->store, m->data); } -static void get_store_free(struct _mail_msg *mm) +static void +get_store_free (struct _mail_msg *mm) { struct _get_store_msg *m = (struct _get_store_msg *)mm; - - g_free(m->uri); + + g_free (m->uri); if (m->store) - camel_object_unref((CamelObject *)m->store); + camel_object_unref (CAMEL_OBJECT (m->store)); } static struct _mail_msg_op get_store_op = { @@ -1343,18 +1353,18 @@ static struct _mail_msg_op get_store_op = { }; int -mail_get_store(const char *uri, void (*done) (char *uri, CamelStore *store, void *data), void *data) +mail_get_store (const char *uri, void (*done) (char *uri, CamelStore *store, void *data), void *data) { struct _get_store_msg *m; int id; - m = mail_msg_new(&get_store_op, NULL, sizeof(*m)); - m->uri = g_strdup(uri); + m = mail_msg_new (&get_store_op, NULL, sizeof (*m)); + m->uri = g_strdup (uri); m->data = data; m->done = done; - + id = m->msg.seq; - e_thread_put(mail_thread_new, (EMsg *)m); + e_thread_put (mail_thread_new, (EMsg *)m); return id; } diff --git a/mail/mail-session.c b/mail/mail-session.c index 05b1e79d17..fe56537588 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -343,7 +343,7 @@ get_filter_driver (CamelSession *session, const char *type, CamelException *ex) RuleContext *fc; GString *fsearch, *faction; FilterRule *rule = NULL; - char *user, *system, *filename; + char *user, *system; user = g_strdup_printf ("%s/filters.xml", evolution_dir); system = EVOLUTION_DATADIR "/evolution/filtertypes.xml"; @@ -354,14 +354,15 @@ get_filter_driver (CamelSession *session, const char *type, CamelException *ex) driver = camel_filter_driver_new (); camel_filter_driver_set_folder_func (driver, get_folder, NULL); - if (TRUE /* perform_logging FIXME */) { + if (mail_config_get_filter_log ()) { MailSession *ms = (MailSession *)session; if (ms->filter_logfile == NULL) { - filename = g_strdup_printf ("%s/evolution-filter-log", - evolution_dir); - ms->filter_logfile = fopen (filename, "a+"); - g_free (filename); + const char *filename; + + filename = mail_config_get_filter_log_path (); + if (filename) + ms->filter_logfile = fopen (filename, "a+"); } if (ms->filter_logfile) camel_filter_driver_set_logfile (driver, ms->filter_logfile); diff --git a/mail/subscribe-dialog.c b/mail/subscribe-dialog.c index c075bbfa00..4e868e3c6e 100644 --- a/mail/subscribe-dialog.c +++ b/mail/subscribe-dialog.c @@ -1520,15 +1520,15 @@ subscribe_dialog_construct (GtkObject *object) populate_store_list (sc); } -GtkObject * +GtkWidget * subscribe_dialog_new (void) { SubscribeDialog *subscribe_dialog; - + subscribe_dialog = gtk_type_new (SUBSCRIBE_DIALOG_TYPE); subscribe_dialog_construct (GTK_OBJECT (subscribe_dialog)); - - return GTK_OBJECT (subscribe_dialog); + + return GTK_WIDGET (subscribe_dialog); } E_MAKE_TYPE (subscribe_dialog, "SubscribeDialog", SubscribeDialog, subscribe_dialog_class_init, subscribe_dialog_init, PARENT_TYPE); diff --git a/mail/subscribe-dialog.h b/mail/subscribe-dialog.h index 10fa5d9f44..b838f13cc4 100644 --- a/mail/subscribe-dialog.h +++ b/mail/subscribe-dialog.h @@ -54,7 +54,7 @@ typedef struct { } SubscribeDialogClass; GtkType subscribe_dialog_get_type (void); -GtkObject *subscribe_dialog_new (void); +GtkWidget *subscribe_dialog_new (void); void subscribe_dialog_run_and_close (SubscribeDialog *dialog); #endif /* _SUBSCRIBE_DIALOG_H_ */ -- cgit v1.2.3