[calls] ui-call-data: Add call state mapping to public API
- From: Evangelos Ribeiro Tzaras <devrtz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [calls] ui-call-data: Add call state mapping to public API
- Date: Thu, 20 Jan 2022 08:39:44 +0000 (UTC)
commit e3afefcef25777156c97c33c7de77f234ae659a1
Author: Evangelos Ribeiro Tzaras <devrtz fortysixandtwo eu>
Date: Tue Jan 18 02:40:29 2022 +0100
ui-call-data: Add call state mapping to public API
This allows it to get used in the DBus manager in a GBindingTransformFunc
until to make sure we don't use emit deprecated values over DBus.
src/calls-ui-call-data.c | 50 +++++++++++++++++++++++++-----------------------
src/calls-ui-call-data.h | 5 +++--
2 files changed, 29 insertions(+), 26 deletions(-)
---
diff --git a/src/calls-ui-call-data.c b/src/calls-ui-call-data.c
index f5d3151d..b8e363d3 100644
--- a/src/calls-ui-call-data.c
+++ b/src/calls-ui-call-data.c
@@ -61,29 +61,6 @@ calls_ui_call_data_get_id (CuiCall *call_data)
return calls_call_get_id (self->call);
}
-static CuiCallState
-calls_state_to_cui_call_state (CallsCallState state)
-{
- switch (state) {
- case CALLS_CALL_STATE_ACTIVE:
- return CUI_CALL_STATE_ACTIVE;
- case CALLS_CALL_STATE_HELD:
- return CUI_CALL_STATE_HELD;
- case CALLS_CALL_STATE_DIALING:
- return CUI_CALL_STATE_DIALING;
- case CALLS_CALL_STATE_ALERTING:
- return CUI_CALL_STATE_DIALING;
- case CALLS_CALL_STATE_INCOMING:
- return CUI_CALL_STATE_INCOMING;
- case CALLS_CALL_STATE_WAITING:
- return CUI_CALL_STATE_INCOMING;
- case CALLS_CALL_STATE_DISCONNECTED:
- return CUI_CALL_STATE_DISCONNECTED;
- default:
- return CUI_CALL_STATE_UNKNOWN;
- }
-}
-
static CuiCallState
calls_ui_call_data_get_state (CuiCall *call_data)
{
@@ -92,7 +69,7 @@ calls_ui_call_data_get_state (CuiCall *call_data)
g_return_val_if_fail (CALLS_IS_UI_CALL_DATA (self), CUI_CALL_STATE_UNKNOWN);
g_return_val_if_fail (!!self->call, CUI_CALL_STATE_UNKNOWN);
- return calls_state_to_cui_call_state (calls_call_get_state (self->call));
+ return calls_call_state_to_cui_call_state (calls_call_get_state (self->call));
}
@@ -383,3 +360,28 @@ calls_ui_call_data_get_call (CallsUiCallData *self)
return self->call;
}
+
+
+CuiCallState
+calls_call_state_to_cui_call_state (CallsCallState state)
+{
+ switch (state) {
+ case CALLS_CALL_STATE_ACTIVE:
+ return CUI_CALL_STATE_ACTIVE;
+ case CALLS_CALL_STATE_HELD:
+ return CUI_CALL_STATE_HELD;
+ case CALLS_CALL_STATE_DIALING:
+ return CUI_CALL_STATE_DIALING;
+ case CALLS_CALL_STATE_ALERTING:
+ return CUI_CALL_STATE_DIALING;
+ case CALLS_CALL_STATE_INCOMING:
+ return CUI_CALL_STATE_INCOMING;
+ case CALLS_CALL_STATE_WAITING:
+ return CUI_CALL_STATE_INCOMING;
+ case CALLS_CALL_STATE_DISCONNECTED:
+ return CUI_CALL_STATE_DISCONNECTED;
+ default:
+ return CUI_CALL_STATE_UNKNOWN;
+ }
+}
+
diff --git a/src/calls-ui-call-data.h b/src/calls-ui-call-data.h
index 0fdba5f5..41a24a8d 100644
--- a/src/calls-ui-call-data.h
+++ b/src/calls-ui-call-data.h
@@ -11,7 +11,8 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (CallsUiCallData, calls_ui_call_data, CALLS, UI_CALL_DATA, GObject)
-CallsUiCallData *calls_ui_call_data_new (CallsCall *call);
-CallsCall *calls_ui_call_data_get_call (CallsUiCallData *self);
+CallsUiCallData *calls_ui_call_data_new (CallsCall *call);
+CallsCall *calls_ui_call_data_get_call (CallsUiCallData *self);
+CuiCallState calls_call_state_to_cui_call_state (CallsCallState state);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]