aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-10-31 06:29:08 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-10-31 06:29:08 +0800
commit47843d5fe0d8ef95d1d001af559e0b3c93e154a1 (patch)
tree4e457dff6323698a62203e218b04a87fbe871328
parentfff58fd097a00d653649469b96b4d0f5d041677c (diff)
downloadgsoc2013-evolution-47843d5fe0d8ef95d1d001af559e0b3c93e154a1.tar
gsoc2013-evolution-47843d5fe0d8ef95d1d001af559e0b3c93e154a1.tar.gz
gsoc2013-evolution-47843d5fe0d8ef95d1d001af559e0b3c93e154a1.tar.bz2
gsoc2013-evolution-47843d5fe0d8ef95d1d001af559e0b3c93e154a1.tar.lz
gsoc2013-evolution-47843d5fe0d8ef95d1d001af559e0b3c93e154a1.tar.xz
gsoc2013-evolution-47843d5fe0d8ef95d1d001af559e0b3c93e154a1.tar.zst
gsoc2013-evolution-47843d5fe0d8ef95d1d001af559e0b3c93e154a1.zip
New utility function. (sleep_with_g_main_loop_timeout_callback): Callback
* e-component-registry.c (sleep_with_g_main_loop): New utility function. (sleep_with_g_main_loop_timeout_callback): Callback function for `sleep_with_g_main_loop()'. (wait_for_corba_object_to_die): Use `sleep_with_g_main_loop()' instead of `sleep()'. svn path=/trunk/; revision=14493
-rw-r--r--shell/ChangeLog9
-rw-r--r--shell/e-component-registry.c26
2 files changed, 34 insertions, 1 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 78870b7c9a..16672025ae 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,14 @@
2001-10-30 Ettore Perazzoli <ettore@ximian.com>
+ * e-component-registry.c (sleep_with_g_main_loop): New utility
+ function.
+ (sleep_with_g_main_loop_timeout_callback): Callback function for
+ `sleep_with_g_main_loop()'.
+ (wait_for_corba_object_to_die): Use `sleep_with_g_main_loop()'
+ instead of `sleep()'.
+
+2001-10-30 Ettore Perazzoli <ettore@ximian.com>
+
* main.c (development_warning): Removed.
(idle_cb): Don't call it.
(warning_dialog_clicked_callback): Removed.
diff --git a/shell/e-component-registry.c b/shell/e-component-registry.c
index 07762ac9e5..77e2df95eb 100644
--- a/shell/e-component-registry.c
+++ b/shell/e-component-registry.c
@@ -60,6 +60,30 @@ struct _EComponentRegistryPrivate {
/* Utility functions. */
+static int
+sleep_with_g_main_loop_timeout_callback (void *data)
+{
+ GMainLoop *loop;
+
+ loop = (GMainLoop *) data;
+ g_main_quit (loop);
+
+ return FALSE;
+}
+
+/* This function is like `sleep()', but it uses the GMainLoop so CORBA
+ invocations can get through. */
+static void
+sleep_with_g_main_loop (int num_seconds)
+{
+ GMainLoop *loop;
+
+ loop = g_main_new (TRUE);
+ g_timeout_add (1000 * num_seconds, sleep_with_g_main_loop_timeout_callback, loop);
+ g_main_run (loop);
+ g_main_destroy (loop);
+}
+
static void
wait_for_corba_object_to_die (Bonobo_Unknown corba_objref,
const char *id)
@@ -74,7 +98,7 @@ wait_for_corba_object_to_die (Bonobo_Unknown corba_objref,
break;
g_print ("Waiting for component to die -- %s (%d)\n", id, count);
- sleep (1);
+ sleep_with_g_main_loop (1);
count ++;
}
}