diff options
author | Not Zed <NotZed@Ximian.com> | 2005-06-02 13:51:16 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2005-06-02 13:51:16 +0800 |
commit | 79086a141808831e3d7e49969f507678d08e6bec (patch) | |
tree | eb902b70042566058ba2d8a0c78b32221e419085 /plugins/mail-remote/mail-remote.c | |
parent | 84dd2e3f792d59dadacb9eb3bea0ad719002643a (diff) | |
download | gsoc2013-evolution-79086a141808831e3d7e49969f507678d08e6bec.tar gsoc2013-evolution-79086a141808831e3d7e49969f507678d08e6bec.tar.gz gsoc2013-evolution-79086a141808831e3d7e49969f507678d08e6bec.tar.bz2 gsoc2013-evolution-79086a141808831e3d7e49969f507678d08e6bec.tar.lz gsoc2013-evolution-79086a141808831e3d7e49969f507678d08e6bec.tar.xz gsoc2013-evolution-79086a141808831e3d7e49969f507678d08e6bec.tar.zst gsoc2013-evolution-79086a141808831e3d7e49969f507678d08e6bec.zip |
seutp an idl file so we only need to generate one set of skels/stubs for
2005-06-02 Not Zed <NotZed@Ximian.com>
* 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
Diffstat (limited to 'plugins/mail-remote/mail-remote.c')
-rw-r--r-- | plugins/mail-remote/mail-remote.c | 35 |
1 files changed, 17 insertions, 18 deletions
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; |