[calls] mm: origin: Switch to state notify signal
- From: Evangelos Ribeiro Tzaras <devrtz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [calls] mm: origin: Switch to state notify signal
- Date: Thu, 20 Jan 2022 10:50:29 +0000 (UTC)
commit 470475e531c887ebdbaed6982c28cef13a011bfc
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date: Fri Jan 14 06:16:03 2022 +0100
mm: 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/mm/calls-mm-origin.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/plugins/mm/calls-mm-origin.c b/plugins/mm/calls-mm-origin.c
index fc437a88..b588d4c9 100644
--- a/plugins/mm/calls-mm-origin.c
+++ b/plugins/mm/calls-mm-origin.c
@@ -424,15 +424,15 @@ delete_call (CallsMMOrigin *self,
}
static void
-call_state_changed_cb (CallsMMOrigin *self,
- CallsCallState new_state,
- CallsCallState old_state,
- CallsCall *call)
+call_state_changed_cb (CallsCall *call,
+ GParamSpec *pspec,
+ CallsMMOrigin *self)
{
- if (new_state != CALLS_CALL_STATE_DISCONNECTED)
- {
- return;
- }
+ g_assert (CALLS_IS_MM_ORIGIN (self));
+ g_assert (CALLS_IS_MM_CALL (call));
+
+ if (calls_call_get_state (call) != CALLS_CALL_STATE_DISCONNECTED)
+ return;
delete_call (self, CALLS_MM_CALL (call));
}
@@ -447,9 +447,9 @@ add_call (CallsMMOrigin *self,
call = calls_mm_call_new (mm_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);
path = mm_call_dup_path (mm_call);
g_hash_table_insert (self->calls, path, call);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]