aboutsummaryrefslogtreecommitdiffstats
path: root/mail/component-factory.c
diff options
context:
space:
mode:
authorMichael Meeks <michael@helixcode.com>2000-08-04 10:00:02 +0800
committerMichael Meeks <mmeeks@src.gnome.org>2000-08-04 10:00:02 +0800
commit8ec2a002e8f98c11836ca0fd0924d84a65018908 (patch)
tree4ade1439eaddeaa88b25c3e97899ae84f3853fec /mail/component-factory.c
parent6d6b9ec70ea0e6f16935ffbae676909c5a09f06c (diff)
downloadgsoc2013-evolution-8ec2a002e8f98c11836ca0fd0924d84a65018908.tar
gsoc2013-evolution-8ec2a002e8f98c11836ca0fd0924d84a65018908.tar.gz
gsoc2013-evolution-8ec2a002e8f98c11836ca0fd0924d84a65018908.tar.bz2
gsoc2013-evolution-8ec2a002e8f98c11836ca0fd0924d84a65018908.tar.lz
gsoc2013-evolution-8ec2a002e8f98c11836ca0fd0924d84a65018908.tar.xz
gsoc2013-evolution-8ec2a002e8f98c11836ca0fd0924d84a65018908.tar.zst
gsoc2013-evolution-8ec2a002e8f98c11836ca0fd0924d84a65018908.zip
only whack the sig in if the file exists.
2000-08-03 Michael Meeks <michael@helixcode.com> * mail-config.c (identity_page_new): only whack the sig in if the file exists. * component-factory.c (factory_fn): count running instances, attach destroy signal (factory_destroy): add. * main.c (main): pass orb around. svn path=/trunk/; revision=4523
Diffstat (limited to 'mail/component-factory.c')
-rw-r--r--mail/component-factory.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/mail/component-factory.c b/mail/component-factory.c
index 8f25483f0d..595d184551 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -50,6 +50,7 @@ static void real_create_news_storage( gpointer user_data );
#define COMPONENT_FACTORY_ID "OAFIID:evolution-shell-component-factory:evolution-mail:0ea887d5-622b-4b8c-b525-18aa1cbe18a6"
static BonoboGenericFactory *factory = NULL;
+static gint running_objects = 0;
static const EvolutionShellComponentFolderType folder_types[] = {
{ "mail", "evolution-inbox.png" },
@@ -153,13 +154,30 @@ owner_unset_cb (EvolutionShellComponent *shell_component, gpointer user_data)
gtk_main_quit ();
}
-/* The factory function. */
+static void
+factory_destroy (BonoboEmbeddable *embeddable,
+ gpointer dummy)
+{
+ running_objects--;
+ if (running_objects > 0)
+ return;
+
+ if (factory)
+ bonobo_object_unref (BONOBO_OBJECT (factory));
+ else
+ g_warning ("Serious ref counting error");
+ factory = NULL;
+
+ gtk_main_quit ();
+}
static BonoboObject *
factory_fn (BonoboGenericFactory *factory, void *closure)
{
EvolutionShellComponent *shell_component;
+ running_objects++;
+
shell_component = evolution_shell_component_new (folder_types,
create_view,
create_folder,
@@ -167,6 +185,8 @@ factory_fn (BonoboGenericFactory *factory, void *closure)
NULL,
NULL);
+ gtk_signal_connect (GTK_OBJECT (shell_component), "destroy",
+ GTK_SIGNAL_FUNC (factory_destroy), NULL);
gtk_signal_connect (GTK_OBJECT (shell_component), "owner_set",
GTK_SIGNAL_FUNC (owner_set_cb), NULL);
gtk_signal_connect (GTK_OBJECT (shell_component), "owner_unset",