[file-roller] fixed accelerators registration



commit 1e0c23915db84e04a577f41d99b5b4c6ab01e364
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Mon Oct 8 19:34:03 2018 +0200

    fixed accelerators registration

 src/fr-application-menu.c | 2 +-
 src/gtk-utils.c           | 5 +++--
 src/gtk-utils.h           | 3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/fr-application-menu.c b/src/fr-application-menu.c
index 9a7206ba..97c1681d 100644
--- a/src/fr-application-menu.c
+++ b/src/fr-application-menu.c
@@ -203,7 +203,7 @@ initialize_app_menu (GApplication *application)
                                         app_menu_entries,
                                         G_N_ELEMENTS (app_menu_entries),
                                         application);
-       _gtk_application_add_accelerators (GTK_APPLICATION (application), fr_app_accelerators);
+       _gtk_application_add_accelerators (GTK_APPLICATION (application), fr_app_accelerators, G_N_ELEMENTS 
(fr_app_accelerators));
 
        settings = fr_application_get_settings (FR_APPLICATION (application), FILE_ROLLER_SCHEMA_UI);
        g_simple_action_set_state (GET_ACTION (PREF_UI_VIEW_SIDEBAR),
diff --git a/src/gtk-utils.c b/src/gtk-utils.c
index 08c45fee..0a4cebe0 100644
--- a/src/gtk-utils.c
+++ b/src/gtk-utils.c
@@ -895,11 +895,12 @@ _gtk_application_add_accelerator_for_action (GtkApplication   *app,
 
 void
 _gtk_application_add_accelerators (GtkApplication *app,
-                                  FrAccelerator  *accelerators)
+                                  const FrAccelerator  *accelerators,
+                                  int             n_accelerators)
 {
        int i;
 
-       for (i = 0; i < G_N_ELEMENTS (accelerators); i++) {
+       for (i = 0; i < n_accelerators; i++) {
                const FrAccelerator *acc = accelerators + i;
                _gtk_application_add_accelerator_for_action (GTK_APPLICATION (app),
                                                             acc->action_name,
diff --git a/src/gtk-utils.h b/src/gtk-utils.h
index 6e17995a..d7dbc54d 100644
--- a/src/gtk-utils.h
+++ b/src/gtk-utils.h
@@ -120,6 +120,7 @@ void          _gtk_application_add_accelerator_for_action
                                                    const char       *action_name,
                                                    const char       *accel);
 void         _gtk_application_add_accelerators    (GtkApplication   *app,
-                                                   FrAccelerator    *accelerators);
+                                                   const FrAccelerator *accelerators,
+                                                   int               n_accelerators);
 
 #endif


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]