mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
GApplication: support environment passing
Add support for passing the full contents of the environment to the primary instance (by storing it in the platform_data) when G_APPLICATION_SEND_ENVIRONMENT is in the flags.
This commit is contained in:
@@ -571,6 +571,14 @@ get_platform_data (GApplication *application)
|
||||
g_free (cwd);
|
||||
}
|
||||
|
||||
if (application->priv->flags & G_APPLICATION_SEND_ENVIRONMENT)
|
||||
{
|
||||
gchar **envp = g_get_environ ();
|
||||
g_variant_builder_add (builder, "{sv}", "environ",
|
||||
g_variant_new_strv ((const gchar **) envp, -1));
|
||||
g_strfreev (envp);
|
||||
}
|
||||
|
||||
G_APPLICATION_GET_CLASS (application)->
|
||||
add_platform_data (application, builder);
|
||||
|
||||
|
Reference in New Issue
Block a user