[gnome-panel] [clock] Code style cleanup



commit 68e240d8b22990f6c5d3b4683a3225ac7657f941
Author: Vincent Untz <vuntz gnome org>
Date:   Tue Aug 11 20:30:24 2009 +0200

    [clock] Code style cleanup

 applets/clock/gnome-clock-applet-mechanism.c |   28 +++++++++++++-------------
 applets/clock/gnome-clock-applet-mechanism.h |    1 +
 applets/clock/set-timezone.c                 |   26 ++++++++++++------------
 3 files changed, 28 insertions(+), 27 deletions(-)
---
diff --git a/applets/clock/gnome-clock-applet-mechanism.c b/applets/clock/gnome-clock-applet-mechanism.c
index 10a254d..b9f3820 100644
--- a/applets/clock/gnome-clock-applet-mechanism.c
+++ b/applets/clock/gnome-clock-applet-mechanism.c
@@ -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;
 }
diff --git a/applets/clock/gnome-clock-applet-mechanism.h b/applets/clock/gnome-clock-applet-mechanism.h
index cccc584..505c89a 100644
--- a/applets/clock/gnome-clock-applet-mechanism.h
+++ b/applets/clock/gnome-clock-applet-mechanism.h
@@ -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);
 
diff --git a/applets/clock/set-timezone.c b/applets/clock/set-timezone.c
index daecab9..30dffc0 100644
--- a/applets/clock/set-timezone.c
+++ b/applets/clock/set-timezone.c
@@ -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;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]