[gnome-panel] clock: Fix usage of polkit service to set timezone
- From: Vincent Untz <vuntz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] clock: Fix usage of polkit service to set timezone
- Date: Mon, 23 May 2011 21:53:12 +0000 (UTC)
commit 747496d102ffca4587fd7b892da3d7b7f5474220
Author: Chris Vine <chris cvine freeserve co uk>
Date: Mon May 23 23:49:54 2011 +0200
clock: Fix usage of polkit service to set timezone
There were several issues, caused by changes in the polkit service:
- some dbus methods were renamed
- we don't need to pass a path to a timezone file to set it, just the
name of the timezone
Also we were reading a return value correctly.
https://bugzilla.gnome.org/show_bug.cgi?id=649639
applets/clock/clock-location.c | 5 +----
applets/clock/set-timezone.c | 6 +++---
2 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/applets/clock/clock-location.c b/applets/clock/clock-location.c
index 1e65e04..f4c7b6e 100644
--- a/applets/clock/clock-location.c
+++ b/applets/clock/clock-location.c
@@ -539,7 +539,6 @@ clock_location_make_current (ClockLocation *loc,
GDestroyNotify destroy)
{
ClockLocationPrivate *priv = PRIVATE (loc);
- gchar *filename;
MakeCurrentData *mcdata;
if (loc == current_location) {
@@ -571,11 +570,9 @@ clock_location_make_current (ClockLocation *loc,
mcdata->data = data;
mcdata->destroy = destroy;
- filename = g_build_filename (SYSTEM_ZONEINFODIR, priv->timezone, NULL);
- set_system_timezone_async (filename,
+ set_system_timezone_async (priv->timezone,
make_current_cb,
mcdata);
- g_free (filename);
}
static gchar *
diff --git a/applets/clock/set-timezone.c b/applets/clock/set-timezone.c
index c9d4321..97f593e 100644
--- a/applets/clock/set-timezone.c
+++ b/applets/clock/set-timezone.c
@@ -79,7 +79,7 @@ can_set_call_finished (GObject *source,
if (reply != NULL)
{
- g_variant_get (reply, "(i)", cache->value);
+ g_variant_get (reply, "(i)", &cache->value);
g_variant_unref (reply);
}
@@ -119,7 +119,7 @@ can_set (Cache *cache, const gchar *method_name)
gint
can_set_system_timezone (void)
{
- return can_set (&can_set_timezone_cache, "CanSetTimeZone");
+ return can_set (&can_set_timezone_cache, "CanSetTimezone");
}
gint
@@ -177,7 +177,7 @@ set_system_timezone_async (const gchar *filename,
g_dbus_connection_call (system_bus, MECHANISM_BUS_NAME,
MECHANISM_OBJECT_PATH, MECHANISM_INTERFACE,
- "SetTimeZone", g_variant_new ("(s)", filename),
+ "SetTimezone", g_variant_new ("(s)", filename),
NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL,
callback, user_data);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]