[gnome-builder] threading: make IdeSubprocessLauncher more introspectable
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] threading: make IdeSubprocessLauncher more introspectable
- Date: Fri, 6 Mar 2020 20:16:16 +0000 (UTC)
commit 304ab307543731a59ca25738b8f7e3b1d1ac3045
Author: Christian Hergert <chergert redhat com>
Date: Fri Mar 6 12:15:33 2020 -0800
threading: make IdeSubprocessLauncher more introspectable
This works around https://gitlab.gnome.org/GNOME/glib/issues/1087 in a
way that is mostly source compatibile but also ABI compatible with the
previous form.
We lose a bit of constness checking, but in exchange things actually work
with GObject Introspection, so that seems fine.
Related: !257
src/libide/threading/ide-subprocess-launcher.c | 13 +++++++++++--
src/libide/threading/ide-subprocess-launcher.h | 2 +-
src/plugins/meson/gbp-meson-pipeline-addin.c | 2 +-
3 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/src/libide/threading/ide-subprocess-launcher.c b/src/libide/threading/ide-subprocess-launcher.c
index b692e16fc..e4883d719 100644
--- a/src/libide/threading/ide-subprocess-launcher.c
+++ b/src/libide/threading/ide-subprocess-launcher.c
@@ -966,9 +966,18 @@ ide_subprocess_launcher_take_stderr_fd (IdeSubprocessLauncher *self,
}
}
+/**
+ * ide_subprocess_launcher_set_argv:
+ * @self: an #IdeSubprocessLauncher
+ * @args: (array zero-terminated=1) (element-type utf8) (transfer none): a
+ * %NULL terminated array of strings.
+ *
+ * Clears the previous arguments and copies @args as the new argument array for
+ * the subprocess.
+ */
void
-ide_subprocess_launcher_set_argv (IdeSubprocessLauncher *self,
- const gchar * const *args)
+ide_subprocess_launcher_set_argv (IdeSubprocessLauncher *self,
+ gchar **args)
{
IdeSubprocessLauncherPrivate *priv = ide_subprocess_launcher_get_instance_private (self);
diff --git a/src/libide/threading/ide-subprocess-launcher.h b/src/libide/threading/ide-subprocess-launcher.h
index 1567ff271..5e0d1d45c 100644
--- a/src/libide/threading/ide-subprocess-launcher.h
+++ b/src/libide/threading/ide-subprocess-launcher.h
@@ -113,7 +113,7 @@ IDE_AVAILABLE_IN_3_32
gchar *ide_subprocess_launcher_pop_argv (IdeSubprocessLauncher *self)
G_GNUC_WARN_UNUSED_RESULT;
IDE_AVAILABLE_IN_3_32
void ide_subprocess_launcher_set_argv (IdeSubprocessLauncher *self,
- const gchar * const *argv);
+ gchar **args);
IDE_AVAILABLE_IN_3_32
IdeSubprocess *ide_subprocess_launcher_spawn (IdeSubprocessLauncher *self,
GCancellable *cancellable,
diff --git a/src/plugins/meson/gbp-meson-pipeline-addin.c b/src/plugins/meson/gbp-meson-pipeline-addin.c
index e85467df6..694c027f9 100644
--- a/src/plugins/meson/gbp-meson-pipeline-addin.c
+++ b/src/plugins/meson/gbp-meson-pipeline-addin.c
@@ -63,7 +63,7 @@ on_build_stage_query (IdePipelineStage *stage,
break;
}
g_ptr_array_add (replace, NULL);
- ide_subprocess_launcher_set_argv (launcher, (const gchar * const *)replace->pdata);
+ ide_subprocess_launcher_set_argv (launcher, (gchar **)replace->pdata);
/* If we have targets to build, specify them */
if (targets != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]