aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-03-31 18:09:04 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-03-31 18:09:04 +0800
commit9e126a8d01dd36a19ab34a9d3edf016897b12d7e (patch)
tree9a57659490abf68cb1abd341a0d939f30fc1074e
parentd239a18ce4bff4bd07c17118ca429f5020fc1731 (diff)
downloadgsoc2013-evolution-9e126a8d01dd36a19ab34a9d3edf016897b12d7e.tar.gz
gsoc2013-evolution-9e126a8d01dd36a19ab34a9d3edf016897b12d7e.tar.zst
gsoc2013-evolution-9e126a8d01dd36a19ab34a9d3edf016897b12d7e.zip
Cleaned up header inclusions and added plenty of forward declarations.
2004-03-31 Not Zed <NotZed@Ximian.com> * *.[ch]: Cleaned up header inclusions and added plenty of forward declarations. Sped up complete re-compilation by upto 20%. ** See bug #55950. * em-utils.c (em_utils_in_addressbook): utility for checking if an email address is in the addressbook. I can't tell if it works 'cause it crashes eds. * em-format-html.c (emfh_gethttp): handle addressbook checking. 2004-03-30 Not Zed <NotZed@Ximian.com> * mail-config.h: clean up the headers and use some forward decl's instead. * em-format-html.c (em_format_html_set_load_http): change state to an int 'style' instead. * em-folder-view.c (emfv_setting_notify): set the format load http option to the config value directly. ** See bug #56147. * message-list.c (clear_info): set the node data to NULL when we unref its data. (ml_get_save_id): use a different test for the root node, and return NULL if we don't have any data on the node (because we're cleaing it). ** See bug #54962. * em-folder-tree.c (emft_popup_new_folder_response): put back the old hack to open the vfolder editor if you try to create a folder under vfolders. ** See bug #55940. * mail-autofilter.c (mail_filter_rename_uri): map the uri to an email uri before passing to filter code. (mail_filter_delete_uri): same here. svn path=/trunk/; revision=25261
-rw-r--r--mail/ChangeLog44
-rw-r--r--mail/em-account-prefs.c5
-rw-r--r--mail/em-composer-prefs.c5
-rw-r--r--mail/em-folder-browser.c7
-rw-r--r--mail/em-folder-tree.c20
-rw-r--r--mail/em-folder-view.c9
-rw-r--r--mail/em-format-html-display.c11
-rw-r--r--mail/em-format-html.c14
-rw-r--r--mail/em-format-html.h5
-rw-r--r--mail/em-subscribe-editor.c2
-rw-r--r--mail/em-utils.c125
-rw-r--r--mail/em-utils.h4
-rw-r--r--mail/mail-account-editor.c8
-rw-r--r--mail/mail-account-editor.h17
-rw-r--r--mail/mail-account-gui.c2
-rw-r--r--mail/mail-account-gui.h131
-rw-r--r--mail/mail-autofilter.c31
-rw-r--r--mail/mail-config-druid.c1
-rw-r--r--mail/mail-config.c4
-rw-r--r--mail/mail-config.h62
-rw-r--r--mail/mail-crypto.c5
-rw-r--r--mail/mail-crypto.h6
-rw-r--r--mail/mail-mt.c1
-rw-r--r--mail/mail-ops.c1
-rw-r--r--mail/mail-send-recv.c7
-rw-r--r--mail/mail-session.c7
-rw-r--r--mail/mail-signature-editor.c6
-rw-r--r--mail/mail-vfolder.c3
-rw-r--r--mail/mail.h3
-rw-r--r--mail/message-list.c13
30 files changed, 391 insertions, 168 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 9a5914919e..17c723c345 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,47 @@
+2004-03-31 Not Zed <NotZed@Ximian.com>
+
+ * *.[ch]: Cleaned up header inclusions and added plenty of forward
+ declarations. Sped up complete re-compilation by upto 20%.
+
+ ** See bug #55950.
+
+ * em-utils.c (em_utils_in_addressbook): utility for checking if an
+ email address is in the addressbook. I can't tell if it works
+ 'cause it crashes eds.
+
+ * em-format-html.c (emfh_gethttp): handle addressbook checking.
+
+2004-03-30 Not Zed <NotZed@Ximian.com>
+
+ * mail-config.h: clean up the headers and use some forward decl's
+ instead.
+
+ * em-format-html.c (em_format_html_set_load_http): change state to
+ an int 'style' instead.
+
+ * em-folder-view.c (emfv_setting_notify): set the format load http
+ option to the config value directly.
+
+ ** See bug #56147.
+
+ * message-list.c (clear_info): set the node data to NULL when we
+ unref its data.
+ (ml_get_save_id): use a different test for the root node, and
+ return NULL if we don't have any data on the node (because we're
+ cleaing it).
+
+ ** See bug #54962.
+
+ * em-folder-tree.c (emft_popup_new_folder_response): put back the
+ old hack to open the vfolder editor if you try to create a folder
+ under vfolders.
+
+ ** See bug #55940.
+
+ * mail-autofilter.c (mail_filter_rename_uri): map the uri to an
+ email uri before passing to filter code.
+ (mail_filter_delete_uri): same here.
+
2004-03-30 Radek Doulik <rodo@ximian.com>
* mail-config.glade: add spellLiveToggled signal
diff --git a/mail/em-account-prefs.c b/mail/em-account-prefs.c
index 9026ce53fe..9cd9034478 100644
--- a/mail/em-account-prefs.c
+++ b/mail/em-account-prefs.c
@@ -20,7 +20,6 @@
*
*/
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -30,7 +29,6 @@
#include <gtk/gtkliststore.h>
#include <gtk/gtktreeselection.h>
-#include "mail.h"
#include "mail-component.h"
#include "mail-config.h"
#include "mail-config-druid.h"
@@ -38,11 +36,12 @@
#include "mail-ops.h"
#include "mail-send-recv.h"
+#include "e-util/e-account-list.h"
+
#include "art/mark.xpm"
#include "em-account-prefs.h"
-
static void em_account_prefs_class_init (EMAccountPrefsClass *class);
static void em_account_prefs_init (EMAccountPrefs *prefs);
static void em_account_prefs_finalise (GObject *obj);
diff --git a/mail/em-composer-prefs.c b/mail/em-composer-prefs.c
index 327b4d1bc3..e822f20b11 100644
--- a/mail/em-composer-prefs.c
+++ b/mail/em-composer-prefs.c
@@ -20,12 +20,15 @@
*
*/
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
#include "em-composer-prefs.h"
#include "composer/e-msg-composer.h"
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index 1c96fb8a77..fb9b2528e1 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -34,6 +34,7 @@
#include <gtk/gtkvpaned.h>
#include <gtkhtml/gtkhtml.h>
#include <gdk/gdkkeysyms.h>
+#include <gconf/gconf-client.h>
#include <libgnomeprintui/gnome-print-dialog.h>
@@ -44,14 +45,14 @@
#include <e-util/e-dialog-utils.h>
-#include <camel/camel-mime-message.h>
+/*#include <camel/camel-mime-message.h>*/
#include <camel/camel-stream.h>
-#include <camel/camel-stream-filter.h>
+/*#include <camel/camel-stream-filter.h>
#include <camel/camel-mime-filter.h>
#include <camel/camel-mime-filter-tohtml.h>
#include <camel/camel-mime-filter-enriched.h>
#include <camel/camel-multipart.h>
-#include <camel/camel-stream-mem.h>
+#include <camel/camel-stream-mem.h>*/
#include <camel/camel-url.h>
#include <bonobo/bonobo-main.h>
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index e17c2b5eed..43fa77cb7a 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -51,11 +51,14 @@
#include "e-util/e-request.h"
#include "e-util/e-dialog-utils.h"
+#include "filter/vfolder-rule.h"
+
#include "mail-mt.h"
#include "mail-ops.h"
#include "mail-tools.h"
#include "mail-config.h"
#include "mail-component.h"
+#include "mail-vfolder.h"
#include "em-utils.h"
#include "em-popup.h"
@@ -2200,11 +2203,20 @@ emft_popup_new_folder_response (EMFolderSelector *emfs, int response, EMFolderTr
camel_object_unref (store);
return;
}
-
+
+ /* HACK: we need to create vfolders using the vfolder editor */
+ if (CAMEL_IS_VEE_STORE(store)) {
+ VfolderRule *rule;
+
+ rule = vfolder_rule_new();
+ filter_rule_set_name((FilterRule *)rule, path);
+ vfolder_gui_add_rule(rule);
+ } else {
+ g_object_ref (emfs);
+ emft_create_folder (si->store, path, new_folder_created_cb, emfs);
+ }
+
camel_object_unref (store);
-
- g_object_ref (emfs);
- emft_create_folder (si->store, path, new_folder_created_cb, emfs);
}
static void
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index 175650fa8c..2e9f9de377 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -2063,12 +2063,9 @@ emfv_setting_notify(GConfClient *gconf, guint cnxn_id, GConfEntry *entry, EMFold
case EMFV_MARK_SEEN_TIMEOUT:
emfv->mark_seen_timeout = gconf_value_get_int (value);
break;
- case EMFV_LOAD_HTTP: {
- int style = gconf_value_get_int (value);
-
- /* FIXME: this doesn't handle the 'sometimes' case, only the always case */
- em_format_html_set_load_http((EMFormatHTML *)emfv->preview, style == 2);
- break; }
+ case EMFV_LOAD_HTTP:
+ em_format_html_set_load_http((EMFormatHTML *)emfv->preview, gconf_value_get_int(value));
+ break;
case EMFV_XMAILER_MASK:
em_format_html_set_xmailer_mask((EMFormatHTML *)emfv->preview, gconf_value_get_int (value));
break;
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index 755d6b85bb..39521e17fb 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -40,9 +40,14 @@
#include <gtk/gtkstock.h>
#include <gtk/gtkimage.h>
#include <gtk/gtkarrow.h>
-
+#include <gtk/gtklabel.h>
+#include <gtk/gtkentry.h>
+#include <gtk/gtktogglebutton.h>
+#include <gtk/gtktable.h>
#include <gtk/gtkmenu.h>
#include <gtk/gtkmenuitem.h>
+#include <gtk/gtkmain.h>
+#include <gtk/gtkdnd.h>
#include <glade/glade.h>
@@ -66,6 +71,8 @@
#include <camel/camel-internet-address.h>
#include <camel/camel-mime-message.h>
#include <camel/camel-cipher-context.h>
+#include <camel/camel-folder.h>
+#include <camel/camel-string-utils.h>
/* should this be in e-util rather than gal? */
#include <gal/util/e-util.h>
@@ -304,7 +311,7 @@ efhd_class_init(GObjectClass *klass)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET(EMFormatHTMLDisplayClass, on_url),
NULL, NULL,
- gtk_marshal_VOID__STRING,
+ g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1,
G_TYPE_STRING);
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 1501cf0ee6..9dbf044262 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -60,10 +60,10 @@
#include <camel/camel-data-cache.h>
#include <camel/camel-file-utils.h>
-
#include <e-util/e-msgport.h>
#include "mail-component.h"
+#include "mail-config.h"
#include "mail-mt.h"
#include "em-format-html.h"
@@ -261,10 +261,10 @@ void em_format_html_load_http(EMFormatHTML *emfh)
}
void
-em_format_html_set_load_http(EMFormatHTML *emfh, int state)
+em_format_html_set_load_http(EMFormatHTML *emfh, int style)
{
- if (emfh->load_http ^ state) {
- emfh->load_http = state;
+ if (emfh->load_http != style) {
+ emfh->load_http = style;
em_format_redraw((EMFormat *)emfh);
}
}
@@ -439,11 +439,13 @@ static void emfh_gethttp(struct _EMFormatHTMLJob *job, int cancelled)
if (instream == NULL) {
char *proxy;
- if (!job->format->load_http_now) {
+ if ((job->format->load_http != MAIL_CONFIG_HTTP_ALWAYS && !job->format->load_http_now)
+ || job->format->load_http == MAIL_CONFIG_HTTP_NEVER
+ || (job->format->load_http == MAIL_CONFIG_HTTP_SOMETIMES
+ && !em_utils_in_addressbook(camel_mime_message_get_from(job->format->format.message)))) {
/* TODO: Ideally we would put the http requests into another queue and only send them out
if the user selects 'load images', when they do. The problem is how to maintain this
state with multiple renderings, and how to adjust the thread dispatch/setup routine to handle it */
- /* FIXME: Need to handle 'load if sender in addressbook' case too */
camel_url_free(url);
goto done;
}
diff --git a/mail/em-format-html.h b/mail/em-format-html.h
index ec69dc5296..ae416a9301 100644
--- a/mail/em-format-html.h
+++ b/mail/em-format-html.h
@@ -20,7 +20,6 @@
*
*/
-
/*
Concrete class for formatting mails to html
*/
@@ -117,7 +116,7 @@ struct _EMFormatHTML {
guint32 content_colour;
guint32 citation_colour;
unsigned int xmailer_mask:4;
- unsigned int load_http:1;
+ unsigned int load_http:2;
unsigned int load_http_now:1;
unsigned int mark_citations:1;
unsigned int simple_headers:1; /* simple header format, no box/table */
@@ -134,7 +133,7 @@ EMFormatHTML *em_format_html_new(void);
void em_format_html_load_http(EMFormatHTML *emf);
-void em_format_html_set_load_http(EMFormatHTML *emf, int state);
+void em_format_html_set_load_http(EMFormatHTML *emf, int style);
void em_format_html_set_mark_citations(EMFormatHTML *emf, int state, guint32 citation_colour);
void em_format_html_set_xmailer_mask(EMFormatHTML *emf, unsigned int xmailer_mask);
diff --git a/mail/em-subscribe-editor.c b/mail/em-subscribe-editor.c
index 6188a0195b..fa7b1bec07 100644
--- a/mail/em-subscribe-editor.c
+++ b/mail/em-subscribe-editor.c
@@ -29,8 +29,6 @@
#include <pthread.h>
-/*#include "evolution-shell-component-utils.h"
- #include "mail.h"*/
#include "mail-tools.h"
#include "mail-ops.h"
#include "mail-mt.h"
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 0453c50ef7..7a553ad68c 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -47,6 +47,9 @@
#include <e-util/e-mktemp.h>
#include <e-util/e-dialog-utils.h>
+#include <e-util/e-account-list.h>
+
+#include <gal/util/e-util.h>
#include "em-utils.h"
#include "em-composer-utils.h"
@@ -2666,3 +2669,125 @@ char *em_uri_to_camel(const char *euri)
return curi;
}
+
+/* ********************************************************************** */
+#include <libebook/e-book.h>
+
+struct _addr_node {
+ char *addr;
+ time_t stamp;
+ int found;
+};
+
+#define EMU_ADDR_CACHE_TIME (60*30) /* in seconds */
+
+static GSList *emu_addr_sources;
+static GHashTable *emu_addr_cache;
+
+static void
+emu_addr_sources_refresh(void)
+{
+ GError *err = NULL;
+ ESourceList *list;
+ GSList *g, *s, *groups, *sources;
+
+ g_slist_foreach(emu_addr_sources, (GFunc)g_object_unref, NULL);
+ g_slist_free(emu_addr_sources);
+ emu_addr_sources = NULL;
+
+ if (!e_book_get_addressbooks(&list, &err)) {
+ g_error_free(err);
+ return;
+ }
+
+ groups = e_source_list_peek_groups(list);
+ for (g=groups;g;g=g_slist_next(g)) {
+ sources = e_source_group_peek_sources((ESourceGroup *)g->data);
+ for (s=sources;s;s=g_slist_next(s)) {
+ emu_addr_sources = g_slist_prepend(emu_addr_sources, g_object_ref(s->data));
+ }
+ }
+
+ g_object_unref(list);
+}
+
+gboolean
+em_utils_in_addressbook(CamelInternetAddress *iaddr)
+{
+ GError *err = NULL;
+ GSList *s;
+ int found = FALSE;
+ EBookQuery *query;
+ const char *addr;
+ struct _addr_node *node;
+ time_t now;
+
+ /* TODO: check all addresses? */
+ if (!camel_internet_address_get(iaddr, 0, NULL, &addr))
+ return FALSE;
+
+ if (emu_addr_cache == NULL) {
+ emu_addr_cache = g_hash_table_new(g_str_hash, g_str_equal);
+ emu_addr_sources_refresh();
+ }
+
+ now = time(0);
+
+ printf("Checking '%s' is in addressbook", addr);
+
+ node = g_hash_table_lookup(emu_addr_cache, addr);
+ if (node) {
+ printf(" -> cached, found %s\n", node->found?"yes":"no");
+ if (node->stamp + EMU_ADDR_CACHE_TIME > now)
+ return node->found;
+ printf(" but expired!\n");
+ } else {
+ printf(" -> not found in cache\n");
+ node = g_malloc0(sizeof(*node));
+ node->addr = g_strdup(addr);
+ }
+
+ query = e_book_query_field_test(E_CONTACT_EMAIL, E_BOOK_QUERY_IS, addr);
+
+ for (s = emu_addr_sources;!found && s;s=g_slist_next(s)) {
+ ESource *source = s->data;
+ GList *contacts;
+ EBook *book;
+
+ book = e_book_new();
+
+ printf(" checking '%s'\n", e_source_get_uri(source));
+
+ if (!e_book_load_source(book, source, TRUE, &err)) {
+ printf("couldn't load source?\n");
+ g_clear_error(&err);
+ g_object_unref(book);
+ continue;
+ }
+
+ if (!e_book_get_contacts(book, query, &contacts, &err)) {
+ printf("Can't get contacts?\n");
+ g_clear_error(&err);
+ g_object_unref(book);
+ continue;
+ }
+
+ found = contacts != NULL;
+
+ printf(" %s\n", found?"found":"not found");
+
+ g_list_foreach(contacts, (GFunc)g_object_unref, NULL);
+ g_list_free(contacts);
+
+ g_object_unref(book);
+ }
+
+ e_book_query_unref(query);
+
+ node->found = found;
+ node->stamp = now;
+
+ g_hash_table_insert(emu_addr_cache, node->addr, node);
+
+ return found;
+}
diff --git a/mail/em-utils.h b/mail/em-utils.h
index e89a68145c..786e9583ec 100644
--- a/mail/em-utils.h
+++ b/mail/em-utils.h
@@ -34,6 +34,7 @@ extern "C" {
struct _GtkWidget;
struct _GtkWindow;
struct _CamelFolder;
+struct _CamelInternetAddress;
struct _CamelStream;
struct _CamelMimeMessage;
struct _CamelMimePart;
@@ -129,6 +130,9 @@ char *em_utils_folder_name_from_uri (const char *uri);
char *em_uri_from_camel (const char *curi);
char *em_uri_to_camel (const char *euri);
+/* is this address in the addressbook? caches results */
+gboolean em_utils_in_addressbook(struct _CamelInternetAddress *addr);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/mail/mail-account-editor.c b/mail/mail-account-editor.c
index 6a599100d6..cfe619b22f 100644
--- a/mail/mail-account-editor.c
+++ b/mail/mail-account-editor.c
@@ -30,9 +30,17 @@
#include <stdlib.h>
#include <string.h>
#include <camel/camel-url.h>
+
#include <e-util/e-dialog-utils.h>
+#include <e-util/e-account.h>
+
+#include <gtk/gtknotebook.h>
+#include <gtk/gtkstock.h>
+#include "em-account-prefs.h"
+#include "mail-config.h"
#include "mail-account-editor.h"
+#include "mail-account-gui.h"
#include "mail-session.h"
static void mail_account_editor_class_init (MailAccountEditorClass *class);
diff --git a/mail/mail-account-editor.h b/mail/mail-account-editor.h
index ff66a47703..b2343390bf 100644
--- a/mail/mail-account-editor.h
+++ b/mail/mail-account-editor.h
@@ -28,11 +28,12 @@ extern "C" {
#pragma }
#endif /* __cplusplus */
-#include <gtk/gtk.h>
-#include <libgnomeui/gnome-file-entry.h>
+#include <gtk/gtkdialog.h>
-#include "mail-account-gui.h"
-#include "em-account-prefs.h"
+struct _GtkNotebook;
+struct _MailAccountGui;
+struct _GtkWindow;
+struct _EMAccountPrefs;
#define MAIL_ACCOUNT_EDITOR_TYPE (mail_account_editor_get_type ())
#define MAIL_ACCOUNT_EDITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MAIL_ACCOUNT_EDITOR_TYPE, MailAccountEditor))
@@ -43,8 +44,8 @@ extern "C" {
struct _MailAccountEditor {
GtkDialog parent_object;
- MailAccountGui *gui;
- GtkNotebook *notebook;
+ struct _MailAccountGui *gui;
+ struct _GtkNotebook *notebook;
};
typedef struct _MailAccountEditor MailAccountEditor;
@@ -56,9 +57,9 @@ typedef struct {
} MailAccountEditorClass;
-GtkType mail_account_editor_get_type (void);
+GType mail_account_editor_get_type (void);
-MailAccountEditor *mail_account_editor_new (EAccount *account, GtkWindow *parent, EMAccountPrefs *dialog);
+MailAccountEditor *mail_account_editor_new (struct _EAccount *account, struct _GtkWindow *parent, struct _EMAccountPrefs *dialog);
#ifdef __cplusplus
}
diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c
index 920fb18c0c..da6ed3bb76 100644
--- a/mail/mail-account-gui.c
+++ b/mail/mail-account-gui.c
@@ -36,6 +36,7 @@
#include <e-util/e-account-list.h>
#include <e-util/e-dialog-utils.h>
+#include "em-account-prefs.h"
#include "em-folder-selection-button.h"
#include "mail-account-gui.h"
#include "mail-session.h"
@@ -47,7 +48,6 @@
#include "mail-config.h"
#include "mail-ops.h"
#include "mail-mt.h"
-#include "mail.h"
#if defined (HAVE_NSS)
#include "smime/gui/e-cert-selector.h"
diff --git a/mail/mail-account-gui.h b/mail/mail-account-gui.h
index 549cb151e1..2b47039c77 100644
--- a/mail/mail-account-gui.h
+++ b/mail/mail-account-gui.h
@@ -30,111 +30,108 @@ extern "C" {
#pragma }
#endif /* __cplusplus */
-#include <gtk/gtk.h>
-#include <libgnomeui/gnome-file-entry.h>
-#include <glade/glade-xml.h>
#include <camel/camel-provider.h>
-#include "mail-config.h"
-#include "em-account-prefs.h"
-
-typedef struct {
- GtkWidget *container;
-
- GtkOptionMenu *type;
- GtkLabel *description;
- GtkEntry *hostname;
- GtkEntry *username;
- GtkEntry *path;
- GtkWidget *ssl_frame;
- GtkOptionMenu *use_ssl;
- GtkWidget *ssl_selected;
- GtkWidget *ssl_hbox;
- GtkWidget *no_ssl;
- GtkOptionMenu *authtype;
- GtkWidget *authitem;
- GtkToggleButton *remember;
- GtkButton *check_supported;
+struct _EAccount;
+struct _EMAccountPrefs;
+
+typedef struct _MailAccountGuiService {
+ struct _GtkWidget *container;
+
+ struct _GtkOptionMenu *type;
+ struct _GtkLabel *description;
+ struct _GtkEntry *hostname;
+ struct _GtkEntry *username;
+ struct _GtkEntry *path;
+ struct _GtkWidget *ssl_frame;
+ struct _GtkOptionMenu *use_ssl;
+ struct _GtkWidget *ssl_selected;
+ struct _GtkWidget *ssl_hbox;
+ struct _GtkWidget *no_ssl;
+ struct _GtkOptionMenu *authtype;
+ struct _GtkWidget *authitem;
+ struct _GtkToggleButton *remember;
+ struct _GtkButton *check_supported;
CamelProvider *provider;
CamelProviderType provider_type;
} MailAccountGuiService;
-typedef struct {
- EAccount *account;
- EMAccountPrefs *dialog;
- GladeXML *xml;
+typedef struct _MailAccountGui {
+ struct _EAccount *account;
+ struct _EMAccountPrefs *dialog;
+ struct _GladeXML *xml;
/* identity */
- GtkEntry *full_name;
- GtkEntry *email_address;
- GtkEntry *reply_to;
- GtkEntry *organization;
+ struct _GtkEntry *full_name;
+ struct _GtkEntry *email_address;
+ struct _GtkEntry *reply_to;
+ struct _GtkEntry *organization;
/* signatures */
- GtkWidget *sig_option_menu;
+ struct _GtkWidget *sig_option_menu;
- MailConfigSignature *def_signature;
+ struct _MailConfigSignature *def_signature;
gboolean auto_signature;
/* incoming mail */
MailAccountGuiService source;
- GtkToggleButton *source_auto_check;
- GtkSpinButton *source_auto_check_min;
+ struct _GtkToggleButton *source_auto_check;
+ struct _GtkSpinButton *source_auto_check_min;
/* extra incoming config */
GHashTable *extra_config;
/* outgoing mail */
MailAccountGuiService transport;
- GtkToggleButton *transport_needs_auth;
+ struct _GtkToggleButton *transport_needs_auth;
/* account management */
- GtkEntry *account_name;
- GtkToggleButton *default_account;
+ struct _GtkEntry *account_name;
+ struct _GtkToggleButton *default_account;
/* special folders */
- GtkButton *drafts_folder_button;
+ struct _GtkButton *drafts_folder_button;
char *drafts_folder_uri;
- GtkButton *sent_folder_button;
+ struct _GtkButton *sent_folder_button;
char *sent_folder_uri;
- GtkButton *restore_folders_button;
+ struct _GtkButton *restore_folders_button;
/* always cc/bcc */
- GtkToggleButton *always_cc;
- GtkEntry *cc_addrs;
- GtkToggleButton *always_bcc;
- GtkEntry *bcc_addrs;
+ struct _GtkToggleButton *always_cc;
+ struct _GtkEntry *cc_addrs;
+ struct _GtkToggleButton *always_bcc;
+ struct _GtkEntry *bcc_addrs;
/* Security */
- GtkEntry *pgp_key;
- GtkToggleButton *pgp_encrypt_to_self;
- GtkToggleButton *pgp_always_sign;
- GtkToggleButton *pgp_no_imip_sign;
- GtkToggleButton *pgp_always_trust;
-
- GtkToggleButton *smime_sign_default;
- GtkEntry *smime_sign_key;
- GtkButton *smime_sign_key_select;
- GtkButton *smime_sign_key_clear;
- GtkButton *smime_sign_select;
- GtkToggleButton *smime_encrypt_default;
- GtkToggleButton *smime_encrypt_to_self;
- GtkEntry *smime_encrypt_key;
- GtkButton *smime_encrypt_key_select;
- GtkButton *smime_encrypt_key_clear;
+ struct _GtkEntry *pgp_key;
+ struct _GtkToggleButton *pgp_encrypt_to_self;
+ struct _GtkToggleButton *pgp_always_sign;
+ struct _GtkToggleButton *pgp_no_imip_sign;
+ struct _GtkToggleButton *pgp_always_trust;
+
+ struct _GtkToggleButton *smime_sign_default;
+ struct _GtkEntry *smime_sign_key;
+ struct _GtkButton *smime_sign_key_select;
+ struct _GtkButton *smime_sign_key_clear;
+ struct _GtkButton *smime_sign_select;
+ struct _GtkToggleButton *smime_encrypt_default;
+ struct _GtkToggleButton *smime_encrypt_to_self;
+ struct _GtkEntry *smime_encrypt_key;
+ struct _GtkButton *smime_encrypt_key_select;
+ struct _GtkButton *smime_encrypt_key_clear;
} MailAccountGui;
-MailAccountGui *mail_account_gui_new (EAccount *account, EMAccountPrefs *dialog);
-void mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top);
+MailAccountGui *mail_account_gui_new (struct _EAccount *account, struct _EMAccountPrefs *dialog);
+void mail_account_gui_setup (MailAccountGui *gui, struct _GtkWidget *top);
gboolean mail_account_gui_save (MailAccountGui *gui);
void mail_account_gui_destroy (MailAccountGui *gui);
-gboolean mail_account_gui_identity_complete (MailAccountGui *gui, GtkWidget **incomplete);
-gboolean mail_account_gui_source_complete (MailAccountGui *gui, GtkWidget **incomplete);
-gboolean mail_account_gui_transport_complete (MailAccountGui *gui, GtkWidget **incomplete);
-gboolean mail_account_gui_management_complete (MailAccountGui *gui, GtkWidget **incomplete);
+gboolean mail_account_gui_identity_complete (MailAccountGui *gui, struct _GtkWidget **incomplete);
+gboolean mail_account_gui_source_complete (MailAccountGui *gui, struct _GtkWidget **incomplete);
+gboolean mail_account_gui_transport_complete (MailAccountGui *gui, struct _GtkWidget **incomplete);
+gboolean mail_account_gui_management_complete (MailAccountGui *gui, struct _GtkWidget **incomplete);
void mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url);
diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c
index 394cb46dd5..d6c5b8e462 100644
--- a/mail/mail-autofilter.c
+++ b/mail/mail-autofilter.c
@@ -378,17 +378,20 @@ filter_gui_add_from_message (CamelMimeMessage *msg, const char *source, int flag
void
mail_filter_rename_uri(CamelStore *store, const char *olduri, const char *newuri)
{
- GCompareFunc uri_cmp = CAMEL_STORE_CLASS(CAMEL_OBJECT_GET_CLASS(store))->compare_folder_name;
FilterContext *fc;
char *user, *system;
GList *changed;
-
+ char *eolduri, *enewuri;
+
+ eolduri = em_uri_from_camel(olduri);
+ enewuri = em_uri_from_camel(newuri);
+
fc = filter_context_new ();
user = g_strdup_printf ("%s/mail/filters.xml", mail_component_peek_base_directory (mail_component_peek ()));
system = EVOLUTION_PRIVDATADIR "/filtertypes.xml";
rule_context_load ((RuleContext *)fc, system, user);
- changed = rule_context_rename_uri((RuleContext *)fc, olduri, newuri, uri_cmp);
+ changed = rule_context_rename_uri((RuleContext *)fc, eolduri, enewuri, g_str_equal);
if (changed) {
printf("Folder rename '%s' -> '%s' changed filters, resaving\n", olduri, newuri);
if (rule_context_save((RuleContext *)fc, user) == -1)
@@ -397,23 +400,28 @@ mail_filter_rename_uri(CamelStore *store, const char *olduri, const char *newuri
}
g_free(user);
- g_object_unref (fc);
+ g_object_unref(fc);
+
+ g_free(enewuri);
+ g_free(eolduri);
}
void
mail_filter_delete_uri(CamelStore *store, const char *uri)
{
- GCompareFunc uri_cmp = CAMEL_STORE_CLASS(CAMEL_OBJECT_GET_CLASS(store))->compare_folder_name;
FilterContext *fc;
char *user, *system;
GList *deleted;
-
+ char *euri;
+
+ euri = em_uri_from_camel(uri);
+
fc = filter_context_new ();
user = g_strdup_printf ("%s/mail/filters.xml", mail_component_peek_base_directory (mail_component_peek ()));
system = EVOLUTION_PRIVDATADIR "/filtertypes.xml";
rule_context_load ((RuleContext *)fc, system, user);
- deleted = rule_context_delete_uri ((RuleContext *) fc, uri, uri_cmp);
+ deleted = rule_context_delete_uri ((RuleContext *) fc, euri, g_str_equal);
if (deleted) {
GtkWidget *dialog;
GString *s;
@@ -426,7 +434,7 @@ mail_filter_delete_uri(CamelStore *store, const char *uri)
l = l->next;
}
g_string_append_printf (s, _("Used the removed folder:\n '%s'\n"
- "And have been updated."), uri);
+ "And have been updated."), euri);
dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO,
GTK_BUTTONS_CLOSE, "%s", s->str);
@@ -436,12 +444,13 @@ mail_filter_delete_uri(CamelStore *store, const char *uri)
gtk_widget_show (dialog);
- printf("Folder deleterename '%s' changed filters, resaving\n", uri);
+ printf("Folder deleterename '%s' changed filters, resaving\n", euri);
if (rule_context_save ((RuleContext *) fc, user) == -1)
g_warning ("Could not write out changed filter rules\n");
rule_context_free_uri_list ((RuleContext *) fc, deleted);
}
- g_free (user);
- g_object_unref (fc);
+ g_free(user);
+ g_object_unref(fc);
+ g_free(euri);
}
diff --git a/mail/mail-config-druid.c b/mail/mail-config-druid.c
index 368742f157..fec23462c4 100644
--- a/mail/mail-config-druid.c
+++ b/mail/mail-config-druid.c
@@ -45,7 +45,6 @@
#include "mail-config-druid.h"
#include "mail-config.h"
#include "mail-ops.h"
-#include "mail.h"
#include "mail-session.h"
#include <evolution-wizard.h>
diff --git a/mail/mail-config.c b/mail/mail-config.c
index 99419f7250..97c223feb3 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -21,7 +21,6 @@
*
*/
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -51,9 +50,10 @@
#include <gal/widgets/e-gui-utils.h>
#include <e-util/e-url.h>
#include <e-util/e-passwords.h>
+#include <e-util/e-account-list.h>
-#include "mail.h"
#include "mail-component.h"
+#include "mail-session.h"
#include "mail-config.h"
#include "mail-mt.h"
#include "mail-tools.h"
diff --git a/mail/mail-config.h b/mail/mail-config.h
index 36891eccb4..67ae283b72 100644
--- a/mail/mail-config.h
+++ b/mail/mail-config.h
@@ -23,22 +23,26 @@
#ifndef MAIL_CONFIG_H
#define MAIL_CONFIG_H
-#include <gtk/gtk.h>
+#include <glib.h>
+#include <glib-object.h>
-#include <gconf/gconf.h>
-#include <gconf/gconf-client.h>
+#include "camel/camel-provider.h" /* can't forward-declare enums, bah */
-#include <camel/camel.h>
+struct _EAccount;
+struct _EAccountList;
+struct _EAccountService;
-#include "e-util/e-account.h"
-#include "e-util/e-account-list.h"
+struct _GConfClient;
+struct _GtkWindow;
+
+struct _CamelFolder;
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
-typedef struct {
+typedef struct _MailConfigSignature {
int id;
char *name;
char *filename;
@@ -104,7 +108,7 @@ void mail_config_clear (void);
void mail_config_write (void);
void mail_config_write_on_exit (void);
-GConfClient *mail_config_get_gconf_client (void);
+struct _GConfClient *mail_config_get_gconf_client (void);
/* General Accessor functions */
gboolean mail_config_is_configured (void);
@@ -116,22 +120,22 @@ const char *mail_config_get_label_color_by_index (int index);
const char **mail_config_get_allowable_mime_types (void);
-void mail_config_service_set_save_passwd (EAccountService *service, gboolean save_passwd);
+void mail_config_service_set_save_passwd (struct _EAccountService *service, gboolean save_passwd);
-gboolean mail_config_find_account (EAccount *account);
-EAccount *mail_config_get_default_account (void);
-EAccount *mail_config_get_account_by_name (const char *account_name);
-EAccount *mail_config_get_account_by_uid (const char *uid);
-EAccount *mail_config_get_account_by_source_url (const char *url);
-EAccount *mail_config_get_account_by_transport_url (const char *url);
-EAccountList *mail_config_get_accounts (void);
-void mail_config_add_account (EAccount *account);
-void mail_config_remove_account (EAccount *account);
+gboolean mail_config_find_account (struct _EAccount *account);
+struct _EAccount *mail_config_get_default_account (void);
+struct _EAccount *mail_config_get_account_by_name (const char *account_name);
+struct _EAccount *mail_config_get_account_by_uid (const char *uid);
+struct _EAccount *mail_config_get_account_by_source_url (const char *url);
+struct _EAccount *mail_config_get_account_by_transport_url (const char *url);
+struct _EAccountList *mail_config_get_accounts (void);
+void mail_config_add_account (struct _EAccount *account);
+void mail_config_remove_account (struct _EAccount *account);
-void mail_config_set_default_account (EAccount *account);
+void mail_config_set_default_account (struct _EAccount *account);
-EAccountIdentity *mail_config_get_default_identity (void);
-EAccountService *mail_config_get_default_transport (void);
+struct _EAccountIdentity *mail_config_get_default_identity (void);
+struct _EAccountService *mail_config_get_default_transport (void);
void mail_config_save_accounts (void);
@@ -143,25 +147,21 @@ void mail_config_signature_set_name (MailConfigSignature *sig, const char *n
void mail_config_signature_set_html (MailConfigSignature *sig, gboolean html);
void mail_config_signature_set_filename (MailConfigSignature *sig, const char *filename);
-
/* uri's got changed by the store, etc */
void mail_config_uri_renamed (GCompareFunc uri_cmp, const char *old, const char *new);
void mail_config_uri_deleted (GCompareFunc uri_cmp, const char *uri);
-
/* static utility functions */
-char *mail_config_folder_to_cachename (CamelFolder *folder, const char *prefix);
-char *mail_config_folder_to_safe_url (CamelFolder *folder);
+char *mail_config_folder_to_cachename (struct _CamelFolder *folder, const char *prefix);
+char *mail_config_folder_to_safe_url (struct _CamelFolder *folder);
-gboolean mail_config_check_service (const char *url, CamelProviderType type, GList **authtypes, GtkWindow *window);
+/* Ugh, this totally does not belong in this module */
+gboolean mail_config_check_service (const char *url, CamelProviderType type, GList **authtypes, struct _GtkWindow *window);
-
-
-GtkType evolution_mail_config_get_type (void);
+GType evolution_mail_config_get_type (void);
gboolean evolution_mail_config_factory_init (void);
-
typedef enum {
MAIL_CONFIG_SIG_EVENT_NAME_CHANGED,
MAIL_CONFIG_SIG_EVENT_CONTENT_CHANGED,
@@ -176,7 +176,7 @@ void mail_config_signature_register_client (MailConfigSignatureClient client, gp
void mail_config_signature_unregister_client (MailConfigSignatureClient client, gpointer data);
void mail_config_signature_emit_event (MailConfigSigEvent event, MailConfigSignature *sig);
-void mail_config_write_account_sig (EAccount *account, int i);
+void mail_config_write_account_sig (struct _EAccount *account, int i);
char *mail_config_signature_run_script (char *script);
#ifdef __cplusplus
diff --git a/mail/mail-crypto.c b/mail/mail-crypto.c
index c77bc14425..4cc1fe9ae0 100644
--- a/mail/mail-crypto.c
+++ b/mail/mail-crypto.c
@@ -27,10 +27,11 @@
#include <stdlib.h>
#include <string.h>
+#include <camel/camel-gpg-context.h>
+#include <e-util/e-account.h>
+
#include "mail-crypto.h"
#include "mail-session.h"
-#include "mail-config.h"
-
/**
* mail_crypto_get_pgp_cipher_context:
diff --git a/mail/mail-crypto.h b/mail/mail-crypto.h
index a380f65863..5a7801c15e 100644
--- a/mail/mail-crypto.h
+++ b/mail/mail-crypto.h
@@ -23,17 +23,15 @@
#ifndef MAIL_CRYPTO_H
#define MAIL_CRYPTO_H
-#include <camel/camel.h>
-#include "mail-config.h"
-
#ifdef __cplusplus
extern "C" {
#pragma }
#endif /* __cplusplus */
+struct _EAccount;
/* PGP/MIME convenience wrappers */
-CamelCipherContext *mail_crypto_get_pgp_cipher_context (EAccount *account);
+struct _CamelCipherContext *mail_crypto_get_pgp_cipher_context(struct _EAccount *account);
#ifdef __cplusplus
}
diff --git a/mail/mail-mt.c b/mail/mail-mt.c
index 3c33253932..7afb2efe18 100644
--- a/mail/mail-mt.c
+++ b/mail/mail-mt.c
@@ -14,6 +14,7 @@
#include <gtk/gtkwidget.h>
#include <gtk/gtkdialog.h>
#include <gtk/gtkstock.h>
+#include <gtk/gtkmessagedialog.h>
#include <libgnome/gnome-i18n.h>
#include <gal/widgets/e-gui-utils.h>
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index d2e8a19c4e..043c04ef6e 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -37,7 +37,6 @@
#include <camel/camel-operation.h>
#include <camel/camel-vtrash-folder.h>
#include <camel/camel-vee-store.h>
-#include "mail.h"
#include "mail-component.h"
#include "mail-tools.h"
#include "mail-ops.h"
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index 1ee8eebf7f..3cd99eaedb 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -32,9 +32,15 @@
#include <gtk/gtkmain.h>
#include <gtk/gtkdialog.h>
#include <gtk/gtkstock.h>
+#include <gtk/gtkprogressbar.h>
+#include <gtk/gtktable.h>
+#include <gtk/gtklabel.h>
+#include <gtk/gtkimage.h>
+#include <gtk/gtkbox.h>
#include <libgnomeui/gnome-window-icon.h>
#include "e-util/e-gtk-utils.h"
+#include "e-util/e-account-list.h"
#include "widgets/misc/e-clipped-label.h"
#include "filter/filter-filter.h"
@@ -42,7 +48,6 @@
#include "camel/camel-folder.h"
#include "camel/camel-operation.h"
-#include "mail.h"
#include "mail-mt.h"
#include "mail-component.h"
#include "mail-config.h"
diff --git a/mail/mail-session.c b/mail/mail-session.c
index 99ec278ae6..38718eac9c 100644
--- a/mail/mail-session.c
+++ b/mail/mail-session.c
@@ -29,8 +29,12 @@
#include <gtk/gtkdialog.h>
#include <gtk/gtkstock.h>
+#include <gtk/gtkentry.h>
+#include <gtk/gtkmessagedialog.h>
+#include <gtk/gtktogglebutton.h>
+#include <gtk/gtkbox.h>
+#include <gtk/gtkcheckbutton.h>
-#include <gconf/gconf.h>
#include <gconf/gconf-client.h>
#include <libgnome/gnome-config.h>
@@ -39,7 +43,6 @@
#include "camel/camel-filter-driver.h"
#include "filter/filter-context.h"
#include "filter/filter-filter.h"
-#include "mail.h"
#include "mail-component.h"
#include "mail-config.h"
#include "mail-session.h"
diff --git a/mail/mail-signature-editor.c b/mail/mail-signature-editor.c
index 570a0157c4..2237c1c70c 100644
--- a/mail/mail-signature-editor.c
+++ b/mail/mail-signature-editor.c
@@ -26,8 +26,12 @@
#include <config.h>
#endif
-#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
#include <errno.h>
+
+#include <string.h>
#include <bonobo.h>
#include <bonobo/bonobo-stream-memory.h>
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index d7ff1908dc..7e8fec52c4 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -29,15 +29,16 @@
#include <libgnome/gnome-i18n.h>
#include "mail-component.h"
+#include "mail-config.h"
#include "mail-vfolder.h"
#include "mail-tools.h"
#include "mail-autofilter.h"
#include "mail-folder-cache.h"
-#include "mail.h"
#include "mail-ops.h"
#include "mail-mt.h"
#include "em-utils.h"
+#include "e-util/e-account-list.h"
#include "e-util/e-dialog-utils.h"
#include "camel/camel.h"
diff --git a/mail/mail.h b/mail/mail.h
index 52d1b720a5..4127660048 100644
--- a/mail/mail.h
+++ b/mail/mail.h
@@ -27,7 +27,4 @@
#include "mail-session.h"
#include "mail-types.h"
-/* mail-identify */
-char *mail_identify_mime_part (CamelMimePart *part, MailDisplay *md);
-gboolean evolution_folder_info_factory_init (void);
diff --git a/mail/message-list.c b/mail/message-list.c
index 6403c1549c..f29971dfa2 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -32,9 +32,11 @@
#include <glib/gunicode.h>
-#include <gconf/gconf.h>
#include <gconf/gconf-client.h>
+#include <gtk/gtkmain.h>
+#include <gtk/gtkinvisible.h>
+
#include <gal/util/e-util.h>
#include <gal/widgets/e-gui-utils.h>
#include <gal/e-table/e-cell-text.h>
@@ -774,9 +776,15 @@ ml_get_save_id (ETreeModel *etm, ETreePath path, void *data)
{
CamelMessageInfo *info;
+ if (e_tree_model_node_is_root(etm, path))
+ return g_strdup("root");
+
+ /* Note: etable can ask for the save_id while we're clearing it,
+ which is the only time data should be null */
info = e_tree_memory_node_get_data (E_TREE_MEMORY(etm), path);
if (info == NULL)
- return g_strdup("root");
+ return NULL;
+
return g_strdup (camel_message_info_uid(info));
}
@@ -1844,6 +1852,7 @@ clear_info(char *key, ETreePath *node, MessageList *ml)
info = e_tree_memory_node_get_data((ETreeMemory *)ml->model, node);
camel_folder_free_message_info(ml->folder, info);
+ e_tree_memory_node_set_data((ETreeMemory *)ml->model, node, NULL);
}
static void