From 79086a141808831e3d7e49969f507678d08e6bec Mon Sep 17 00:00:00 2001 From: Not Zed Date: Thu, 2 Jun 2005 05:51:16 +0000 Subject: seutp an idl file so we only need to generate one set of skels/stubs for 2005-06-02 Not Zed * Evolution.idl: seutp an idl file so we only need to generate one set of skels/stubs for all imported. * mail-remote.c (e_plugin_lib_enable): instead of writing ior to a file, just add the Session interface to the mail component. * client.c (get_session): use the new shell interface to find the mail compnent and retrieve the session interface using bonobo-activation, so the mailer starts if we try to access it. svn path=/trunk/; revision=29445 --- plugins/mail-remote/mail-remote.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'plugins/mail-remote/mail-remote.c') diff --git a/plugins/mail-remote/mail-remote.c b/plugins/mail-remote/mail-remote.c index dedbb03596..7d082d3465 100644 --- a/plugins/mail-remote/mail-remote.c +++ b/plugins/mail-remote/mail-remote.c @@ -23,35 +23,34 @@ int e_plugin_lib_enable(int enable) if (enable) { static PortableServer_POA poa = NULL; - CORBA_string ior; - CORBA_Environment ev = { 0 }; + void *component; if (sess != NULL) return 0; + component = mail_component_peek(); + if (component == NULL) { + g_warning("Unable to find mail component, cannot instantiate mail remote api"); + return -1; + } + if (poa == NULL) poa = bonobo_poa_get_threaded (ORBIT_THREAD_HINT_PER_REQUEST, NULL); sess = g_object_new(evolution_mail_session_get_type(), "poa", poa, NULL); - ior = CORBA_ORB_object_to_string(bonobo_orb(), bonobo_object_corba_objref((BonoboObject *)sess), &ev); - path = g_build_filename(g_get_home_dir(), ".evolution-mail-remote.ior", NULL); - fp = fopen(path, "w"); - fprintf(fp, "%s", ior); - fclose(fp); - g_free(path); + /* + NB: This only works if this is done early enough in the process ... + I guess it will be. But i'm not entirely sure ... - printf("Enable mail-remote: IOR=%s\n", ior); - } else { - if (sess == NULL) - return 0; + If this wrong, then we have to add a mechanism to the mailcomponent directly + to retrieve it */ - path = g_build_filename(g_get_home_dir(), ".evolution-mail-remote.ior", NULL); - unlink(path); - g_free(path); - - g_object_unref(sess); - sess = NULL; + bonobo_object_add_interface((BonoboObject *)component, (BonoboObject *)sess); + printf(" ** Added mail interface to mail component\n"); + } else { + /* can't easily disable this until restart? */ + /* can we just destroy it? */ } return 0; -- cgit