[calls/gnome-41] dummy-call: Simplify change_state()



commit 0885165348650504b72bc9cfc995bac3b7f5b71e
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date:   Thu Oct 14 14:32:49 2021 +0200

    dummy-call: Simplify change_state()
    
    (cherry picked from commit 21eb12e9b107a81937e5f239961c79a8d54caedb)

 plugins/dummy/calls-dummy-call.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/plugins/dummy/calls-dummy-call.c b/plugins/dummy/calls-dummy-call.c
index 7d7ab1b1..3df58877 100644
--- a/plugins/dummy/calls-dummy-call.c
+++ b/plugins/dummy/calls-dummy-call.c
@@ -52,8 +52,7 @@ enum {
 static GParamSpec *props[PROP_LAST_PROP];
 
 static void
-change_state (CallsCall      *call,
-              CallsDummyCall *self,
+change_state (CallsDummyCall *self,
               CallsCallState  state)
 {
   CallsCallState old_state = self->state;
@@ -65,7 +64,7 @@ change_state (CallsCall      *call,
 
   self->state = state;
   g_object_notify (G_OBJECT (self), "state");
-  g_signal_emit_by_name (call,
+  g_signal_emit_by_name (CALLS_CALL (self),
                          "state-changed",
                          state,
                          old_state);
@@ -111,7 +110,7 @@ calls_dummy_call_answer (CallsCall *call)
 
   g_return_if_fail (self->state == CALLS_CALL_STATE_INCOMING);
 
-  change_state (call, self, CALLS_CALL_STATE_ACTIVE);
+  change_state (self, CALLS_CALL_STATE_ACTIVE);
 }
 
 static void
@@ -122,7 +121,7 @@ calls_dummy_call_hang_up (CallsCall *call)
   g_return_if_fail (CALLS_IS_DUMMY_CALL (call));
   self = CALLS_DUMMY_CALL (call);
 
-  change_state (call, self, CALLS_CALL_STATE_DISCONNECTED);
+  change_state (self, CALLS_CALL_STATE_DISCONNECTED);
 }
 
 static gboolean
@@ -131,14 +130,14 @@ outbound_timeout_cb (CallsDummyCall *self)
   switch (self->state)
     {
     case CALLS_CALL_STATE_DIALING:
-      change_state (CALLS_CALL (self), self,
+      change_state (self,
                     CALLS_CALL_STATE_ALERTING);
       g_timeout_add_seconds
         (3, (GSourceFunc)outbound_timeout_cb, self);
       break;
 
     case CALLS_CALL_STATE_ALERTING:
-      change_state (CALLS_CALL (self), self,
+      change_state (self,
                     CALLS_CALL_STATE_ACTIVE);
       break;
 


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