[glib-controller] Remove the action parameter from the emit_changed function



commit 069bdf3a8b45f4d7be08d895cb35b18dc98da8ed
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Fri Apr 30 12:50:25 2010 +0100

    Remove the action parameter from the emit_changed function
    
    Since we're passing a GControllerReference to the emit_changed() method
    of GController, there is no need to also pass the GControllerAction to
    it: we can get the action from the reference itself.

 glib-controller/gcontroller.c            |    5 +----
 glib-controller/gcontroller.h            |    1 -
 glib-controller/tests/array-controller.c |    4 ++--
 glib-controller/tests/hash-controller.c  |    2 +-
 4 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/glib-controller/gcontroller.c b/glib-controller/gcontroller.c
index 079684b..9ffdee3 100644
--- a/glib-controller/gcontroller.c
+++ b/glib-controller/gcontroller.c
@@ -218,7 +218,6 @@ g_controller_create_reference (GController       *controller,
 /**
  * g_controller_emit_changed:
  * @controller: a #GController
- * @action: the type of change to be emitted
  * @reference: the reference to the changed data
  *
  * Emits the #GController::changed signal with the given
@@ -226,14 +225,12 @@ g_controller_create_reference (GController       *controller,
  */
 void
 g_controller_emit_changed (GController          *controller,
-                           GControllerAction     action,
                            GControllerReference *reference)
 {
   g_return_if_fail (G_IS_CONTROLLER (controller));
-  g_return_if_fail (action >= G_CONTROLLER_ADD && action <= G_CONTROLLER_UPDATE);
   g_return_if_fail (G_IS_CONTROLLER_REFERENCE (reference));
 
   g_signal_emit (controller, controller_signals[CHANGED], 0,
-                 action,
+                 g_controller_reference_get_action (reference),
                  reference);
 }
diff --git a/glib-controller/gcontroller.h b/glib-controller/gcontroller.h
index 834cc4d..6a7cdf9 100644
--- a/glib-controller/gcontroller.h
+++ b/glib-controller/gcontroller.h
@@ -74,7 +74,6 @@ GControllerReference *g_controller_create_referencev (GController          *cont
                                                       GValueArray          *indices);
 
 void                  g_controller_emit_changed      (GController          *controller,
-                                                      GControllerAction     action,
                                                       GControllerReference *reference);
 
 G_END_DECLS
diff --git a/glib-controller/tests/array-controller.c b/glib-controller/tests/array-controller.c
index 6430c42..8abaf76 100644
--- a/glib-controller/tests/array-controller.c
+++ b/glib-controller/tests/array-controller.c
@@ -91,7 +91,7 @@ array_emit_changed (void)
 
   ref = g_controller_create_reference (controller, G_CONTROLLER_ADD, G_TYPE_UINT, 1, 0);
   g_assert (G_IS_CONTROLLER_REFERENCE (ref));
-  g_controller_emit_changed (controller, G_CONTROLLER_ADD, ref);
+  g_controller_emit_changed (controller, ref);
 
   g_object_unref (ref);
   g_free (expected.indices);
@@ -132,7 +132,7 @@ array_bulk_emit_changed (void)
       g_controller_reference_add_index (ref, i);
     }
 
-  g_controller_emit_changed (controller, G_CONTROLLER_ADD, ref);
+  g_controller_emit_changed (controller, ref);
 
   g_object_unref (ref);
   g_free (expected.indices);
diff --git a/glib-controller/tests/hash-controller.c b/glib-controller/tests/hash-controller.c
index eaca86e..670a1df 100644
--- a/glib-controller/tests/hash-controller.c
+++ b/glib-controller/tests/hash-controller.c
@@ -96,7 +96,7 @@ hash_emit_changed (void)
 
   ref = g_controller_create_reference (controller, G_CONTROLLER_ADD, G_TYPE_STRING, 1, foo);
   g_assert (G_IS_CONTROLLER_REFERENCE (ref));
-  g_controller_emit_changed (controller, G_CONTROLLER_ADD, ref);
+  g_controller_emit_changed (controller, ref);
 
   g_object_unref (ref);
   g_free (expected.indices);



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