mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-07 12:25:31 +00:00
ofono: call: Codestyle
This commit is contained in:
parent
09699254c8
commit
aadf546472
1 changed files with 18 additions and 29 deletions
|
@ -139,12 +139,11 @@ operation_cb (GDBOVoiceCall *voice_call,
|
||||||
g_autoptr (GError) error = NULL;
|
g_autoptr (GError) error = NULL;
|
||||||
|
|
||||||
ok = data->finish_func (voice_call, res, &error);
|
ok = data->finish_func (voice_call, res, &error);
|
||||||
if (!ok)
|
if (!ok) {
|
||||||
{
|
g_warning ("Error %s oFono voice call to `%s': %s",
|
||||||
g_warning ("Error %s oFono voice call to `%s': %s",
|
data->desc, data->self->id, error->message);
|
||||||
data->desc, data->self->id, error->message);
|
CALLS_ERROR (data->self, error);
|
||||||
CALLS_ERROR (data->self, error);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
g_object_unref (data->self);
|
g_object_unref (data->self);
|
||||||
g_free (data);
|
g_free (data);
|
||||||
|
@ -191,12 +190,11 @@ static void
|
||||||
calls_ofono_call_send_dtmf_tone (CallsCall *call, gchar key)
|
calls_ofono_call_send_dtmf_tone (CallsCall *call, gchar key)
|
||||||
{
|
{
|
||||||
CallsOfonoCall *self = CALLS_OFONO_CALL (call);
|
CallsOfonoCall *self = CALLS_OFONO_CALL (call);
|
||||||
if (self->state != CALLS_CALL_STATE_ACTIVE)
|
if (self->state != CALLS_CALL_STATE_ACTIVE) {
|
||||||
{
|
g_warning ("Tone start requested for non-active call to `%s'",
|
||||||
g_warning ("Tone start requested for non-active call to `%s'",
|
self->id);
|
||||||
self->id);
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
g_signal_emit_by_name (self, "tone", key);
|
g_signal_emit_by_name (self, "tone", key);
|
||||||
}
|
}
|
||||||
|
@ -257,18 +255,13 @@ property_changed_cb (CallsOfonoCall *self,
|
||||||
gchar *str = NULL;
|
gchar *str = NULL;
|
||||||
CallsCallState state;
|
CallsCallState state;
|
||||||
gboolean ok;
|
gboolean ok;
|
||||||
|
g_autofree char *text = g_variant_print (value, TRUE);
|
||||||
|
|
||||||
{
|
g_debug ("Property `%s' for oFono call to `%s' changed to: %s",
|
||||||
gchar *text = g_variant_print (value, TRUE);
|
name, self->id, text);
|
||||||
g_debug ("Property `%s' for oFono call to `%s' changed to: %s",
|
|
||||||
name, self->id, text);
|
|
||||||
g_free (text);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (g_strcmp0 (name, "State") != 0)
|
if (g_strcmp0 (name, "State") != 0)
|
||||||
{
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
g_variant_get (value, "v", &str_var);
|
g_variant_get (value, "v", &str_var);
|
||||||
g_variant_get (str_var, "&s", &str);
|
g_variant_get (str_var, "&s", &str);
|
||||||
|
@ -276,15 +269,11 @@ property_changed_cb (CallsOfonoCall *self,
|
||||||
|
|
||||||
ok = calls_call_state_parse_nick (&state, str);
|
ok = calls_call_state_parse_nick (&state, str);
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
change_state (self, state);
|
||||||
change_state (self, state);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
g_warning ("Could not parse new state `%s'"
|
||||||
g_warning ("Could not parse new state `%s'"
|
" of oFono call to `%s'",
|
||||||
" of oFono call to `%s'",
|
str, self->id);
|
||||||
str, self->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_variant_unref (str_var);
|
g_variant_unref (str_var);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue