[gnome-settings-daemon] datetime: Fix deprecated use of polkit_authority_get()
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] datetime: Fix deprecated use of polkit_authority_get()
- Date: Mon, 20 Sep 2010 17:47:01 +0000 (UTC)
commit d08b1b05997b3591c7ac1eefebd04a503c97c06e
Author: Bastien Nocera <hadess hadess net>
Date: Mon Sep 20 18:42:00 2010 +0100
datetime: Fix deprecated use of polkit_authority_get()
plugins/datetime/gsd-datetime-mechanism.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/plugins/datetime/gsd-datetime-mechanism.c b/plugins/datetime/gsd-datetime-mechanism.c
index f95327e..0ee6564 100644
--- a/plugins/datetime/gsd-datetime-mechanism.c
+++ b/plugins/datetime/gsd-datetime-mechanism.c
@@ -176,9 +176,15 @@ register_mechanism (GsdDatetimeMechanism *mechanism)
{
GError *error = NULL;
- mechanism->priv->auth = polkit_authority_get ();
+ mechanism->priv->auth = polkit_authority_get_sync (NULL, &error);
+ if (mechanism->priv->auth == NULL) {
+ if (error != NULL) {
+ g_critical ("error getting system bus: %s", error->message);
+ g_error_free (error);
+ }
+ goto error;
+ }
- error = NULL;
mechanism->priv->system_bus_connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
if (mechanism->priv->system_bus_connection == NULL) {
if (error != NULL) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]