Commit 68e240d8 authored by Vincent Untz's avatar Vincent Untz

[clock] Code style cleanup

parent e5e4236a
......@@ -250,12 +250,12 @@ _check_polkit_for_action (GnomeClockAppletMechanism *mechanism, DBusGMethodInvoc
"Not Authorized for action %s", action);
dbus_g_method_return_error (context, error);
g_error_free (error);
g_object_unref (result);
g_object_unref (result);
return FALSE;
}
g_object_unref (result);
g_object_unref (result);
return TRUE;
}
......@@ -579,16 +579,16 @@ check_can_do (GnomeClockAppletMechanism *mechanism,
g_object_unref (subject);
if (polkit_authorization_result_get_is_authorized (result)) {
dbus_g_method_return (context, 2);
}
else if (polkit_authorization_result_get_is_challenge (result)) {
dbus_g_method_return (context, 1);
}
else {
dbus_g_method_return (context, 0);
}
g_object_unref (result);
dbus_g_method_return (context, 2);
}
else if (polkit_authorization_result_get_is_challenge (result)) {
dbus_g_method_return (context, 1);
}
else {
dbus_g_method_return (context, 0);
}
g_object_unref (result);
}
......@@ -600,7 +600,7 @@ gnome_clock_applet_mechanism_can_set_time (GnomeClockAppletMechanism *mechani
"org.gnome.clockapplet.mechanism.settime",
context);
return TRUE;
return TRUE;
}
gboolean
......@@ -611,5 +611,5 @@ gnome_clock_applet_mechanism_can_set_timezone (GnomeClockAppletMechanism *mec
"org.gnome.clockapplet.mechanism.settimezone",
context);
return TRUE;
return TRUE;
}
......@@ -75,6 +75,7 @@ gboolean gnome_clock_applet_mechanism_can_set_timezone (GnomeClockApp
gboolean gnome_clock_applet_mechanism_set_time (GnomeClockAppletMechanism *mechanism,
gint64 seconds_since_epoch,
DBusGMethodInvocation *context);
gboolean gnome_clock_applet_mechanism_can_set_time (GnomeClockAppletMechanism *mechanism,
DBusGMethodInvocation *context);
......
......@@ -59,24 +59,24 @@ get_system_bus (void)
typedef void (*CanDoFunc) (gint value);
static void
can_do_notify (DBusGProxy *proxy,
notify_can_do (DBusGProxy *proxy,
DBusGProxyCall *call,
void *user_data)
{
CanDoFunc callback = user_data;
CanDoFunc callback = user_data;
GError *error = NULL;
gint value;
if (dbus_g_proxy_end_call (proxy, call,
&error,
G_TYPE_INT, &value,
G_TYPE_INVALID)) {
callback (value);
&error,
G_TYPE_INT, &value,
G_TYPE_INVALID)) {
callback (value);
}
}
static void
can_do_refresh (const gchar *action, CanDoFunc callback)
refresh_can_do (const gchar *action, CanDoFunc callback)
{
DBusGConnection *bus;
DBusGProxy *proxy;
......@@ -92,7 +92,7 @@ can_do_refresh (const gchar *action, CanDoFunc callback)
dbus_g_proxy_begin_call_with_timeout (proxy,
action,
can_do_notify,
notify_can_do,
callback, NULL,
INT_MAX,
G_TYPE_INVALID);
......@@ -115,7 +115,7 @@ can_set_system_timezone (void)
time (&now);
if (ABS (now - settimezone_stamp) > CACHE_VALIDITY_SEC) {
can_do_refresh ("CanSetTimezone", update_can_settimezone);
refresh_can_do ("CanSetTimezone", update_can_settimezone);
settimezone_stamp = now;
}
......@@ -139,7 +139,7 @@ can_set_system_time (void)
time (&now);
if (ABS (now - settime_stamp) > CACHE_VALIDITY_SEC) {
can_do_refresh ("CanSetTime", update_can_settime);
refresh_can_do ("CanSetTime", update_can_settime);
settime_stamp = now;
}
......@@ -268,9 +268,9 @@ set_system_time_async (gint64 time,
void
set_system_timezone_async (const gchar *filename,
GFunc callback,
gpointer d,
GDestroyNotify notify)
GFunc callback,
gpointer d,
GDestroyNotify notify)
{
SetTimeCallbackData *data;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment