[glib/wip/gmenu] Don't use deprecated GApplication api in examples
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/gmenu] Don't use deprecated GApplication api in examples
- Date: Thu, 8 Dec 2011 03:31:41 +0000 (UTC)
commit 29425157f3546421948d153cbbf6d9add2ae417a
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Dec 7 22:31:10 2011 -0500
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 c2b45e1..7aaa41e 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 e1dd427..29cab05 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]