[gnome-builder/wip/gtk4-port] libide/foundry: rename env->environ



commit 652a6edba9b4052e0560ffa783c00315c0c4b28e
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jun 21 17:02:55 2022 -0700

    libide/foundry: rename env->environ

 src/libide/foundry/ide-run-command.c               | 34 +++++++++++-----------
 src/libide/foundry/ide-run-command.h               |  6 ++--
 src/plugins/shellcmd/gbp-shellcmd-command-dialog.c |  6 ++--
 src/plugins/shellcmd/gbp-shellcmd-run-command.c    |  4 +--
 4 files changed, 25 insertions(+), 25 deletions(-)
---
diff --git a/src/libide/foundry/ide-run-command.c b/src/libide/foundry/ide-run-command.c
index f06934d07..5f0e425f9 100644
--- a/src/libide/foundry/ide-run-command.c
+++ b/src/libide/foundry/ide-run-command.c
@@ -30,7 +30,7 @@ typedef struct
   char *id;
   char *cwd;
   char *display_name;
-  char **env;
+  char **environ;
   char **argv;
   int priority;
   IdeRunCommandKind kind;
@@ -41,7 +41,7 @@ enum {
   PROP_ARGV,
   PROP_CWD,
   PROP_DISPLAY_NAME,
-  PROP_ENV,
+  PROP_ENVIRON,
   PROP_ID,
   PROP_KIND,
   PROP_PRIORITY,
@@ -87,7 +87,7 @@ ide_run_command_finalize (GObject *object)
   g_clear_pointer (&priv->id, g_free);
   g_clear_pointer (&priv->cwd, g_free);
   g_clear_pointer (&priv->display_name, g_free);
-  g_clear_pointer (&priv->env, g_strfreev);
+  g_clear_pointer (&priv->environ, g_strfreev);
   g_clear_pointer (&priv->argv, g_strfreev);
 
   G_OBJECT_CLASS (ide_run_command_parent_class)->finalize (object);
@@ -115,8 +115,8 @@ ide_run_command_get_property (GObject    *object,
       g_value_set_boxed (value, ide_run_command_get_argv (self));
       break;
 
-    case PROP_ENV:
-      g_value_set_boxed (value, ide_run_command_get_env (self));
+    case PROP_ENVIRON:
+      g_value_set_boxed (value, ide_run_command_get_environ (self));
       break;
 
     case PROP_ID:
@@ -158,8 +158,8 @@ ide_run_command_set_property (GObject      *object,
       ide_run_command_set_argv (self, g_value_get_boxed (value));
       break;
 
-    case PROP_ENV:
-      ide_run_command_set_env (self, g_value_get_boxed (value));
+    case PROP_ENVIRON:
+      ide_run_command_set_environ (self, g_value_get_boxed (value));
       break;
 
     case PROP_ID:
@@ -205,8 +205,8 @@ ide_run_command_class_init (IdeRunCommandClass *klass)
                          NULL,
                          (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
 
-  properties [PROP_ENV] =
-    g_param_spec_boxed ("env", NULL, NULL,
+  properties [PROP_ENVIRON] =
+    g_param_spec_boxed ("environ", NULL, NULL,
                         G_TYPE_STRV,
                         (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS));
 
@@ -345,29 +345,29 @@ ide_run_command_set_argv (IdeRunCommand      *self,
 }
 
 const char * const *
-ide_run_command_get_env (IdeRunCommand *self)
+ide_run_command_get_environ (IdeRunCommand *self)
 {
   IdeRunCommandPrivate *priv = ide_run_command_get_instance_private (self);
 
   g_return_val_if_fail (IDE_IS_RUN_COMMAND (self), NULL);
 
-  return (const char * const *)priv->env;
+  return (const char * const *)priv->environ;
 }
 
 void
-ide_run_command_set_env (IdeRunCommand      *self,
-                          const char * const *env)
+ide_run_command_set_environ (IdeRunCommand      *self,
+                             const char * const *environ)
 {
   IdeRunCommandPrivate *priv = ide_run_command_get_instance_private (self);
 
   g_return_if_fail (IDE_IS_RUN_COMMAND (self));
 
-  if (env == (const char * const *)priv->env)
+  if (environ == (const char * const *)priv->environ)
     return;
 
-  g_strfreev (priv->env);
-  priv->env = g_strdupv ((char **)env);
-  g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_ENV]);
+  g_strfreev (priv->environ);
+  priv->environ = g_strdupv ((char **)environ);
+  g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_ENVIRON]);
 }
 
 int
diff --git a/src/libide/foundry/ide-run-command.h b/src/libide/foundry/ide-run-command.h
index c97edbb63..af75a6670 100644
--- a/src/libide/foundry/ide-run-command.h
+++ b/src/libide/foundry/ide-run-command.h
@@ -74,10 +74,10 @@ IDE_AVAILABLE_IN_ALL
 void                ide_run_command_set_argv         (IdeRunCommand      *self,
                                                       const char * const *argv);
 IDE_AVAILABLE_IN_ALL
-const char * const *ide_run_command_get_env          (IdeRunCommand      *self);
+const char * const *ide_run_command_get_environ      (IdeRunCommand      *self);
 IDE_AVAILABLE_IN_ALL
-void                ide_run_command_set_env          (IdeRunCommand      *self,
-                                                      const char * const *env);
+void                ide_run_command_set_environ      (IdeRunCommand      *self,
+                                                      const char * const *environ);
 IDE_AVAILABLE_IN_ALL
 int                 ide_run_command_get_priority     (IdeRunCommand      *self);
 IDE_AVAILABLE_IN_ALL
diff --git a/src/plugins/shellcmd/gbp-shellcmd-command-dialog.c 
b/src/plugins/shellcmd/gbp-shellcmd-command-dialog.c
index 8b61a20eb..872069c4d 100644
--- a/src/plugins/shellcmd/gbp-shellcmd-command-dialog.c
+++ b/src/plugins/shellcmd/gbp-shellcmd-command-dialog.c
@@ -268,7 +268,7 @@ gbp_shellcmd_command_dialog_set_command (GbpShellcmdCommandDialog *self,
 
   name = ide_run_command_get_display_name (IDE_RUN_COMMAND (command));
   argv = ide_run_command_get_argv (IDE_RUN_COMMAND (command));
-  env = ide_run_command_get_env (IDE_RUN_COMMAND (command));
+  env = ide_run_command_get_environ (IDE_RUN_COMMAND (command));
   cwd = ide_run_command_get_cwd (IDE_RUN_COMMAND (command));
   accel = gbp_shellcmd_run_command_get_accelerator (command);
   locality = gbp_shellcmd_run_command_get_locality (command);
@@ -418,8 +418,8 @@ command_save_action (GtkWidget  *widget,
   gbp_shellcmd_run_command_set_accelerator (self->command, self->accel);
 
   env = string_list_to_strv (self->envvars);
-  ide_run_command_set_env (IDE_RUN_COMMAND (self->command),
-                           (const char * const *)env);
+  ide_run_command_set_environ (IDE_RUN_COMMAND (self->command),
+                               (const char * const *)env);
 
   item = adw_combo_row_get_selected_item (self->locality);
   nick = ide_enum_object_get_nick (item);
diff --git a/src/plugins/shellcmd/gbp-shellcmd-run-command.c b/src/plugins/shellcmd/gbp-shellcmd-run-command.c
index 2e977ecc3..9ed0a64ed 100644
--- a/src/plugins/shellcmd/gbp-shellcmd-run-command.c
+++ b/src/plugins/shellcmd/gbp-shellcmd-run-command.c
@@ -76,7 +76,7 @@ gbp_shellcmd_run_command_constructed (GObject *object)
 
   ide_run_command_set_id (IDE_RUN_COMMAND (self), id);
   g_settings_bind (self->settings, "display-name", self, "display-name", G_SETTINGS_BIND_DEFAULT);
-  g_settings_bind (self->settings, "env", self, "env", G_SETTINGS_BIND_DEFAULT);
+  g_settings_bind (self->settings, "env", self, "environ", G_SETTINGS_BIND_DEFAULT);
   g_settings_bind (self->settings, "argv", self, "argv", G_SETTINGS_BIND_DEFAULT);
   g_settings_bind (self->settings, "cwd", self, "cwd", G_SETTINGS_BIND_DEFAULT);
   g_settings_bind (self->settings, "accelerator", self, "accelerator", G_SETTINGS_BIND_DEFAULT);
@@ -431,7 +431,7 @@ gbp_shellcmd_run_command_create_launcher (GbpShellcmdRunCommand *self,
 
   cwd = ide_run_command_get_cwd (IDE_RUN_COMMAND (self));
   argv = ide_run_command_get_argv (IDE_RUN_COMMAND (self));
-  env = ide_run_command_get_env (IDE_RUN_COMMAND (self));
+  env = ide_run_command_get_environ (IDE_RUN_COMMAND (self));
   cwd = ide_run_command_get_cwd (IDE_RUN_COMMAND (self));
 
   g_return_val_if_fail (argv != NULL, NULL);


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