diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-10-30 00:56:45 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-10-30 00:56:45 +0800 |
commit | 5843bd83e79d16eecf87df5aa357c9577cf60a9c (patch) | |
tree | 7a2124146d8317754fd524591485ad22344002e9 | |
parent | 26f77b16e1f8a3207554e607e2ee18bb7b14c97d (diff) | |
download | gsoc2013-evolution-5843bd83e79d16eecf87df5aa357c9577cf60a9c.tar gsoc2013-evolution-5843bd83e79d16eecf87df5aa357c9577cf60a9c.tar.gz gsoc2013-evolution-5843bd83e79d16eecf87df5aa357c9577cf60a9c.tar.bz2 gsoc2013-evolution-5843bd83e79d16eecf87df5aa357c9577cf60a9c.tar.lz gsoc2013-evolution-5843bd83e79d16eecf87df5aa357c9577cf60a9c.tar.xz gsoc2013-evolution-5843bd83e79d16eecf87df5aa357c9577cf60a9c.tar.zst gsoc2013-evolution-5843bd83e79d16eecf87df5aa357c9577cf60a9c.zip |
Nuked the MailConfig interface stuff.
2003-10-29 Jeffrey Stedfast <fejj@ximian.com>
* GNOME_Evolution_Mail.server.in.in: Nuked the MailConfig
interface stuff.
* Mailer.idl: Removed. None of the interfaces are needed/used
anymore.
* folder-info.[c,h]: Removed. The summary was the only thing that
needed/used this code and it has been nuked into oblivion, so
these interfaces are no longer needed.
* mail-config.c: Removed old crufty CORBA interface snot that is
no longer needed or used.
svn path=/trunk/; revision=23118
-rw-r--r-- | mail/ChangeLog | 15 | ||||
-rw-r--r-- | mail/GNOME_Evolution_Mail.server.in.in | 24 | ||||
-rw-r--r-- | mail/Mailer.idl | 67 | ||||
-rw-r--r-- | mail/Makefile.am | 26 | ||||
-rw-r--r-- | mail/folder-info.c | 266 | ||||
-rw-r--r-- | mail/folder-info.h | 45 | ||||
-rw-r--r-- | mail/mail-config.c | 141 |
7 files changed, 16 insertions, 568 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 877584dfd0..2c63e7fae3 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,18 @@ +2003-10-29 Jeffrey Stedfast <fejj@ximian.com> + + * GNOME_Evolution_Mail.server.in.in: Nuked the MailConfig + interface stuff. + + * Mailer.idl: Removed. None of the interfaces are needed/used + anymore. + + * folder-info.[c,h]: Removed. The summary was the only thing that + needed/used this code and it has been nuked into oblivion, so + these interfaces are no longer needed. + + * mail-config.c: Removed old crufty CORBA interface snot that is + no longer needed or used. + 2003-10-27 Jeffrey Stedfast <fejj@ximian.com> * Fixes bug #49816 diff --git a/mail/GNOME_Evolution_Mail.server.in.in b/mail/GNOME_Evolution_Mail.server.in.in index 7e286c9bf8..c80e8b662b 100644 --- a/mail/GNOME_Evolution_Mail.server.in.in +++ b/mail/GNOME_Evolution_Mail.server.in.in @@ -84,30 +84,6 @@ _value="Evolution Mail composer"/> </oaf_server> - <!-- MailConfig interface --> - <oaf_server iid="OAFIID:GNOME_Evolution_MailConfig" - type="factory" - location="OAFIID:GNOME_Evolution_Mail_ControlFactory"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution/MailConfig:1.0"/> - </oaf_attribute> - - <oaf_attribute name="name" type="string" - _value="Evolution Mail configuration interface"/> - </oaf_server> - - <!-- FolderInfo interface --> - - <oaf_server iid="OAFIID:GNOME_Evolution_FolderInfo" - type="factory" - location="OAFIID:GNOME_Evolution_Mail_ControlFactory"> - - <oaf_attribute name="repo_ids" type="stringv"> - <item value="IDL:GNOME/Evolution/FolderInfo:1.0"/> - </oaf_attribute> - </oaf_server> - <!-- Startup Wizard --> <!-- (wizard) --> diff --git a/mail/Mailer.idl b/mail/Mailer.idl deleted file mode 100644 index 353d2bae46..0000000000 --- a/mail/Mailer.idl +++ /dev/null @@ -1,67 +0,0 @@ -/* - * mail.idl: Mail interfaces for Evolution - * - * Author: - * Miguel de Icaza (miguel@ximian.com) - * - * (C) 2000 Ximian, Inc. - */ - -#include <Bonobo.idl> - -module GNOME { -module Evolution { - - interface FolderInfo : Bonobo::Unknown { - struct MessageCount { - string path; - long count; - long unread; - }; - - void getInfo (in string foldername, - in Bonobo::Listener listener); - }; - - interface MailConfig : Bonobo::Unknown { - - struct Identity { - string name; - string address; - string reply_to; - string organization; - }; - - struct Service { - string url; - boolean keep_on_server; - boolean auto_check; - long auto_check_time; - boolean save_passwd; - boolean enabled; - }; - - struct Account { - string name; - - Identity id; - Service source; - Service transport; - - string drafts_folder_uri; - string sent_folder_uri; - }; - - void addAccount (in Account acc); - void removeAccount (in string name); - }; - - interface MailFilter : Bonobo::Unknown { - - void addFilter (in string rule); - - void removeFilter (in string rule); - }; -}; -}; - diff --git a/mail/Makefile.am b/mail/Makefile.am index f52e6003ba..a17c594d2a 100644 --- a/mail/Makefile.am +++ b/mail/Makefile.am @@ -39,24 +39,6 @@ INCLUDES = \ component_LTLIBRARIES = libevolution-mail.la - -# Code generation for Mailer.idl - -MAILER_IDL = Mailer.idl - -MAILER_IDL_GENERATED_H = \ - Mailer.h -MAILER_IDL_GENERATED_C = \ - Mailer-common.c \ - Mailer-skels.c \ - Mailer-stubs.c -MAILER_IDL_GENERATED = $(MAILER_IDL_GENERATED_C) $(MAILER_IDL_GENERATED_H) - -$(MAILER_IDL_GENERATED_H): Mailer.idl - $(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl $(IDL_INCLUDES) $(srcdir)/Mailer.idl -$(MAILER_IDL_GENERATED_C): $(MAILER_IDL_GENERATED_H) - - # Code generation for Spell.idl SPELL_IDL = Spell.idl @@ -80,7 +62,6 @@ Spell-impl.o: Spell.h libevolution_mail_la_SOURCES = \ $(SPELL_IDL_GENERATED) \ - $(MAILER_IDL_GENERATED) \ e-searching-tokenizer.c \ e-searching-tokenizer.h \ em-account-prefs.c \ @@ -133,8 +114,6 @@ libevolution_mail_la_SOURCES = \ em-html-stream.h \ folder-browser-factory.c \ folder-browser-factory.h \ - folder-info.c \ - folder-info.h \ mail-account-editor.c \ mail-account-editor.h \ mail-account-gui.c \ @@ -227,12 +206,9 @@ MARSHAL_GENERATED = em-marshal.c em-marshal.h etspec_DATA = message-list.etspec -idl_DATA = $(MAILER_IDL) - EXTRA_DIST = \ ChangeLog.pre-1-4 \ em-marshal.list \ - Mailer.idl \ $(SPELL_IDL) \ $(glade_DATA) \ $(schema_DATA) \ @@ -273,5 +249,5 @@ install-data-local: dist-hook: cd $(distdir); rm -f $(BUILT_SOURCES) -BUILT_SOURCES = $(MAILER_IDL_GENERATED) $(SPELL_IDL_GENERATED) $(MARSHAL_GENERATED) $(server_DATA) +BUILT_SOURCES = $(SPELL_IDL_GENERATED) $(MARSHAL_GENERATED) $(server_DATA) CLEANFILES = $(BUILT_SOURCES) diff --git a/mail/folder-info.c b/mail/folder-info.c deleted file mode 100644 index 47fe547604..0000000000 --- a/mail/folder-info.c +++ /dev/null @@ -1,266 +0,0 @@ -/* - * folder-info.c: Implementation of GNOME_Evolution_FolderInfo - * - * Copyright (C) 2001 Ximian, Inc. - * - * Authors: Iain Holmes <iain@ximian.com> - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "Mailer.h" - -#include <glib.h> - -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-generic-factory.h> -#include <bonobo/bonobo-property-bag.h> -#include <bonobo/bonobo-context.h> -#include <bonobo/bonobo-exception.h> - -#include "folder-info.h" - -#include "mail.h" -#include "mail-mt.h" -#include "mail-tools.h" - -#include <camel/camel-folder.h> -#include <camel/camel-exception.h> - -#define FOLDER_INFO_IID "OAFIID:GNOME_Evolution_FolderInfo_Factory" - -#define PARENT_TYPE BONOBO_OBJECT_TYPE -static BonoboObjectClass *parent_class = NULL; - -static GSList *folder_infos; - -typedef struct _EvolutionFolderInfo EvolutionFolderInfo; -typedef struct _EvolutionFolderInfoClass EvolutionFolderInfoClass; - -struct _EvolutionFolderInfo { - BonoboObject parent; - - BonoboPropertyBag *pb; -}; - -struct _EvolutionFolderInfoClass { - BonoboObjectClass parent_class; - - POA_GNOME_Evolution_FolderInfo__epv epv; -}; - -/* MT stuff */ -struct _folder_info_msg { - struct _mail_msg msg; - - Bonobo_Listener listener; - char *foldername; - - int read; - int unread; -}; - -gboolean ready; - -static char * -do_describe_info (struct _mail_msg *mm, gint complete) -{ - return g_strdup (_("Getting Folder Information")); -} - -static void -do_get_info (struct _mail_msg *mm) -{ - struct _folder_info_msg *m = (struct _folder_info_msg *) mm; - CamelFolder *folder; - - folder = mail_tool_uri_to_folder (m->foldername, 0, NULL); - if (folder) { - m->read = camel_folder_get_message_count (folder); - m->unread = camel_folder_get_unread_message_count (folder); - } -} - -static void -do_got_info (struct _mail_msg *mm) -{ - struct _folder_info_msg *m = (struct _folder_info_msg *) mm; - CORBA_Environment ev; - CORBA_any a; - GNOME_Evolution_FolderInfo_MessageCount count; - -/* g_print ("You've got mail: %d, %d\n", m->read, m->unread); */ - - count.path = m->foldername; - count.count = m->read; - count.unread = m->unread; - - a._type = (CORBA_TypeCode) TC_GNOME_Evolution_FolderInfo_MessageCount; - a._value = &count; - - CORBA_exception_init (&ev); - Bonobo_Listener_event (m->listener, "youve-got-mail", &a, &ev); - if (BONOBO_EX (&ev)) { - g_warning ("Got exception on listener: %s", CORBA_exception_id (&ev)); - } - CORBA_exception_free (&ev); -} - -static void -do_free_info (struct _mail_msg *mm) -{ - struct _folder_info_msg *m = (struct _folder_info_msg *) mm; - - bonobo_object_release_unref (m->listener, NULL); - g_free (m->foldername); -} - -struct _mail_msg_op get_info_op = { - do_describe_info, - do_get_info, - do_got_info, - do_free_info, -}; - -typedef struct { - int read; - int unread; -} MailFolderInfo; - -/* Returns a MailFolderInfo struct or NULL on error */ -static void -mail_get_info (const char *foldername, - Bonobo_Listener listener) -{ - CORBA_Environment ev; - struct _folder_info_msg *m; - - m = mail_msg_new (&get_info_op, NULL, sizeof (*m)); - - /*g_print ("Folder: %s", foldername);*/ - m->foldername = g_strdup (foldername); - - CORBA_exception_init (&ev); - m->listener = bonobo_object_dup_ref (listener, &ev); - CORBA_exception_free (&ev); - - e_thread_put (mail_thread_new, (EMsg *) m); -} - -static void -impl_GNOME_Evolution_FolderInfo_getInfo (PortableServer_Servant servant, - const CORBA_char *foldername, - const Bonobo_Listener listener, - CORBA_Environment *ev) -{ - mail_get_info (foldername, listener); -} - -#if 0 -static void -destroy (GtkObject *object) -{ - EvolutionFolderInfo *info = (EvolutionFolderInfo *) object; - - bonobo_object_unref (BONOBO_OBJECT (info->pb)); -} -#endif - -static void -evolution_folder_info_class_init (EvolutionFolderInfoClass *klass) -{ - POA_GNOME_Evolution_FolderInfo__epv *epv = &klass->epv; - - parent_class = g_type_class_ref(PARENT_TYPE); - epv->getInfo = impl_GNOME_Evolution_FolderInfo_getInfo; -} - -static void -evolution_folder_info_init (EvolutionFolderInfo *info) -{ -} - -BONOBO_TYPE_FUNC_FULL (EvolutionFolderInfo, - GNOME_Evolution_FolderInfo, - PARENT_TYPE, - evolution_folder_info); - -enum { - PROP_FOLDER_INFO_READY -}; - -static void -set_prop (BonoboPropertyBag *bag, - const BonoboArg *arg, - guint arg_id, - CORBA_Environment *ev, - gpointer user_data) -{ - switch (arg_id) { - case PROP_FOLDER_INFO_READY: - ready = BONOBO_ARG_GET_BOOLEAN (arg); - break; - default: - bonobo_exception_set (ev, ex_Bonobo_PropertyBag_NotFound); - break; - } -} - -static void -get_prop (BonoboPropertyBag *bag, - BonoboArg *arg, - guint arg_id, - CORBA_Environment *ev, - gpointer user_data) -{ - switch (arg_id) { - case PROP_FOLDER_INFO_READY: - BONOBO_ARG_SET_BOOLEAN (arg, ready); - break; - default: - bonobo_exception_set (ev, ex_Bonobo_PropertyBag_NotFound); - break; - } -} - -BonoboObject * -evolution_folder_info_new (void) -{ - EvolutionFolderInfo *info; - BonoboPropertyBag *pb; - - info = g_object_new (evolution_folder_info_get_type (), NULL); - pb = bonobo_property_bag_new (get_prop, set_prop, info); - info->pb = pb; - /* Add properties */ - bonobo_property_bag_add (pb, "folder-info-ready", - PROP_FOLDER_INFO_READY, - BONOBO_ARG_BOOLEAN, NULL, FALSE, - BONOBO_PROPERTY_READABLE | - BONOBO_PROPERTY_WRITEABLE); - - bonobo_object_add_interface (BONOBO_OBJECT (info), BONOBO_OBJECT (pb)); - - /* Add to the folder info list so we can get at them all afterwards */ - folder_infos = g_slist_append (folder_infos, info); - - return BONOBO_OBJECT (info); -} - -void -evolution_folder_info_notify_ready (void) -{ - GSList *p; - - ready = TRUE; - - for (p = folder_infos; p; p = p->next) { - EvolutionFolderInfo *info = p->data; - Bonobo_PropertyBag bag; - - bag = (Bonobo_PropertyBag)bonobo_object_corba_objref(BONOBO_OBJECT(info->pb)); - bonobo_pbclient_set_boolean(bag, "folder-info-ready", ready, NULL); - } -} diff --git a/mail/folder-info.h b/mail/folder-info.h deleted file mode 100644 index 3ce396a727..0000000000 --- a/mail/folder-info.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Jeffrey Stedfast <fejj@ximian.com> - * - * Copyright 2002 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. - * - */ - - -#ifndef __FOLDER_INFO_H__ -#define __FOLDER_INFO_H__ - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#include <glib.h> -#include <gtk/gtktypeutils.h> - -GtkType evolution_folder_info_get_type (void); -gboolean evolution_folder_info_factory_init (void); -BonoboObject *evolution_folder_info_new (void); - -void evolution_folder_info_notify_ready (void); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __FOLDER_INFO_H__ */ diff --git a/mail/mail-config.c b/mail/mail-config.c index f75babcf36..d5c4b24cfe 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -60,8 +60,6 @@ #include "mail-mt.h" #include "mail-tools.h" -#include "Mailer.h" - /* Note, the first element of each MailConfigLabel must NOT be translated */ MailConfigLabel label_defaults[5] = { { "important", N_("Important"), "#ff0000" }, /* red */ @@ -95,7 +93,6 @@ typedef struct { static MailConfig *config = NULL; static guint config_write_timeout = 0; -#define MAIL_CONFIG_IID "OAFIID:GNOME_Evolution_MailConfig_Factory" #define MAIL_CONFIG_RC "/gtkrc-mail-fonts" /* signatures */ @@ -1182,24 +1179,6 @@ mail_config_check_service (const char *url, CamelProviderType type, GList **auth return ret; } -/* MailConfig Bonobo object */ -#define PARENT_TYPE BONOBO_OBJECT_TYPE -static BonoboObjectClass *parent_class = NULL; - -/* For the bonobo object */ -typedef struct _EvolutionMailConfig EvolutionMailConfig; -typedef struct _EvolutionMailConfigClass EvolutionMailConfigClass; - -struct _EvolutionMailConfig { - BonoboObject parent; -}; - -struct _EvolutionMailConfigClass { - BonoboObjectClass parent_class; - - POA_GNOME_Evolution_MailConfig__epv epv; -}; - static gboolean do_config_write (gpointer data) { @@ -1208,126 +1187,6 @@ do_config_write (gpointer data) return FALSE; } -static void -impl_GNOME_Evolution_MailConfig_addAccount (PortableServer_Servant servant, - const GNOME_Evolution_MailConfig_Account *account, - CORBA_Environment *ev) -{ - GNOME_Evolution_MailConfig_Service source, transport; - GNOME_Evolution_MailConfig_Identity id; - EAccount *new; - - if (mail_config_get_account_by_name (account->name)) { - /* FIXME: we need an exception. */ - return; - } - - new = e_account_new (); - new->name = g_strdup (account->name); - new->enabled = source.enabled; - - /* Copy ID */ - id = account->id; - new->id->name = g_strdup (id.name); - new->id->address = g_strdup (id.address); - new->id->reply_to = g_strdup (id.reply_to); - new->id->organization = g_strdup (id.organization); - - /* Copy source */ - source = account->source; - if (!(source.url == NULL || strcmp (source.url, "none://") == 0)) - new->source->url = g_strdup (source.url); - - new->source->keep_on_server = source.keep_on_server; - new->source->auto_check = source.auto_check; - new->source->auto_check_time = source.auto_check_time; - new->source->save_passwd = source.save_passwd; - - /* Copy transport */ - transport = account->transport; - if (transport.url != NULL) - new->transport->url = g_strdup (transport.url); - - new->transport->url = g_strdup (transport.url); - new->transport->save_passwd = transport.save_passwd; - - /* Add new account */ - mail_config_add_account (new); - - /* Don't write out the config right away in case the remote - * component is creating or removing multiple accounts. - */ - if (!config_write_timeout) - config_write_timeout = g_timeout_add (2000, do_config_write, NULL); -} - -static void -impl_GNOME_Evolution_MailConfig_removeAccount (PortableServer_Servant servant, - const CORBA_char *name, - CORBA_Environment *ev) -{ - EAccount *account; - - if ((account = mail_config_get_account_by_name (name))) - mail_config_remove_account (account); - - /* Don't write out the config right away in case the remote - * component is creating or removing multiple accounts. - */ - if (!config_write_timeout) - config_write_timeout = g_timeout_add (2000, do_config_write, NULL); -} - -static void -evolution_mail_config_class_init (EvolutionMailConfigClass *klass) -{ - POA_GNOME_Evolution_MailConfig__epv *epv = &klass->epv; - - parent_class = g_type_class_ref(PARENT_TYPE); - epv->addAccount = impl_GNOME_Evolution_MailConfig_addAccount; - epv->removeAccount = impl_GNOME_Evolution_MailConfig_removeAccount; -} - -static void -evolution_mail_config_init (EvolutionMailConfig *config) -{ - ; -} - -BONOBO_TYPE_FUNC_FULL (EvolutionMailConfig, - GNOME_Evolution_MailConfig, - PARENT_TYPE, - evolution_mail_config); - -static BonoboObject * -evolution_mail_config_factory_fn (BonoboGenericFactory *factory, - const char *id, - void *closure) -{ - EvolutionMailConfig *config; - - config = g_object_new (evolution_mail_config_get_type (), NULL); - - return BONOBO_OBJECT (config); -} - -gboolean -evolution_mail_config_factory_init (void) -{ - BonoboGenericFactory *factory; - - factory = bonobo_generic_factory_new (MAIL_CONFIG_IID, - evolution_mail_config_factory_fn, - NULL); - if (factory == NULL) { - g_warning ("Error starting MailConfig"); - return FALSE; - } - - bonobo_running_context_auto_exit_unref (BONOBO_OBJECT (factory)); - return TRUE; -} - GSList * mail_config_get_signature_list (void) { |