From 39bebbed8241d9ce5209eff2d3dd5793e4221505 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 7 Dec 2011 22:31:10 -0500 Subject: [PATCH] Don't use deprecated GApplication api in examples --- gio/tests/gapplication-example-actions.c | 10 ++-------- gio/tests/gapplication-example-menu.c | 14 +++----------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/gio/tests/gapplication-example-actions.c b/gio/tests/gapplication-example-actions.c index c2b45e160..7aaa41ef3 100644 --- a/gio/tests/gapplication-example-actions.c +++ b/gio/tests/gapplication-example-actions.c @@ -45,24 +45,18 @@ activate_toggle_action (GSimpleAction *action, static void add_actions (GApplication *app) { - GSimpleActionGroup *actions; GSimpleAction *action; - actions = g_simple_action_group_new (); - action = g_simple_action_new ("simple-action", NULL); g_signal_connect (action, "activate", G_CALLBACK (activate_action), app); - g_simple_action_group_insert (actions, G_ACTION (action)); + g_action_map_add_action (G_ACTION_MAP (app), G_ACTION (action)); g_object_unref (action); action = g_simple_action_new_stateful ("toggle-action", NULL, g_variant_new_boolean (FALSE)); g_signal_connect (action, "activate", G_CALLBACK (activate_toggle_action), app); - g_simple_action_group_insert (actions, G_ACTION (action)); + g_action_map_add_action (G_ACTION_MAP (app), G_ACTION (action)); g_object_unref (action); - - g_application_set_action_group (app, G_ACTION_GROUP (actions)); - g_object_unref (actions); } static void diff --git a/gio/tests/gapplication-example-menu.c b/gio/tests/gapplication-example-menu.c index e1dd427a3..29cab0592 100644 --- a/gio/tests/gapplication-example-menu.c +++ b/gio/tests/gapplication-example-menu.c @@ -44,17 +44,9 @@ static GActionEntry entries[] = { static void add_actions (GApplication *app) { - GSimpleActionGroup *actions; - - actions = g_simple_action_group_new (); - - g_simple_action_group_add_entries (actions, - entries, G_N_ELEMENTS (entries), - NULL); - - g_application_set_action_group (app, G_ACTION_GROUP (actions)); - - g_object_unref (actions); + g_action_map_add_action_entries (G_ACTION_MAP (app), + entries, G_N_ELEMENTS (entries), + NULL); } static void