diff options
author | Mike Gorse <mgorse@novell.com> | 2012-02-13 11:32:47 -0600 |
---|---|---|
committer | Mike Gorse <mgorse@novell.com> | 2012-02-13 11:32:47 -0600 |
commit | 51c68cc34af24102abe4c0f7072f384f91427b23 (patch) | |
tree | 429e5953b9c9c2f9c23215aee48b7bc3a6647eb9 /bus | |
parent | aaa7bd55f005074faa2549cbc89c5197f5b457ca (diff) | |
download | at-spi2-core-51c68cc34af24102abe4c0f7072f384f91427b23.tar.gz |
At-spi-bus-launcher signal emission fixes
Emit PropertiesChanged from the correct interface. Also, create
GVariantBuilders on the stack; fixes memory leaks.
Diffstat (limited to 'bus')
-rw-r--r-- | bus/at-spi-bus-launcher.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c index 44662627..a60b70e2 100644 --- a/bus/at-spi-bus-launcher.c +++ b/bus/at-spi-bus-launcher.c @@ -260,8 +260,8 @@ static void handle_a11y_enabled_change (A11yBusLauncher *app, gboolean enabled, gboolean notify_gsettings) { - GVariantBuilder *builder; - GVariantBuilder *invalidated_builder; + GVariantBuilder builder; + GVariantBuilder invalidated_builder; if (enabled == app->a11y_enabled) return; @@ -275,16 +275,17 @@ handle_a11y_enabled_change (A11yBusLauncher *app, gboolean enabled, g_settings_sync (); } - builder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY); - invalidated_builder = g_variant_builder_new (G_VARIANT_TYPE ("as")); - g_variant_builder_add (builder, "{sv}", "IsEnabled", + g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY); + g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); + g_variant_builder_add (&builder, "{sv}", "IsEnabled", g_variant_new_boolean (enabled)); g_dbus_connection_emit_signal (app->session_bus, NULL, "/org/a11y/bus", - "org.freedesktop.DBus", "PropertiesChanged", + "org.freedesktop.DBus.Properties", + "PropertiesChanged", g_variant_new ("(sa{sv}as)", "org.a11y.Status", - builder, - invalidated_builder), + &builder, + &invalidated_builder), NULL); } @@ -292,8 +293,8 @@ static void handle_screen_reader_enabled_change (A11yBusLauncher *app, gboolean enabled, gboolean notify_gsettings) { - GVariantBuilder *builder; - GVariantBuilder *invalidated_builder; + GVariantBuilder builder; + GVariantBuilder invalidated_builder; if (enabled == app->screen_reader_enabled) return; @@ -312,16 +313,17 @@ handle_screen_reader_enabled_change (A11yBusLauncher *app, gboolean enabled, g_settings_sync (); } - builder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY); - invalidated_builder = g_variant_builder_new (G_VARIANT_TYPE ("as")); - g_variant_builder_add (builder, "{sv}", "ScreenReaderEnabled", + g_variant_builder_init (&builder, G_VARIANT_TYPE_ARRAY); + g_variant_builder_init (&invalidated_builder, G_VARIANT_TYPE ("as")); + g_variant_builder_add (&builder, "{sv}", "ScreenReaderEnabled", g_variant_new_boolean (enabled)); g_dbus_connection_emit_signal (app->session_bus, NULL, "/org/a11y/bus", - "org.freedesktop.DBus", "PropertiesChanged", + "org.freedesktop.DBus.Properties", + "PropertiesChanged", g_variant_new ("(sa{sv}as)", "org.a11y.Status", - builder, - invalidated_builder), + &builder, + &invalidated_builder), NULL); } |