mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-05 19:15:32 +00:00
src: Add old state as argument to CallsCall's state-changed signal
This commit is contained in:
parent
74c3987ce1
commit
027c49e8bd
6 changed files with 47 additions and 12 deletions
|
@ -102,12 +102,17 @@ static guint signals [SIGNAL_LAST_SIGNAL];
|
|||
static void
|
||||
calls_call_default_init (CallsCallInterface *iface)
|
||||
{
|
||||
GType arg_types = CALLS_TYPE_CALL_STATE;
|
||||
GType arg_types[2] =
|
||||
{
|
||||
CALLS_TYPE_CALL_STATE,
|
||||
CALLS_TYPE_CALL_STATE
|
||||
};
|
||||
|
||||
/**
|
||||
* CallsCall::state-changed:
|
||||
* @self: The #CallsCall instance.
|
||||
* @state: The new state of the call.
|
||||
* @new_state: The new state of the call.
|
||||
* @old_state: The old state of the call.
|
||||
*
|
||||
* This signal is emitted when the state of the call changes, for
|
||||
* example when it's answered or when the call is disconnected.
|
||||
|
@ -118,7 +123,7 @@ calls_call_default_init (CallsCallInterface *iface)
|
|||
G_SIGNAL_RUN_LAST,
|
||||
NULL, NULL, NULL, NULL,
|
||||
G_TYPE_NONE,
|
||||
1, &arg_types);
|
||||
2, arg_types);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -85,8 +85,18 @@ change_state (CallsCall *call,
|
|||
CallsDummyCall *self,
|
||||
CallsCallState state)
|
||||
{
|
||||
CallsCallState old_state = self->state;
|
||||
|
||||
if (old_state == state)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
self->state = state;
|
||||
g_signal_emit_by_name (call, "state-changed", state);
|
||||
g_signal_emit_by_name (call,
|
||||
"state-changed",
|
||||
state,
|
||||
old_state);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -110,10 +110,11 @@ remove_calls (CallsDummyOrigin *self, const gchar *reason)
|
|||
|
||||
static void
|
||||
call_state_changed_cb (CallsDummyOrigin *self,
|
||||
CallsCallState state,
|
||||
CallsCallState new_state,
|
||||
CallsCallState old_state,
|
||||
CallsCall *call)
|
||||
{
|
||||
if (state != CALLS_CALL_STATE_DISCONNECTED)
|
||||
if (new_state != CALLS_CALL_STATE_DISCONNECTED)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -81,12 +81,21 @@ get_state (CallsCall *call)
|
|||
|
||||
|
||||
static void
|
||||
change_state (CallsMMCall *self,
|
||||
MMCallState state)
|
||||
change_state (CallsMMCall *self,
|
||||
CallsCallState state)
|
||||
{
|
||||
CallsCallState old_state = self->state;
|
||||
|
||||
if (old_state == state)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
self->state = state;
|
||||
g_signal_emit_by_name (CALLS_CALL (self),
|
||||
"state-changed", state);
|
||||
"state-changed",
|
||||
state,
|
||||
old_state);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -204,10 +204,11 @@ delete_call (CallsMMOrigin *self,
|
|||
|
||||
static void
|
||||
call_state_changed_cb (CallsMMOrigin *self,
|
||||
CallsCallState state,
|
||||
CallsCallState new_state,
|
||||
CallsCallState old_state,
|
||||
CallsCall *call)
|
||||
{
|
||||
if (state != CALLS_CALL_STATE_DISCONNECTED)
|
||||
if (new_state != CALLS_CALL_STATE_DISCONNECTED)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -87,9 +87,18 @@ static void
|
|||
change_state (CallsOfonoCall *self,
|
||||
CallsCallState state)
|
||||
{
|
||||
CallsCallState old_state = self->state;
|
||||
|
||||
if (old_state == state)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
self->state = state;
|
||||
g_signal_emit_by_name (CALLS_CALL (self),
|
||||
"state-changed", state);
|
||||
"state-changed",
|
||||
state,
|
||||
old_state);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue