[Telepathy-commits] [telepathy-gabble/master] Location property setter: do not check again what the mixin already checked, just use g_assert

Alban Crequy alban.crequy at collabora.co.uk
Sat Jan 31 03:01:42 PST 2009


---
 src/conn-location.c |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/src/conn-location.c b/src/conn-location.c
index 39a1215..9ba0258 100644
--- a/src/conn-location.c
+++ b/src/conn-location.c
@@ -249,24 +249,19 @@ conn_location_properties_setter (GObject *object,
   g_return_val_if_fail (interface ==
       GABBLE_IFACE_QUARK_CONNECTION_INTERFACE_LOCATION, FALSE);
 
+  /* There is only one property with write access. So TpDBusPropertiesMixin
+   * already checked this. */
   g_assert (name == g_quark_from_static_string ("LocationAccessControl"));
 
   access_control = g_value_get_boxed (value);
 
-  if (access_control->n_values != 2)
-    {
-      g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
-          "Two parameters expected for LocationAccessControl");
-      return FALSE;
-    }
+  /* TpDBusPropertiesMixin already checked this */
+  g_assert (access_control->n_values == 2);
 
   access_control_type_value = g_value_array_get_nth (access_control, 0);
-  if (G_VALUE_TYPE (access_control_type_value) != G_TYPE_UINT)
-    {
-      g_set_error (error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
-          "Type '(uv)' expected for LocationAccessControl");
-      return FALSE;
-    }
+
+  /* TpDBusPropertiesMixin already checked this */
+  g_assert (G_VALUE_TYPE (access_control_type_value) == G_TYPE_UINT);
 
   access_control_type = g_value_get_uint (access_control_type_value);
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list