summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--glib/dbus-gmain.c22
2 files changed, 28 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 778fed0b..5c5645c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2003-02-13 Anders Carlsson <andersca@codefactory.se>
+ * glib/dbus-gmain.c: (timeout_handler), (add_timeout),
+ (remove_timeout):
+ Implement support for timeouts in dbus-glib.
+
+2003-02-13 Anders Carlsson <andersca@codefactory.se>
+
* dbus/dbus-message-builder.c: (_dbus_message_data_load):
* dbus/dbus-message.c: (process_test_subdir):
* test/break-loader.c: (find_breaks_based_on):
diff --git a/glib/dbus-gmain.c b/glib/dbus-gmain.c
index c5197e5e..80d7d6ba 100644
--- a/glib/dbus-gmain.c
+++ b/glib/dbus-gmain.c
@@ -172,16 +172,38 @@ remove_watch (DBusWatch *watch,
g_free (poll_fd);
}
+static gboolean
+timeout_handler (gpointer data)
+{
+ DBusTimeout *timeout = data;
+
+ dbus_timeout_handle (timeout);
+
+ return FALSE;
+}
+
+
static void
add_timeout (DBusTimeout *timeout,
void *data)
{
+ guint timeout_tag;
+
+ timeout_tag = g_timeout_add (dbus_timeout_get_interval (timeout),
+ timeout_handler, timeout);
+
+ dbus_timeout_set_data (timeout, GUINT_TO_POINTER (timeout_tag), NULL);
}
static void
remove_timeout (DBusTimeout *timeout,
void *data)
{
+ guint timeout_tag;
+
+ timeout_tag = GPOINTER_TO_UINT (dbus_timeout_get_data (timeout));
+
+ g_source_remove (timeout_tag);
}
void