aboutsummaryrefslogtreecommitdiffstats
path: root/shell/main.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2003-03-29 05:52:31 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2003-03-29 05:52:31 +0800
commit583bbec280424953b29502d0e8ba6e0e0947853b (patch)
treedfea9e405173e6f948880118759a74dc5e50c5dc /shell/main.c
parent2fee911d3a9ea70c4bc4b24a49232d89e8fcf6ba (diff)
downloadgsoc2013-evolution-583bbec280424953b29502d0e8ba6e0e0947853b.tar.gz
gsoc2013-evolution-583bbec280424953b29502d0e8ba6e0e0947853b.tar.zst
gsoc2013-evolution-583bbec280424953b29502d0e8ba6e0e0947853b.zip
(kill_old_wombat): New.
(kill_wombat): New. (idle_cb): Call kill_old_wombat(). svn path=/trunk/; revision=20565
Diffstat (limited to 'shell/main.c')
-rw-r--r--shell/main.c52
1 files changed, 51 insertions, 1 deletions
diff --git a/shell/main.c b/shell/main.c
index 45a2e0c74f..8aa3b9b79a 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -1,7 +1,7 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* main.c
*
- * Copyright (C) 2000, 2001, 2002 Ximian, Inc.
+ * Copyright (C) 2000, 2001, 2002, 2003 Ximian, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
@@ -60,6 +60,7 @@
#include <glade/glade.h>
#include "e-config-upgrade.h"
+#include "Evolution-Wombat.h"
#ifdef GTKHTML_HAVE_GCONF
#include <gconf/gconf.h>
@@ -167,6 +168,53 @@ shell_weak_notify (void *data,
}
+static void
+kill_wombat (void)
+{
+ g_print ("(Killing old version of Wombat...)\n");
+
+ system (KILL_PROCESS_CMD " -9 lt-evolution-wombat 2> /dev/null");
+ system (KILL_PROCESS_CMD " -9 evolution-wombat 2> /dev/null");
+}
+
+static void
+kill_old_wombat (void)
+{
+ GNOME_Evolution_WombatInterfaceCheck iface;
+ CORBA_Environment ev;
+ CORBA_char *version;
+
+ CORBA_exception_init (&ev);
+
+ iface = bonobo_activation_activate_from_id ("OAFIID:GNOME_Evolution_Wombat_InterfaceCheck", 0, NULL, &ev);
+ if (BONOBO_EX (&ev) || iface == CORBA_OBJECT_NIL) {
+ kill_wombat ();
+ CORBA_exception_free (&ev);
+ return;
+ }
+
+ version = GNOME_Evolution_WombatInterfaceCheck__get_interfaceVersion (iface, &ev);
+ if (BONOBO_EX (&ev)) {
+ kill_wombat ();
+ CORBA_Object_release (iface, &ev);
+ CORBA_exception_free (&ev);
+ return;
+ }
+
+ if (strcmp (version, VERSION) != 0) {
+ CORBA_free (version);
+ kill_wombat ();
+ CORBA_Object_release (iface, &ev);
+ CORBA_exception_free (&ev);
+ return;
+ }
+
+ CORBA_free (version);
+ CORBA_Object_release (iface, &ev);
+ CORBA_exception_free (&ev);
+}
+
+
/* Warning dialog to scare people off a little bit. */
static void
@@ -299,6 +347,8 @@ idle_cb (void *data)
gboolean display_default;
gboolean displayed_any;
+ kill_old_wombat ();
+
CORBA_exception_init (&ev);
uri_list = (GSList *) data;