aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-component.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-03-03 14:39:14 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-03-03 14:39:14 +0800
commit467bbf6fb6b0b215d7b6bd18a6b84acd839a08f9 (patch)
tree9bb0cb5e2fb74fbea57f5dfd818a4769349f8990 /mail/mail-component.c
parent9b2a16eb3e313e3057a8ac785fecacf54c8266a0 (diff)
downloadgsoc2013-evolution-467bbf6fb6b0b215d7b6bd18a6b84acd839a08f9.tar.gz
gsoc2013-evolution-467bbf6fb6b0b215d7b6bd18a6b84acd839a08f9.tar.zst
gsoc2013-evolution-467bbf6fb6b0b215d7b6bd18a6b84acd839a08f9.zip
if we have the folder opened already, and its the outbox, then use the
2004-03-03 Not Zed <NotZed@Ximian.com> * em-inline-filter.c (emif_scan): * em-folder-tree-model.c (em_folder_tree_model_set_folder_info): if we have the folder opened already, and its the outbox, then use the total count instead of unread count. Bit of hack, but copies mail-folder-cache stuff. * mail-component.c (mc_add_store): renamed from mail_component_add_store, internal call. Added a done callback. (mc_add_local_store): renamed from mc_add_store, callback for local store. (mail_component_add_store): call mc_add_store to do the work. (mc_add_local_store_done): ugh, the target of all this shit - note all the default folders now they should be setup. * mail-folder-cache.c (mail_note_folder): clean up the logic a bit. was gonna do osmething else but it didn't work. 2004-03-02 Not Zed <NotZed@Ximian.com> * mail-send-recv.c (mail_send): if we're already sending, up the again count to tell it we need to re-send again. (receive_done): if we've been asked to run a send again while we were already running it, run it again to make sure we didn't miss any new messages. See bug #46839. * em-mailer-prefs.c (em_mailer_prefs_construct): update check_incoming_imap changes for merge conflicts. (settings_changed): i have no idea what these changes jeff did do, but check_incoming_imap is no longer needed, so i've deleted most of it. 2004-02-27 Not Zed <NotZed@Ximian.com> * em-format.c (emf_multipart_encrypted, emf_multipart_signed): If validation fails, display as multipart/mixed rather than unkown attachment type, and make the error a little clearer that its an error. See #52939. 2004-02-26 Not Zed <NotZed@Ximian.com> * message-list.c (regen_list_regened): NOOP if the folder has changed. * mail-session.c (mail_session_check_junk_notify): remove check_incoming_imap test. (mail_session_init): " * evolution-mail.schemas.in.in: Remove check_incoming_imap option. * mail-config.glade: Remove check incoming imap checkbox. * em-mailer-prefs.c (em_mailer_prefs_construct): remove check_incoming_imap test. (em_mailer_prefs_apply): " (settings_changed): " svn path=/trunk/; revision=24944
Diffstat (limited to 'mail/mail-component.c')
-rw-r--r--mail/mail-component.c65
1 files changed, 40 insertions, 25 deletions
diff --git a/mail/mail-component.c b/mail/mail-component.c
index f2d2304736..ec02f61196 100644
--- a/mail/mail-component.c
+++ b/mail/mail-component.c
@@ -106,16 +106,6 @@ struct _MailComponentPrivate {
CamelStore *local_store;
};
-/* Utility functions. */
-static void
-mc_add_store(CamelStore *store, const char *name, MailComponent *mc)
-{
- mail_component_add_store(mc, store, name);
-
- camel_object_unref(store);
- g_object_unref(mc);
-}
-
/* indexed by _mail_component_folder_t */
static struct {
char *name;
@@ -129,6 +119,44 @@ static struct {
{ "Inbox", }, /* 'always local' inbox */
};
+/* Utility functions. */
+static void
+mc_add_store(MailComponent *component, CamelStore *store, const char *name, void (*done)(CamelStore *store, CamelFolderInfo *info, void *data))
+{
+ char *service_name = NULL;
+
+ MAIL_COMPONENT_DEFAULT(component);
+
+ if (name == NULL)
+ name = service_name = camel_service_get_name ((CamelService *) store, TRUE);
+
+ camel_object_ref(store);
+ g_hash_table_insert(component->priv->store_hash, store, g_strdup(name));
+ em_folder_tree_model_add_store(component->priv->model, store, name);
+ mail_note_store(store, NULL, done, component);
+ g_free(service_name);
+}
+
+static void
+mc_add_local_store_done(CamelStore *store, CamelFolderInfo *info, void *data)
+{
+ MailComponent *mc = data;
+ int i;
+
+ for (i=0;i<sizeof(mc_default_folders)/sizeof(mc_default_folders[0]);i++) {
+ if (mc_default_folders[i].folder)
+ mail_note_folder(mc_default_folders[i].folder);
+ }
+}
+
+static void
+mc_add_local_store(CamelStore *store, const char *name, MailComponent *mc)
+{
+ mc_add_store(mc, store, name, mc_add_local_store_done);
+ camel_object_unref(store);
+ g_object_unref(mc);
+}
+
static void
mc_setup_local_store(MailComponent *mc)
{
@@ -170,7 +198,7 @@ mc_setup_local_store(MailComponent *mc)
g_object_ref(mc);
camel_object_ref(p->local_store);
- mail_async_event_emit(p->async_event, MAIL_ASYNC_GUI, (MailAsyncFunc)mc_add_store, p->local_store, _("On This Computer"), mc);
+ mail_async_event_emit(p->async_event, MAIL_ASYNC_GUI, (MailAsyncFunc)mc_add_local_store, p->local_store, _("On This Computer"), mc);
return;
fail:
@@ -329,8 +357,6 @@ impl_dispose (GObject *object)
{
MailComponentPrivate *priv = MAIL_COMPONENT (object)->priv;
- printf("mail dispose?\n");
-
if (priv->activity_handler != NULL) {
g_object_unref (priv->activity_handler);
priv->activity_handler = NULL;
@@ -706,18 +732,7 @@ mail_component_peek_activity_handler (MailComponent *component)
void
mail_component_add_store (MailComponent *component, CamelStore *store, const char *name)
{
- char *service_name = NULL;
-
- MAIL_COMPONENT_DEFAULT(component);
-
- if (name == NULL)
- name = service_name = camel_service_get_name ((CamelService *) store, TRUE);
-
- camel_object_ref(store);
- g_hash_table_insert(component->priv->store_hash, store, g_strdup(name));
- em_folder_tree_model_add_store(component->priv->model, store, name);
- mail_note_store(store, NULL, NULL, NULL);
- g_free(service_name);
+ mc_add_store(component, store, name, NULL);
}
/**