mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 06:26:15 +01:00
Merge branch 'wip/carlosg/appinfo-environment-preconditions' into 'master'
gappinfo: Add precondition checks to GAppLaunchContext env methods See merge request GNOME/glib!813
This commit is contained in:
commit
8811790653
@ -1204,6 +1204,10 @@ g_app_launch_context_setenv (GAppLaunchContext *context,
|
|||||||
const char *variable,
|
const char *variable,
|
||||||
const char *value)
|
const char *value)
|
||||||
{
|
{
|
||||||
|
g_return_if_fail (G_IS_APP_LAUNCH_CONTEXT (context));
|
||||||
|
g_return_if_fail (variable != NULL);
|
||||||
|
g_return_if_fail (value != NULL);
|
||||||
|
|
||||||
if (!context->priv->envp)
|
if (!context->priv->envp)
|
||||||
context->priv->envp = g_get_environ ();
|
context->priv->envp = g_get_environ ();
|
||||||
|
|
||||||
@ -1225,6 +1229,9 @@ void
|
|||||||
g_app_launch_context_unsetenv (GAppLaunchContext *context,
|
g_app_launch_context_unsetenv (GAppLaunchContext *context,
|
||||||
const char *variable)
|
const char *variable)
|
||||||
{
|
{
|
||||||
|
g_return_if_fail (G_IS_APP_LAUNCH_CONTEXT (context));
|
||||||
|
g_return_if_fail (variable != NULL);
|
||||||
|
|
||||||
if (!context->priv->envp)
|
if (!context->priv->envp)
|
||||||
context->priv->envp = g_get_environ ();
|
context->priv->envp = g_get_environ ();
|
||||||
|
|
||||||
@ -1249,6 +1256,8 @@ g_app_launch_context_unsetenv (GAppLaunchContext *context,
|
|||||||
char **
|
char **
|
||||||
g_app_launch_context_get_environment (GAppLaunchContext *context)
|
g_app_launch_context_get_environment (GAppLaunchContext *context)
|
||||||
{
|
{
|
||||||
|
g_return_val_if_fail (G_IS_APP_LAUNCH_CONTEXT (context), NULL);
|
||||||
|
|
||||||
if (!context->priv->envp)
|
if (!context->priv->envp)
|
||||||
context->priv->envp = g_get_environ ();
|
context->priv->envp = g_get_environ ();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user