call-list: coding style fixes
This commit is contained in:
@@ -564,7 +564,7 @@ mm_base_call_change_state (MMBaseCall *self,
|
|||||||
|
|
||||||
void
|
void
|
||||||
mm_base_call_received_dtmf (MMBaseCall *self,
|
mm_base_call_received_dtmf (MMBaseCall *self,
|
||||||
gchar *dtmf)
|
const gchar *dtmf)
|
||||||
{
|
{
|
||||||
mm_gdbus_call_emit_dtmf_received (MM_GDBUS_CALL (self), dtmf);
|
mm_gdbus_call_emit_dtmf_received (MM_GDBUS_CALL (self), dtmf);
|
||||||
}
|
}
|
||||||
|
@@ -104,7 +104,7 @@ void mm_base_call_change_state (MMBaseCall *self,
|
|||||||
MMCallState new_state,
|
MMCallState new_state,
|
||||||
MMCallStateReason reason);
|
MMCallStateReason reason);
|
||||||
void mm_base_call_received_dtmf (MMBaseCall *self,
|
void mm_base_call_received_dtmf (MMBaseCall *self,
|
||||||
gchar *dtmf);
|
const gchar *dtmf);
|
||||||
|
|
||||||
void mm_base_call_delete (MMBaseCall *self,
|
void mm_base_call_delete (MMBaseCall *self,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
#include "mm-base-call.h"
|
#include "mm-base-call.h"
|
||||||
#include "mm-log.h"
|
#include "mm-log.h"
|
||||||
|
|
||||||
G_DEFINE_TYPE (MMCallList, mm_call_list, G_TYPE_OBJECT);
|
G_DEFINE_TYPE (MMCallList, mm_call_list, G_TYPE_OBJECT)
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PROP_0,
|
PROP_0,
|
||||||
@@ -67,8 +67,7 @@ mm_call_list_get_paths (MMCallList *self)
|
|||||||
GList *l;
|
GList *l;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
path_list = g_new0 (gchar *,
|
path_list = g_new0 (gchar *, 1 + g_list_length (self->priv->list));
|
||||||
1 + g_list_length (self->priv->list));
|
|
||||||
|
|
||||||
for (i = 0, l = self->priv->list; l; l = g_list_next (l)) {
|
for (i = 0, l = self->priv->list; l; l = g_list_next (l)) {
|
||||||
const gchar *path;
|
const gchar *path;
|
||||||
@@ -84,27 +83,27 @@ mm_call_list_get_paths (MMCallList *self)
|
|||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
MMBaseCall* mm_call_list_get_new_incoming(MMCallList *self)
|
MMBaseCall *
|
||||||
|
mm_call_list_get_new_incoming (MMCallList *self)
|
||||||
{
|
{
|
||||||
MMBaseCall *call = NULL;
|
MMBaseCall *call = NULL;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
for (l = self->priv->list; l && !call; l = g_list_next (l)) {
|
for (l = self->priv->list; l; l = g_list_next (l)) {
|
||||||
|
|
||||||
MMCallState state;
|
MMCallState state;
|
||||||
MMCallStateReason reason;
|
MMCallStateReason reason;
|
||||||
MMCallDirection direct;
|
MMCallDirection direct;
|
||||||
|
|
||||||
g_object_get (MM_BASE_CALL (l->data),
|
g_object_get (MM_BASE_CALL (l->data),
|
||||||
"state" , &state,
|
"state", &state,
|
||||||
"state-reason", &reason,
|
"state-reason", &reason,
|
||||||
"direction" , &direct,
|
"direction", &direct,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if( direct == MM_CALL_DIRECTION_INCOMING &&
|
if (direct == MM_CALL_DIRECTION_INCOMING &&
|
||||||
state == MM_CALL_STATE_RINGING_IN &&
|
state == MM_CALL_STATE_RINGING_IN &&
|
||||||
reason == MM_CALL_STATE_REASON_INCOMING_NEW ) {
|
reason == MM_CALL_STATE_REASON_INCOMING_NEW ) {
|
||||||
|
|
||||||
call = MM_BASE_CALL (l->data);
|
call = MM_BASE_CALL (l->data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -113,22 +112,21 @@ MMBaseCall* mm_call_list_get_new_incoming(MMCallList *self)
|
|||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
|
|
||||||
MMBaseCall* mm_call_list_get_first_ringing_call(MMCallList *self)
|
MMBaseCall *
|
||||||
|
mm_call_list_get_first_ringing_call (MMCallList *self)
|
||||||
{
|
{
|
||||||
MMBaseCall *call = NULL;
|
MMBaseCall *call = NULL;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
for (l = self->priv->list; l && !call; l = g_list_next (l)) {
|
for (l = self->priv->list; l; l = g_list_next (l)) {
|
||||||
|
MMCallState state;
|
||||||
MMCallState state;
|
|
||||||
|
|
||||||
g_object_get (MM_BASE_CALL (l->data),
|
g_object_get (MM_BASE_CALL (l->data),
|
||||||
"state" , &state,
|
"state", &state,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if( state == MM_CALL_STATE_RINGING_IN ||
|
if (state == MM_CALL_STATE_RINGING_IN ||
|
||||||
state == MM_CALL_STATE_RINGING_OUT ) {
|
state == MM_CALL_STATE_RINGING_OUT) {
|
||||||
|
|
||||||
call = MM_BASE_CALL (l->data);
|
call = MM_BASE_CALL (l->data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -137,24 +135,23 @@ MMBaseCall* mm_call_list_get_first_ringing_call(MMCallList *self)
|
|||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
|
|
||||||
MMBaseCall* mm_call_list_get_first_outgoing_dialing_call(MMCallList *self)
|
MMBaseCall *
|
||||||
|
mm_call_list_get_first_outgoing_dialing_call (MMCallList *self)
|
||||||
{
|
{
|
||||||
MMBaseCall *call = NULL;
|
MMBaseCall *call = NULL;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
for (l = self->priv->list; l && !call; l = g_list_next (l)) {
|
for (l = self->priv->list; l; l = g_list_next (l)) {
|
||||||
|
MMCallState state;
|
||||||
MMCallState state;
|
MMCallDirection direction;
|
||||||
MMCallDirection direct;
|
|
||||||
|
|
||||||
g_object_get (MM_BASE_CALL (l->data),
|
g_object_get (MM_BASE_CALL (l->data),
|
||||||
"state" , &state,
|
"state", &state,
|
||||||
"direction" , &direct,
|
"direction", &direction,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if( direct == MM_CALL_DIRECTION_OUTGOING &&
|
if (direction == MM_CALL_DIRECTION_OUTGOING &&
|
||||||
state == MM_CALL_STATE_DIALING ) {
|
state == MM_CALL_STATE_DIALING) {
|
||||||
|
|
||||||
call = MM_BASE_CALL (l->data);
|
call = MM_BASE_CALL (l->data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -163,20 +160,20 @@ MMBaseCall* mm_call_list_get_first_outgoing_dialing_call(MMCallList *self)
|
|||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
|
|
||||||
MMBaseCall* mm_call_list_get_first_non_terminated_call(MMCallList *self)
|
MMBaseCall *
|
||||||
|
mm_call_list_get_first_non_terminated_call (MMCallList *self)
|
||||||
{
|
{
|
||||||
MMBaseCall *call = NULL;
|
MMBaseCall *call = NULL;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
for (l = self->priv->list; l && !call; l = g_list_next (l)) {
|
for (l = self->priv->list; l; l = g_list_next (l)) {
|
||||||
|
MMCallState state;
|
||||||
MMCallState state;
|
|
||||||
|
|
||||||
g_object_get (MM_BASE_CALL (l->data),
|
g_object_get (MM_BASE_CALL (l->data),
|
||||||
"state" , &state,
|
"state", &state,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if( state != MM_CALL_STATE_TERMINATED ) {
|
if (state != MM_CALL_STATE_TERMINATED) {
|
||||||
call = MM_BASE_CALL (l->data);
|
call = MM_BASE_CALL (l->data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -185,22 +182,23 @@ MMBaseCall* mm_call_list_get_first_non_terminated_call(MMCallList *self)
|
|||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean mm_call_list_send_dtmf_to_active_calls(MMCallList *self, gchar *dtmf)
|
gboolean
|
||||||
|
mm_call_list_send_dtmf_to_active_calls (MMCallList *self,
|
||||||
|
const gchar *dtmf)
|
||||||
{
|
{
|
||||||
gboolean signaled = FALSE;
|
gboolean signaled = FALSE;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
for (l = self->priv->list; l; l = g_list_next (l)) {
|
for (l = self->priv->list; l; l = g_list_next (l)) {
|
||||||
|
MMCallState state;
|
||||||
MMCallState state;
|
|
||||||
|
|
||||||
g_object_get (MM_BASE_CALL (l->data),
|
g_object_get (MM_BASE_CALL (l->data),
|
||||||
"state" , &state,
|
"state", &state,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if( state == MM_CALL_STATE_ACTIVE ) {
|
if (state == MM_CALL_STATE_ACTIVE) {
|
||||||
signaled = TRUE;
|
signaled = TRUE;
|
||||||
mm_base_call_received_dtmf(MM_BASE_CALL (l->data), dtmf);
|
mm_base_call_received_dtmf (MM_BASE_CALL (l->data), dtmf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,9 +208,9 @@ gboolean mm_call_list_send_dtmf_to_active_calls(MMCallList *self, gchar *dtmf)
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
mm_call_list_delete_call_finish (MMCallList *self,
|
mm_call_list_delete_call_finish (MMCallList *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
return g_task_propagate_boolean (G_TASK (res), error);
|
return g_task_propagate_boolean (G_TASK (res), error);
|
||||||
}
|
}
|
||||||
@@ -225,9 +223,9 @@ cmp_call_by_path (MMBaseCall *call,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
delete_ready (MMBaseCall *call,
|
delete_ready (MMBaseCall *call,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GTask *task)
|
GTask *task)
|
||||||
{
|
{
|
||||||
MMCallList *self;
|
MMCallList *self;
|
||||||
const gchar *path;
|
const gchar *path;
|
||||||
@@ -266,10 +264,10 @@ delete_ready (MMBaseCall *call,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mm_call_list_delete_call (MMCallList *self,
|
mm_call_list_delete_call (MMCallList *self,
|
||||||
const gchar *call_path,
|
const gchar *call_path,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
GTask *task;
|
GTask *task;
|
||||||
@@ -316,9 +314,9 @@ MMCallList *
|
|||||||
mm_call_list_new (MMBaseModem *modem)
|
mm_call_list_new (MMBaseModem *modem)
|
||||||
{
|
{
|
||||||
/* Create the object */
|
/* Create the object */
|
||||||
return g_object_new (MM_TYPE_CALL_LIST,
|
return g_object_new (MM_TYPE_CALL_LIST,
|
||||||
MM_CALL_LIST_MODEM, modem,
|
MM_CALL_LIST_MODEM, modem,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -47,10 +47,10 @@ struct _MMCallListClass {
|
|||||||
GObjectClass parent;
|
GObjectClass parent;
|
||||||
|
|
||||||
/* Signals */
|
/* Signals */
|
||||||
void (*call_added) (MMCallList *self,
|
void (* call_added) (MMCallList *self,
|
||||||
const gchar *call_path,
|
const gchar *call_path,
|
||||||
gboolean received);
|
gboolean received);
|
||||||
void (*call_deleted) (MMCallList *self,
|
void (* call_deleted) (MMCallList *self,
|
||||||
const gchar *call_path);
|
const gchar *call_path);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -64,19 +64,19 @@ guint mm_call_list_get_count (MMCallList *self);
|
|||||||
void mm_call_list_add_call (MMCallList *self,
|
void mm_call_list_add_call (MMCallList *self,
|
||||||
MMBaseCall *call);
|
MMBaseCall *call);
|
||||||
|
|
||||||
void mm_call_list_delete_call (MMCallList *self,
|
void mm_call_list_delete_call (MMCallList *self,
|
||||||
const gchar *call_path,
|
const gchar *call_path,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
gboolean mm_call_list_delete_call_finish (MMCallList *self,
|
gboolean mm_call_list_delete_call_finish (MMCallList *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
MMBaseCall* mm_call_list_get_new_incoming (MMCallList *self);
|
MMBaseCall *mm_call_list_get_new_incoming (MMCallList *self);
|
||||||
MMBaseCall* mm_call_list_get_first_ringing_call (MMCallList *self);
|
MMBaseCall *mm_call_list_get_first_ringing_call (MMCallList *self);
|
||||||
MMBaseCall* mm_call_list_get_first_outgoing_dialing_call(MMCallList *self);
|
MMBaseCall *mm_call_list_get_first_outgoing_dialing_call(MMCallList *self);
|
||||||
MMBaseCall* mm_call_list_get_first_non_terminated_call (MMCallList *self);
|
MMBaseCall *mm_call_list_get_first_non_terminated_call (MMCallList *self);
|
||||||
gboolean mm_call_list_send_dtmf_to_active_calls (MMCallList *self,
|
gboolean mm_call_list_send_dtmf_to_active_calls (MMCallList *self,
|
||||||
gchar *dtmf);
|
const gchar *dtmf);
|
||||||
|
|
||||||
#endif /* MM_CALL_LIST_H */
|
#endif /* MM_CALL_LIST_H */
|
||||||
|
Reference in New Issue
Block a user