aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog12
-rw-r--r--mail/mail-component.c5
-rw-r--r--mail/mail-component.h9
-rw-r--r--mail/mail-ops.c17
-rw-r--r--mail/mail-send-recv.c1
-rw-r--r--mail/mail-tools.c10
6 files changed, 27 insertions, 27 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 930a00e535..119b4f015a 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,15 @@
+2003-11-17 Not Zed <NotZed@Ximian.com>
+
+ * mail-tools.c (mail_tool_get_local_inbox): thin wrapper on
+ mail_component_get_local_inbox.
+
+ * mail-component.c (mail_component_get_local_inbox): helper to get
+ the default local inbox.
+
+ * mail-ops.c (fetch_mail_fetch): if we can't get the inbox, make
+ sure we still unref the filter driver here by using hte same exit
+ code. Fixes a crash.
+
2003-11-14 Jeffrey Stedfast <fejj@ximian.com>
* em-folder-tree.c (emft_popup_new_folder_response): We can't use
diff --git a/mail/mail-component.c b/mail/mail-component.c
index a551eb26ce..db65ced743 100644
--- a/mail/mail-component.c
+++ b/mail/mail-component.c
@@ -676,6 +676,11 @@ mail_component_get_tree_model (MailComponent *component)
return model;
}
+struct _CamelFolder *
+mail_component_get_local_inbox(MailComponent *mc, struct _CamelException *ex)
+{
+ return camel_store_get_folder(mc->priv->local_store, "Inbox", 0, ex);
+}
extern struct _CamelSession *session;
diff --git a/mail/mail-component.h b/mail/mail-component.h
index 1d31a22da5..8df5ed8700 100644
--- a/mail/mail-component.h
+++ b/mail/mail-component.h
@@ -29,19 +29,14 @@
#include <camel/camel-store.h>
#include <filter/rule-context.h>
#include <bonobo/bonobo-object.h>
-
-#include "em-folder-tree-model.h"
-
#include "Evolution.h"
-
#define MAIL_TYPE_COMPONENT (mail_component_get_type ())
#define MAIL_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAIL_TYPE_COMPONENT, MailComponent))
#define MAIL_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MAIL_TYPE_COMPONENT, MailComponentClass))
#define MAIL_IS_COMPONENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAIL_TYPE_COMPONENT))
#define MAIL_IS_COMPONENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), MAIL_TYPE_COMPONENT))
-
typedef struct _MailComponent MailComponent;
typedef struct _MailComponentPrivate MailComponentPrivate;
typedef struct _MailComponentClass MailComponentClass;
@@ -58,7 +53,6 @@ struct _MailComponentClass {
POA_GNOME_Evolution_Component__epv epv;
};
-
GType mail_component_get_type (void);
MailComponent *mail_component_peek (void);
@@ -85,7 +79,8 @@ void mail_component_stores_foreach (MailComponent *component,
void mail_component_remove_folder (MailComponent *component, CamelStore *store, const char *path);
-EMFolderTreeModel *mail_component_get_tree_model (MailComponent *component);
+struct _EMFolderTreeModel *mail_component_get_tree_model (MailComponent *component);
+struct _CamelFolder *mail_component_get_local_inbox(MailComponent *mc, struct _CamelException *ex);
char *em_uri_from_camel (const char *curi);
char *em_uri_to_camel (const char *euri);
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index b7aad2e55b..7174ea1b71 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -270,15 +270,12 @@ fetch_mail_fetch (struct _mail_msg *mm)
struct _fetch_mail_msg *m = (struct _fetch_mail_msg *)mm;
struct _filter_mail_msg *fm = (struct _filter_mail_msg *)mm;
int i;
-
+
if (m->cancel)
camel_operation_register (m->cancel);
- if ((fm->destination = mail_tool_get_local_inbox (&mm->ex)) == NULL) {
- if (m->cancel)
- camel_operation_unregister (m->cancel);
- return;
- }
+ if ((fm->destination = mail_tool_get_local_inbox (&mm->ex)) == NULL)
+ goto fail;
/* FIXME: this should support keep_on_server too, which would then perform a spool
access thingy, right? problem is matching raw messages to uid's etc. */
@@ -355,7 +352,7 @@ fetch_mail_fetch (struct _mail_msg *mm)
fm->source_folder = NULL;
}
}
-
+fail:
if (m->cancel)
camel_operation_unregister (m->cancel);
@@ -372,7 +369,7 @@ static void
fetch_mail_fetched (struct _mail_msg *mm)
{
struct _fetch_mail_msg *m = (struct _fetch_mail_msg *)mm;
-
+
if (m->done)
m->done (m->source_uri, m->data);
}
@@ -385,7 +382,7 @@ fetch_mail_free (struct _mail_msg *mm)
g_free (m->source_uri);
if (m->cancel)
camel_operation_unref (m->cancel);
-
+
filter_folder_free (mm);
}
@@ -417,7 +414,7 @@ mail_fetch_mail (const char *source, int keep, const char *type, CamelOperation
}
m->done = done;
m->data = data;
-
+
fm->driver = camel_session_get_filter_driver (session, type, NULL);
camel_filter_driver_set_folder_func (fm->driver, get_folder, get_data);
if (status)
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index 193f7a0af4..e7d546294d 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -162,7 +162,6 @@ free_folder_info(void *key, struct _folder_info *info, void *data)
static void free_send_info(void *key, struct _send_info *info, void *data)
{
- d(printf("Freeing send info %p\n", info));
g_free(info->uri);
camel_operation_unref(info->cancel);
if (info->timeout_id != 0)
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index 0538efd354..9a10b0eb5b 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -59,15 +59,7 @@
CamelFolder *
mail_tool_get_local_inbox (CamelException *ex)
{
- CamelFolder *folder;
- char *url;
-
- url = g_strdup_printf("file://%s/local/Inbox",
- mail_component_peek_base_directory (mail_component_peek ()));
- folder = mail_tool_uri_to_folder (url, 0, ex);
- g_free (url);
-
- return folder;
+ return mail_component_get_local_inbox(mail_component_peek(), ex);
}
CamelFolder *