1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2025-01-06 11:35:32 +00:00

dummy: origin: Switch to state notify signal

We don't need the old state here, so let's use the "notify::state" signal
instead of the "state-changed" signal.
This commit is contained in:
Evangelos Ribeiro Tzaras 2022-01-14 06:14:33 +01:00
parent 656643c522
commit 58507556e5

View file

@ -106,15 +106,14 @@ struct DisconnectedData
static void
call_state_changed_cb (CallsDummyOrigin *self,
CallsCallState new_state,
CallsCallState old_state,
CallsCall *call)
call_state_changed_cb (CallsCall *call,
GParamSpec *pspec,
CallsDummyOrigin *self)
{
g_assert (CALLS_IS_DUMMY_ORIGIN (self));
g_assert (CALLS_IS_DUMMY_CALL (call));
if (new_state != CALLS_CALL_STATE_DISCONNECTED)
if (calls_call_get_state (call) != CALLS_CALL_STATE_DISCONNECTED)
return;
remove_call (self, call, "Disconnected");
@ -132,9 +131,9 @@ add_call (CallsDummyOrigin *self, const gchar *number, gboolean inbound)
call = CALLS_CALL (dummy_call);
g_signal_emit_by_name (CALLS_ORIGIN (self), "call-added", call);
g_signal_connect_swapped (call, "state-changed",
G_CALLBACK (call_state_changed_cb),
self);
g_signal_connect (call, "notify::state",
G_CALLBACK (call_state_changed_cb),
self);
self->calls = g_list_append (self->calls, dummy_call);