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:
Ryan Lortie
2010-10-28 22:49:12 -04:00
parent 99d2c2eef5
commit 7aa2e50262
6 changed files with 92 additions and 1 deletions

View File

@@ -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);