[calls] dummy: origin: Switch to state notify signal
- From: Evangelos Ribeiro Tzaras <devrtz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [calls] dummy: origin: Switch to state notify signal
- Date: Thu, 20 Jan 2022 10:50:29 +0000 (UTC)
commit 58507556e5c8e8a3676aa98ae28877089b59ddc4
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date: Fri Jan 14 06:14:33 2022 +0100
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.
plugins/dummy/calls-dummy-origin.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/plugins/dummy/calls-dummy-origin.c b/plugins/dummy/calls-dummy-origin.c
index 5da0688a..2346f1ce 100644
--- a/plugins/dummy/calls-dummy-origin.c
+++ b/plugins/dummy/calls-dummy-origin.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]