diff options
author | António Fernandes <AntonioJPFernandes@gmail.com> | 2017-08-18 10:37:16 +0100 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2017-08-18 12:20:43 +0200 |
commit | 017a90beb6d68788bfffcedcf2b9ba3fa7116ec7 (patch) | |
tree | 3ae7856296366b2db6c231b17d7d8566a31d3997 | |
parent | 1f1da4e495908cf1adb6f7f06659a3c59e851334 (diff) | |
download | nautilus-017a90beb6d68788bfffcedcf2b9ba3fa7116ec7.tar.gz |
window: Make history-hierarchy interaction orthogonal.
We are treating a click in the pathbar as a back/forward history action if the
target location is already in history. This makes the Back and Forward buttons
unconsistent in result.
Instead, treat any click on the pathbar as new history entry.
Addapted from original patch by Marcus Husar <marcus.husar@gmail.com>.
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=563009
-rw-r--r-- | src/nautilus-window.c | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/src/nautilus-window.c b/src/nautilus-window.c index 6eaa95cc2..653b9cfc1 100644 --- a/src/nautilus-window.c +++ b/src/nautilus-window.c @@ -674,33 +674,6 @@ nautilus_window_open_location_full (NautilusWindow *window, g_object_unref (location); } -static int -bookmark_list_get_uri_index (GList *list, - GFile *location) -{ - NautilusBookmark *bookmark; - GList *l; - GFile *tmp; - int i; - - g_return_val_if_fail (location != NULL, -1); - - for (i = 0, l = list; l != NULL; i++, l = l->next) - { - bookmark = NAUTILUS_BOOKMARK (l->data); - - tmp = nautilus_bookmark_get_location (bookmark); - if (g_file_equal (location, tmp)) - { - g_object_unref (tmp); - return i; - } - g_object_unref (tmp); - } - - return -1; -} - static void unset_focus_widget (NautilusWindow *window) { @@ -1964,22 +1937,7 @@ path_bar_location_changed_callback (GtkWidget *widget, GFile *location, NautilusWindow *window) { - NautilusWindowPrivate *priv; - NautilusWindowSlot *slot; - int i; - - priv = nautilus_window_get_instance_private (window); - slot = priv->active_slot; - /* check whether we already visited the target location */ - i = bookmark_list_get_uri_index (nautilus_window_slot_get_back_history (slot), location); - if (i >= 0) - { - nautilus_window_back_or_forward (window, TRUE, i, 0); - } - else - { - nautilus_window_open_location_full (window, location, 0, NULL, NULL); - } + nautilus_window_open_location_full (window, location, 0, NULL, NULL); } static void |