Comment 11 for bug 857153

Revision history for this message
In , Trevor Saunders (trev-saunders) wrote :

Comment on attachment 568753
Proposed patch.

>+static bool
>+test_a11y_dbus (bool *out)

I think I'd use IsDBusA11yEnabled()

>+{
>+ // XXX following code is copied from widget/src/gtk2/nsWindow.cpp
>+ // we should put it somewhere that can be used from both modules
>+ // see bug 390761
>+ bool retval = FALSE;
>+#ifdef MOZ_ENABLE_DBUS
>+ DBusConnection *bus;
>+ DBusMessage *message = NULL, *reply = NULL;
>+ DBusMessageIter iter, iter_variant, iter_struct;
>+ dbus_bool_t d_result;
>+ DBusError error;

this isn't ansi c89 ;) please declare these closer to where they are used.
>+ reply = dbus_connection_send_with_reply_and_block(bus, message, 1000, &error);
>+ if (!reply ||
>+ dbus_message_get_type (reply) != DBUS_MESSAGE_TYPE_METHOD_RETURN ||
>+ strcmp (dbus_message_get_signature (reply), "v") != 0)
>+ goto exit;

blank line

btw what is "v" as a dbus signature?