[nautilus] application: rename nautilus_application_add_accelerator()



commit d89c92af16b44964111a2c80d65f6d63bb152fcc
Author: Ernestas Kulik <ernestask src gnome org>
Date:   Thu Jun 9 17:31:12 2016 +0300

    application: rename nautilus_application_add_accelerator()
    
    nautilus_application_add_accelerator() is ambiguous in that it conveys
    that the function appends an accelerator to the list. This commit
    removes the ambiguity by renaming the function accordingly.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763948

 src/nautilus-application.c |    4 +-
 src/nautilus-application.h |    2 +-
 src/nautilus-files-view.c  |   46 ++++++++++++++++++++++----------------------
 src/nautilus-window-slot.c |    6 ++--
 src/nautilus-window.c      |   36 +++++++++++++++++-----------------
 5 files changed, 47 insertions(+), 47 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 6076215..989f31d 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -81,7 +81,7 @@ typedef struct {
 G_DEFINE_TYPE_WITH_PRIVATE (NautilusApplication, nautilus_application, GTK_TYPE_APPLICATION);
 
 void
-nautilus_application_add_accelerator (GApplication *app,
+nautilus_application_set_accelerator (GApplication *app,
                                      const gchar  *action_name,
                                      const gchar  *accel)
 {
@@ -801,7 +801,7 @@ nautilus_init_application_actions (NautilusApplication *app)
                                             "show-hide-sidebar",
                                             g_variant_new_boolean (show_sidebar));
 
-        nautilus_application_add_accelerator (G_APPLICATION (app), "app.show-hide-sidebar", "F9");
+        nautilus_application_set_accelerator (G_APPLICATION (app), "app.show-hide-sidebar", "F9");
 }
 
 const GOptionEntry options[] = {
diff --git a/src/nautilus-application.h b/src/nautilus-application.h
index 2043e84..197a276 100644
--- a/src/nautilus-application.h
+++ b/src/nautilus-application.h
@@ -48,7 +48,7 @@ NautilusApplication * nautilus_application_new (void);
 NautilusWindow *     nautilus_application_create_window (NautilusApplication *application,
                                                         GdkScreen           *screen);
 
-void nautilus_application_add_accelerator (GApplication *app,
+void nautilus_application_set_accelerator (GApplication *app,
                                           const gchar  *action_name,
                                           const gchar  *accel);
 
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 712c4cf..c25aec0 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -4767,7 +4767,7 @@ add_script_to_scripts_menus (NautilusFilesView *view,
         g_menu_append_item (menu, menu_item);
 
        if ((shortcut = g_hash_table_lookup (script_accels, name))) {
-               nautilus_application_add_accelerator (g_application_get_default(),
+               nautilus_application_set_accelerator (g_application_get_default(),
                                                      detailed_action_name, shortcut);
        }
 
@@ -8301,39 +8301,39 @@ nautilus_files_view_init (NautilusFilesView *view)
 
         /* Toolbar menu */
         nautilus_application_set_accelerators (app, "view.zoom-in", zoom_in_accels);
-        nautilus_application_add_accelerator (app, "view.zoom-out", "<control>minus");
-        nautilus_application_add_accelerator (app, "view.show-hidden-files", "<control>h");
+        nautilus_application_set_accelerator (app, "view.zoom-out", "<control>minus");
+        nautilus_application_set_accelerator (app, "view.show-hidden-files", "<control>h");
         /* Background menu */
-        nautilus_application_add_accelerator (app, "view.select-all", "<control>a");
-        nautilus_application_add_accelerator (app, "view.paste", "<control>v");
-        nautilus_application_add_accelerator (app, "view.create-link", "<control>m");
+        nautilus_application_set_accelerator (app, "view.select-all", "<control>a");
+        nautilus_application_set_accelerator (app, "view.paste", "<control>v");
+        nautilus_application_set_accelerator (app, "view.create-link", "<control>m");
         /* Selection menu */
         nautilus_application_set_accelerators (app, "view.open-with-default-application", open_accels);
-        nautilus_application_add_accelerator (app, "view.open-item-new-tab", "<shift><control>t");
-        nautilus_application_add_accelerator (app, "view.open-item-new-window", "<shift><control>w");
-        nautilus_application_add_accelerator (app, "view.move-to-trash", "Delete");
-        nautilus_application_add_accelerator (app, "view.delete-from-trash", "Delete");
-        nautilus_application_add_accelerator (app, "view.delete-permanently-shortcut", "<shift>Delete");
+        nautilus_application_set_accelerator (app, "view.open-item-new-tab", "<shift><control>t");
+        nautilus_application_set_accelerator (app, "view.open-item-new-window", "<shift><control>w");
+        nautilus_application_set_accelerator (app, "view.move-to-trash", "Delete");
+        nautilus_application_set_accelerator (app, "view.delete-from-trash", "Delete");
+        nautilus_application_set_accelerator (app, "view.delete-permanently-shortcut", "<shift>Delete");
         /* When trash is not available, allow the "Delete" key to delete permanently, that is, when
          * the menu item is available, since we never make both the trash and delete-permanently-menu-item
          * actions active */
-        nautilus_application_add_accelerator (app, "view.delete-permanently-menu-item", "Delete");
-        nautilus_application_add_accelerator (app, "view.permanent-delete-permanently-menu-item", 
"<shift>Delete");
+        nautilus_application_set_accelerator (app, "view.delete-permanently-menu-item", "Delete");
+        nautilus_application_set_accelerator (app, "view.permanent-delete-permanently-menu-item", 
"<shift>Delete");
         nautilus_application_set_accelerators (app, "view.properties", open_properties);
-        nautilus_application_add_accelerator (app, "view.open-item-location", "<control><alt>o");
-        nautilus_application_add_accelerator (app, "view.rename", "F2");
-        nautilus_application_add_accelerator (app, "view.cut", "<control>x");
-        nautilus_application_add_accelerator (app, "view.copy", "<control>c");
-        nautilus_application_add_accelerator (app, "view.create-link-in-place", "<control><shift>m");
-        nautilus_application_add_accelerator (app, "view.new-folder", "<control><shift>n");
+        nautilus_application_set_accelerator (app, "view.open-item-location", "<control><alt>o");
+        nautilus_application_set_accelerator (app, "view.rename", "F2");
+        nautilus_application_set_accelerator (app, "view.cut", "<control>x");
+        nautilus_application_set_accelerator (app, "view.copy", "<control>c");
+        nautilus_application_set_accelerator (app, "view.create-link-in-place", "<control><shift>m");
+        nautilus_application_set_accelerator (app, "view.new-folder", "<control><shift>n");
         /* Only accesible by shorcuts */
-        nautilus_application_add_accelerator (app, "view.select-pattern", "<control>s");
-        nautilus_application_add_accelerator (app, "view.invert-selection", "<shift><control>i");
-        nautilus_application_add_accelerator (app, "view.open-file-and-close-window", 
"<control><shift>Down");
+        nautilus_application_set_accelerator (app, "view.select-pattern", "<control>s");
+        nautilus_application_set_accelerator (app, "view.invert-selection", "<shift><control>i");
+        nautilus_application_set_accelerator (app, "view.open-file-and-close-window", 
"<control><shift>Down");
 
         /* Show a warning dialog to inform the user that the shorcut for move to trash
          * changed */
-        nautilus_application_add_accelerator (app, "view.show-move-to-trash-shortcut-changed-dialog", 
"<control>Delete");
+        nautilus_application_set_accelerator (app, "view.show-move-to-trash-shortcut-changed-dialog", 
"<control>Delete");
 
         nautilus_profile_end (NULL);
 }
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index a15b23f..af2eadf 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -797,9 +797,9 @@ nautilus_window_slot_init (NautilusWindowSlot *self)
         gtk_widget_insert_action_group (GTK_WIDGET (self),
                                         "slot",
                                         G_ACTION_GROUP (priv->slot_action_group));
-        nautilus_application_add_accelerator (app, "slot.files-view-mode(uint32 1)", "<control>1");
-        nautilus_application_add_accelerator (app, "slot.files-view-mode(uint32 0)", "<control>2");
-        nautilus_application_add_accelerator (app, "slot.search-visible", "<control>f");
+        nautilus_application_set_accelerator (app, "slot.files-view-mode(uint32 1)", "<control>1");
+        nautilus_application_set_accelerator (app, "slot.files-view-mode(uint32 0)", "<control>2");
+        nautilus_application_set_accelerator (app, "slot.search-visible", "<control>f");
 
         priv->view_mode_before_search = NAUTILUS_VIEW_INVALID_ID;
 }
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 6d5c419..5e7ebf3 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -2074,34 +2074,34 @@ nautilus_window_initialize_actions (NautilusWindow *window)
                                         window);
 
        app = g_application_get_default ();
-       nautilus_application_add_accelerator (app, "win.back", "<alt>Left");
-       nautilus_application_add_accelerator (app, "win.forward", "<alt>Right");
-       nautilus_application_add_accelerator (app, "win.enter-location", "<control>l");
-       nautilus_application_add_accelerator (app, "win.new-tab", "<control>t");
-       nautilus_application_add_accelerator (app, "win.close-current-view", "<control>w");
+       nautilus_application_set_accelerator (app, "win.back", "<alt>Left");
+       nautilus_application_set_accelerator (app, "win.forward", "<alt>Right");
+       nautilus_application_set_accelerator (app, "win.enter-location", "<control>l");
+       nautilus_application_set_accelerator (app, "win.new-tab", "<control>t");
+       nautilus_application_set_accelerator (app, "win.close-current-view", "<control>w");
 
         /* Special case reload, since users are used to use two shortcuts instead of one */
        gtk_application_set_accels_for_action (GTK_APPLICATION (app), "win.reload", reload_accels);
 
-       nautilus_application_add_accelerator (app, "win.undo", "<control>z");
-       nautilus_application_add_accelerator (app, "win.redo", "<shift><control>z");
+       nautilus_application_set_accelerator (app, "win.undo", "<control>z");
+       nautilus_application_set_accelerator (app, "win.redo", "<shift><control>z");
        /* Only accesible by shorcuts */
-       nautilus_application_add_accelerator (app, "win.bookmark-current-location", "<control>d");
-       nautilus_application_add_accelerator (app, "win.up", "<alt>Up");
-       nautilus_application_add_accelerator (app, "win.go-home", "<alt>Home");
-       nautilus_application_add_accelerator (app, "win.tab-previous", "<control>Page_Up");
-       nautilus_application_add_accelerator (app, "win.tab-next", "<control>Page_Down");
-       nautilus_application_add_accelerator (app, "win.tab-move-left", "<shift><control>Page_Up");
-       nautilus_application_add_accelerator (app, "win.tab-move-right", "<shift><control>Page_Down");
-       nautilus_application_add_accelerator (app, "win.prompt-root-location", "slash");
-       nautilus_application_add_accelerator (app, "win.prompt-home-location", "asciitilde");
-        nautilus_application_add_accelerator (app, "win.view-menu", "F10");
+       nautilus_application_set_accelerator (app, "win.bookmark-current-location", "<control>d");
+       nautilus_application_set_accelerator (app, "win.up", "<alt>Up");
+       nautilus_application_set_accelerator (app, "win.go-home", "<alt>Home");
+       nautilus_application_set_accelerator (app, "win.tab-previous", "<control>Page_Up");
+       nautilus_application_set_accelerator (app, "win.tab-next", "<control>Page_Down");
+       nautilus_application_set_accelerator (app, "win.tab-move-left", "<shift><control>Page_Up");
+       nautilus_application_set_accelerator (app, "win.tab-move-right", "<shift><control>Page_Down");
+       nautilus_application_set_accelerator (app, "win.prompt-root-location", "slash");
+       nautilus_application_set_accelerator (app, "win.prompt-home-location", "asciitilde");
+       nautilus_application_set_accelerator (app, "win.view-menu", "F10");
 
        /* Alt+N for the first 9 tabs */
        for (i = 0; i < 9; ++i) {
                g_snprintf (detailed_action, sizeof (detailed_action), "win.go-to-tab(%i)", i);
                g_snprintf (accel, sizeof (accel), "<alt>%i", i + 1);
-               nautilus_application_add_accelerator (app, detailed_action, accel);
+               nautilus_application_set_accelerator (app, detailed_action, accel);
        }
 
        action = g_action_map_lookup_action (G_ACTION_MAP (app), "show-hide-sidebar");


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