From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH] voicecall: Add EmergencyCall property.
Date: Thu, 11 Nov 2010 09:26:37 -0600 [thread overview]
Message-ID: <4CDC0B2D.6010407@gmail.com> (raw)
In-Reply-To: <1289488333-1481-1-git-send-email-john.mathew@elektrobit.com>
[-- Attachment #1: Type: text/plain, Size: 2289 bytes --]
Hi John,
> +static gboolean voicecall_isemergency(struct voicecall *v)
Please use voicecall_is_emergency
> +{
> + struct ofono_call *call = v->call;
> + const char *lineid_str;
> +
> + lineid_str = phone_number_to_string(&call->phone_number);
> +
> + if (g_slist_find_custom(v->vc->en_list, lineid_str,
> + (GCompareFunc) strcmp))
As a general rule, the only function casting we allow is for GFunc use
of g_free. I really prefer that you write a separate function here.
> + return TRUE;
> + else
Please drop the else, it isn't actually required and makes the code
slightly cleaner.
> + return FALSE;
> +}
> +
> static void append_voicecall_properties(struct voicecall *v,
> DBusMessageIter *dict)
> {
> @@ -322,7 +336,8 @@ static void append_voicecall_properties(struct voicecall *v,
> const char *status;
> const char *callerid;
> const char *timestr;
> - ofono_bool_t mpty;
> + ofono_bool_t mpt;
Is there a reason you're changing this variable name?
> + dbus_bool_t emergency_call;
>
> status = call_status_to_string(call->status);
> callerid = phone_number_to_string(&call->phone_number);
> @@ -358,6 +373,14 @@ static void append_voicecall_properties(struct voicecall *v,
> if (v->icon_id)
> ofono_dbus_dict_append(dict, "Icon", DBUS_TYPE_BYTE,
> &v->icon_id);
> +
> + if (voicecall_isemergency(v))
> + emergency_call = TRUE;
> + else
> + emergency_call = FALSE;
> +
> + ofono_dbus_dict_append(dict, "EmergencyCall", DBUS_TYPE_BOOLEAN,
> + &emergency_call);
> }
>
> static DBusMessage *voicecall_get_properties(DBusConnection *conn,
> @@ -722,6 +745,15 @@ static void voicecall_set_call_lineid(struct voicecall *v,
> OFONO_VOICECALL_INTERFACE,
> "LineIdentification",
> DBUS_TYPE_STRING, &lineid_str);
> +
> + if (voicecall_isemergency(v)) {
> + dbus_bool_t emergency_call = TRUE;
In general we prefer an empty line after every variable declaration block.
> + ofono_dbus_signal_property_changed(conn, path,
> + OFONO_VOICECALL_INTERFACE,
> + "EmergencyCall",
> + DBUS_TYPE_BOOLEAN,
> + &emergency_call);
> + }
> }
>
> static gboolean voicecall_dbus_register(struct voicecall *v)
Regards,
-Denis
next prev parent reply other threads:[~2010-11-11 15:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-11 15:12 [PATCH] voicecall: Add EmergencyCall property John Mathew
2010-11-11 15:15 ` Marcel Holtmann
2010-11-11 15:18 ` John.Mathew
2010-11-11 17:01 ` Marcel Holtmann
2010-11-18 11:58 ` John.Mathew
2010-12-03 8:00 ` John.Mathew
2010-12-07 2:55 ` Denis Kenzior
2010-11-11 15:26 ` Denis Kenzior [this message]
2010-11-11 20:22 ` John.Mathew
2010-12-07 12:20 ` [PATCH] voicecall: Add emergency property John Mathew
2010-12-17 17:10 ` Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CDC0B2D.6010407@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.