[gtk+/gtk-3-20] app: don't use deprecated function



commit 0bb1991afb28d98e5157acb5d30166c4007f78d3
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 34b76af..d8a9685 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]