[gtk+] app: don't use deprecated function
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] app: don't use deprecated function
- Date: Sun, 10 Apr 2016 14:55:02 +0000 (UTC)
commit 29971b0cc9b5035235ffcc48c34fb99cbf396534
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Apr 10 12:28:14 2016 +0200
app: don't use deprecated function
gtk_application_add_accelerator() is deprecated, but was still used
inside IGNORE_DEPRECATIONS's.
https://bugzilla.gnome.org/show_bug.cgi?id=764846
gtk/gtkapplication.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c
index 48a4a89..fa6e99e 100644
--- a/gtk/gtkapplication.c
+++ b/gtk/gtkapplication.c
@@ -810,10 +810,15 @@ extract_accel_from_menu_item (GMenuModel *model,
}
g_object_unref (iter);
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (accel && action)
- gtk_application_add_accelerator (app, accel, action, target);
- G_GNUC_END_IGNORE_DEPRECATIONS
+ {
+ const gchar *accels[2] = { accel, NULL };
+ gchar *detailed_action_name;
+
+ detailed_action_name = g_action_print_detailed_name (action, target);
+ gtk_application_set_accels_for_action (app, detailed_action_name, accels);
+ g_free (detailed_action_name);
+ }
if (target)
g_variant_unref (target);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]