[gnome-builder] runner: add IdeRunner::exited signal
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] runner: add IdeRunner::exited signal
- Date: Tue, 30 Aug 2016 19:47:40 +0000 (UTC)
commit bb8635fbdf453836a4f108269a378ae49876c533
Author: Christian Hergert <chergert redhat com>
Date: Tue Aug 30 12:47:11 2016 -0700
runner: add IdeRunner::exited signal
This can be useful by plugins that want to perform state changes when the
inferior has exited.
We might want to add the result code to this signal, but I think for now
this is enough.
libide/runner/ide-runner.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/libide/runner/ide-runner.c b/libide/runner/ide-runner.c
index eb26208..18bf152 100644
--- a/libide/runner/ide-runner.c
+++ b/libide/runner/ide-runner.c
@@ -48,6 +48,7 @@ enum {
};
enum {
+ EXITED,
SPAWNED,
N_SIGNALS
};
@@ -98,11 +99,18 @@ ide_runner_run_wait_cb (GObject *object,
GSubprocess *subprocess = (GSubprocess *)object;
g_autoptr(GTask) task = user_data;
GError *error = NULL;
+ IdeRunner *self;
IDE_ENTRY;
g_assert (G_IS_SUBPROCESS (subprocess));
+ self = g_task_get_source_object (task);
+
+ g_assert (IDE_IS_RUNNER (self));
+
+ g_signal_emit (self, signals [EXITED], 0);
+
if (!g_subprocess_wait_finish (subprocess, result, &error))
{
g_task_return_error (task, error);
@@ -328,6 +336,17 @@ ide_runner_class_init (IdeRunnerClass *klass)
g_object_class_install_properties (object_class, N_PROPS, properties);
+ signals [EXITED] =
+ g_signal_new ("exited",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL,
+ NULL,
+ NULL,
+ G_TYPE_NONE,
+ 0);
+
signals [SPAWNED] =
g_signal_new ("spawned",
G_TYPE_FROM_CLASS (klass),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]