[gnome-builder] subprocess-launcher: remove spawn_async()



commit 5411eb107f7c75ba74b4b2dadf17daef146a6442
Author: Christian Hergert <chergert redhat com>
Date:   Fri Oct 28 20:31:51 2016 -0700

    subprocess-launcher: remove spawn_async()
    
    This serves no purpose and should not be used. Just remove it while we can.

 doc/reference/libide/libide-sections.txt    |    2 -
 libide/subprocess/ide-subprocess-launcher.c |   68 ---------------------------
 libide/subprocess/ide-subprocess-launcher.h |   14 ------
 libidemm/src/libide_methods.defs            |   21 --------
 4 files changed, 0 insertions(+), 105 deletions(-)
---
diff --git a/doc/reference/libide/libide-sections.txt b/doc/reference/libide/libide-sections.txt
index 168dafc..b01985e 100644
--- a/doc/reference/libide/libide-sections.txt
+++ b/doc/reference/libide/libide-sections.txt
@@ -1935,8 +1935,6 @@ ide_subprocess_launcher_overlay_environment
 ide_subprocess_launcher_push_args
 ide_subprocess_launcher_push_argv
 ide_subprocess_launcher_spawn_sync
-ide_subprocess_launcher_spawn_async
-ide_subprocess_launcher_spawn_finish
 IdeSubprocessLauncher
 </SECTION>
 
diff --git a/libide/subprocess/ide-subprocess-launcher.c b/libide/subprocess/ide-subprocess-launcher.c
index b6ddd6c..cb60d75 100644
--- a/libide/subprocess/ide-subprocess-launcher.c
+++ b/libide/subprocess/ide-subprocess-launcher.c
@@ -324,42 +324,6 @@ ide_subprocess_launcher_real_spawn_sync (IdeSubprocessLauncher  *self,
 }
 
 static void
-ide_subprocess_launcher_real_spawn_async (IdeSubprocessLauncher *self,
-                                          GCancellable          *cancellable,
-                                          GAsyncReadyCallback    callback,
-                                          gpointer               user_data)
-{
-  g_autoptr(GTask) task = NULL;
-
-  g_assert (IDE_IS_SUBPROCESS_LAUNCHER (self));
-  g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
-
-  /*
-   * TODO: Adding threads here doesn't really make things any easier.
-   *       We should just spawn synchronously in the current thread.
-   */
-
-  task = g_task_new (self, cancellable, callback, user_data);
-  g_task_set_source_tag (task, ide_subprocess_launcher_real_spawn_async);
-
-  if (should_use_breakout_process (self))
-    g_task_run_in_thread (task, ide_subprocess_launcher_spawn_host_worker);
-  else
-    g_task_run_in_thread (task, ide_subprocess_launcher_spawn_worker);
-}
-
-static IdeSubprocess *
-ide_subprocess_launcher_real_spawn_finish (IdeSubprocessLauncher  *self,
-                                           GAsyncResult           *result,
-                                           GError                **error)
-{
-  g_assert (IDE_IS_SUBPROCESS_LAUNCHER (self));
-  g_assert (G_IS_TASK (result));
-
-  return g_task_propagate_pointer (G_TASK (result), error);
-}
-
-static void
 ide_subprocess_launcher_finalize (GObject *object)
 {
   IdeSubprocessLauncher *self = (IdeSubprocessLauncher *)object;
@@ -461,8 +425,6 @@ ide_subprocess_launcher_class_init (IdeSubprocessLauncherClass *klass)
   object_class->set_property = ide_subprocess_launcher_set_property;
 
   klass->spawn_sync = ide_subprocess_launcher_real_spawn_sync;
-  klass->spawn_async = ide_subprocess_launcher_real_spawn_async;
-  klass->spawn_finish = ide_subprocess_launcher_real_spawn_finish;
 
   properties [PROP_CLEAR_ENV] =
     g_param_spec_boolean ("clean-env",
@@ -634,36 +596,6 @@ ide_subprocess_launcher_push_argv (IdeSubprocessLauncher *self,
   g_ptr_array_add (priv->argv, NULL);
 }
 
-void
-ide_subprocess_launcher_spawn_async (IdeSubprocessLauncher *self,
-                                     GCancellable          *cancellable,
-                                     GAsyncReadyCallback    callback,
-                                     gpointer               user_data)
-{
-  g_return_if_fail (IDE_IS_SUBPROCESS_LAUNCHER (self));
-  g_return_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable));
-
-  IDE_SUBPROCESS_LAUNCHER_GET_CLASS (self)->spawn_async (self, cancellable, callback, user_data);
-}
-
-/**
- * ide_subprocess_launcher_spawn_finish:
- *
- * Complete a request to asynchronously spawn a process.
- *
- * Returns: (transfer full): A #IdeSubprocess or %NULL upon error.
- */
-IdeSubprocess *
-ide_subprocess_launcher_spawn_finish (IdeSubprocessLauncher  *self,
-                                      GAsyncResult           *result,
-                                      GError                **error)
-{
-  g_return_val_if_fail (IDE_IS_SUBPROCESS_LAUNCHER (self), NULL);
-  g_return_val_if_fail (G_IS_TASK (result), NULL);
-
-  return IDE_SUBPROCESS_LAUNCHER_GET_CLASS (self)->spawn_finish (self, result, error);
-}
-
 /**
  * ide_subprocess_launcher_spawn_sync:
  *
diff --git a/libide/subprocess/ide-subprocess-launcher.h b/libide/subprocess/ide-subprocess-launcher.h
index 27ed5db..02799cd 100644
--- a/libide/subprocess/ide-subprocess-launcher.h
+++ b/libide/subprocess/ide-subprocess-launcher.h
@@ -36,13 +36,6 @@ struct _IdeSubprocessLauncherClass
   IdeSubprocess *(*spawn_sync)   (IdeSubprocessLauncher  *self,
                                   GCancellable           *cancellable,
                                   GError                **error);
-  void           (*spawn_async)  (IdeSubprocessLauncher  *self,
-                                  GCancellable           *cancellable,
-                                  GAsyncReadyCallback     callback,
-                                  gpointer                user_data);
-  IdeSubprocess *(*spawn_finish) (IdeSubprocessLauncher  *self,
-                                  GAsyncResult           *result,
-                                  GError                **error);
 
   gpointer _reserved1;
   gpointer _reserved2;
@@ -84,13 +77,6 @@ gchar                 *ide_subprocess_launcher_pop_argv            (IdeSubproces
 IdeSubprocess         *ide_subprocess_launcher_spawn_sync          (IdeSubprocessLauncher  *self,
                                                                     GCancellable           *cancellable,
                                                                     GError                **error);
-void                   ide_subprocess_launcher_spawn_async         (IdeSubprocessLauncher  *self,
-                                                                    GCancellable           *cancellable,
-                                                                    GAsyncReadyCallback     callback,
-                                                                    gpointer                user_data);
-IdeSubprocess         *ide_subprocess_launcher_spawn_finish        (IdeSubprocessLauncher  *self,
-                                                                    GAsyncResult           *result,
-                                                                    GError                **error);
 void                   ide_subprocess_launcher_take_stdin_fd       (IdeSubprocessLauncher  *self,
                                                                     gint                    stdin_fd);
 void                   ide_subprocess_launcher_take_stdout_fd      (IdeSubprocessLauncher  *self,
diff --git a/libidemm/src/libide_methods.defs b/libidemm/src/libide_methods.defs
index 57d0424..4b93a2f 100644
--- a/libidemm/src/libide_methods.defs
+++ b/libidemm/src/libide_methods.defs
@@ -5972,27 +5972,6 @@
   )
 )
 
-(define-method spawn_async
-  (of-object "IdeSubprocessLauncher")
-  (c-name "ide_subprocess_launcher_spawn_async")
-  (return-type "none")
-  (parameters
-    '("GCancellable*" "cancellable")
-    '("GAsyncReadyCallback" "callback")
-    '("gpointer" "user_data")
-  )
-)
-
-(define-method spawn_finish
-  (of-object "IdeSubprocessLauncher")
-  (c-name "ide_subprocess_launcher_spawn_finish")
-  (return-type "GSubprocess*")
-  (parameters
-    '("GAsyncResult*" "result")
-    '("GError**" "error")
-  )
-)
-
 
 
 ;; From ide-symbol.h


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]