diff options
author | Roy Zhang <[email protected]> | 2015-07-29 00:38:48 +0800 |
---|---|---|
committer | monsta <[email protected]> | 2015-09-01 12:10:00 +0300 |
commit | 67e99922f62204385825dead1246e61228a6a90e (patch) | |
tree | 4ea174be8eceabf7d58d9ca73fafdf8c49327fc6 | |
parent | 5ec722d8d4ab932f6587f0a5880c9ea7a55b412d (diff) | |
download | mate-power-manager-67e99922f62204385825dead1246e61228a6a90e.tar.bz2 mate-power-manager-67e99922f62204385825dead1246e61228a6a90e.tar.xz |
Save copying cost
-rw-r--r-- | src/gpm-prefs-core.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c index 38185ae..37f6842 100644 --- a/src/gpm-prefs-core.c +++ b/src/gpm-prefs-core.c @@ -712,9 +712,8 @@ gpm_prefs_init (GpmPrefs *prefs) &error ); if (error == NULL && res != NULL) { - g_variant_get(res,"(s)", &r); + g_variant_get(res,"(&s)", &r); prefs->priv->can_shutdown = g_strcmp0(r,"yes")==0?TRUE:FALSE; - g_free(r); g_variant_unref (res); } else if (error != NULL ) { egg_error ("Error in dbus - %s", error->message); @@ -729,9 +728,8 @@ gpm_prefs_init (GpmPrefs *prefs) &error ); if (error == NULL && res != NULL) { - g_variant_get(res,"(s)", &r); + g_variant_get(res,"(&s)", &r); prefs->priv->can_suspend = g_strcmp0(r,"yes")==0?TRUE:FALSE; - g_free(r); g_variant_unref (res); } else if (error != NULL ) { egg_error ("Error in dbus - %s", error->message); @@ -746,9 +744,8 @@ gpm_prefs_init (GpmPrefs *prefs) &error ); if (error == NULL && res != NULL) { - g_variant_get(res,"(s)", &r); + g_variant_get(res,"(&s)", &r); prefs->priv->can_hibernate = g_strcmp0(r,"yes")==0?TRUE:FALSE; - g_free(r); g_variant_unref (res); } else if (error != NULL ) { egg_error ("Error in dbus - %s", error->message); |