diff options
author | Ryan Lortie <desrt@desrt.ca> | 2011-12-17 00:26:11 -0500 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2011-12-17 12:54:02 -0500 |
commit | 1807ef336a94a1d2498e2ce77686c29db1aa6aac (patch) | |
tree | 2c267ef5d060e5570bed6e928274816f9c360f21 | |
parent | eefd08996f7657488cb8afed23667030d6bd45f7 (diff) | |
download | glib-1807ef336a94a1d2498e2ce77686c29db1aa6aac.tar.gz |
action group exporter: kill GApplication hackery
Use the GRemoteActionGroup interface, if available, instead.
https://bugzilla.gnome.org/show_bug.cgi?id=665737
-rw-r--r-- | gio/gactiongroupexporter.c | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/gio/gactiongroupexporter.c b/gio/gactiongroupexporter.c index a399fffd0..67cfa4996 100644 --- a/gio/gactiongroupexporter.c +++ b/gio/gactiongroupexporter.c @@ -25,10 +25,10 @@ #include "gactiongroupexporter.h" #include "gdbusmethodinvocation.h" +#include "gremoteactiongroup.h" #include "gdbusintrospection.h" #include "gdbusconnection.h" #include "gactiongroup.h" -#include "gapplication.h" #include "gdbuserror.h" /** @@ -443,24 +443,6 @@ g_action_group_exporter_action_enabled_changed (GActionGroup *action_group, } static void -g_action_group_exporter_pre_emit (GActionGroupExporter *exporter, - GVariant *platform_data) -{ - if (G_IS_APPLICATION (exporter->action_group)) - G_APPLICATION_GET_CLASS (exporter->action_group) - ->before_emit (G_APPLICATION (exporter->action_group), platform_data); -} - -static void -g_action_group_exporter_post_emit (GActionGroupExporter *exporter, - GVariant *platform_data) -{ - if (G_IS_APPLICATION (exporter->action_group)) - G_APPLICATION_GET_CLASS (exporter->action_group) - ->after_emit (G_APPLICATION (exporter->action_group), platform_data); -} - -static void org_gtk_Actions_method_call (GDBusConnection *connection, const gchar *sender, const gchar *object_path, @@ -523,9 +505,11 @@ org_gtk_Actions_method_call (GDBusConnection *connection, g_variant_iter_next (iter, "v", ¶meter); g_variant_iter_free (iter); - g_action_group_exporter_pre_emit (exporter, platform_data); - g_action_group_activate_action (exporter->action_group, name, parameter); - g_action_group_exporter_post_emit (exporter, platform_data); + if (G_IS_REMOTE_ACTION_GROUP (exporter->action_group)) + g_remote_action_group_activate_action_full (G_REMOTE_ACTION_GROUP (exporter->action_group), + name, parameter, platform_data); + else + g_action_group_activate_action (exporter->action_group, name, parameter); if (parameter) g_variant_unref (parameter); @@ -540,9 +524,13 @@ org_gtk_Actions_method_call (GDBusConnection *connection, GVariant *state; g_variant_get (parameters, "(&sv@a{sv})", &name, &state, &platform_data); - g_action_group_exporter_pre_emit (exporter, platform_data); - g_action_group_change_action_state (exporter->action_group, name, state); - g_action_group_exporter_post_emit (exporter, platform_data); + + if (G_IS_REMOTE_ACTION_GROUP (exporter->action_group)) + g_remote_action_group_change_action_state_full (G_REMOTE_ACTION_GROUP (exporter->action_group), + name, state, platform_data); + else + g_action_group_change_action_state (exporter->action_group, name, state); + g_variant_unref (platform_data); g_variant_unref (state); } |