summaryrefslogtreecommitdiff
path: root/src/nautilus-navigation-window.c
diff options
context:
space:
mode:
authorChristian Neumair <chris@gnome-de.org>2005-07-13 12:23:37 +0000
committerChristian Neumair <cneumair@src.gnome.org>2005-07-13 12:23:37 +0000
commitc427340738783dccf9317cfa117f8e291bf9cbe6 (patch)
tree7ccbf0d5aeaf0cdcf5f4c52a73c927d9f5f83338 /src/nautilus-navigation-window.c
parent03db08e08aeba8b8513da3ac5d21797e1c442909 (diff)
downloadnautilus-c427340738783dccf9317cfa117f8e291bf9cbe6.tar.gz
Try to reload visited locations from history before doing a full location
2005-07-13 Christian Neumair <chris@gnome-de.org> * src/nautilus-navigation-window.c: (bookmark_list_get_uri_index, path_bar_location_changed_callback): Try to reload visited locations from history before doing a full location change. Fixes #310068. * src/nautilus-sidebar-title.c: (nautilus_sidebar_title_init): Track SHOW_DIRECTORY_ITEM_COUNTS preference and update label on change. Fixes #92862.
Diffstat (limited to 'src/nautilus-navigation-window.c')
-rw-r--r--src/nautilus-navigation-window.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/nautilus-navigation-window.c b/src/nautilus-navigation-window.c
index 59bf53206..3438f19af 100644
--- a/src/nautilus-navigation-window.c
+++ b/src/nautilus-navigation-window.c
@@ -270,14 +270,47 @@ always_use_location_entry_changed (gpointer callback_data)
}
}
+static int
+bookmark_list_get_uri_index (GList *list,
+ const char *uri)
+{
+ NautilusBookmark *bookmark;
+ GList *l;
+ char *tmp;
+ int i;
+
+ g_return_val_if_fail (uri != NULL, -1);
+
+ for (i = 0, l = list; l != NULL; i++, l = l->next) {
+ bookmark = NAUTILUS_BOOKMARK (l->data);
+
+ tmp = nautilus_bookmark_get_uri (bookmark);
+ if (strcmp (tmp, uri) == 0) {
+ g_free (tmp);
+ return i;
+ }
+ g_free (tmp);
+ }
+
+ return -1;
+}
static void
path_bar_location_changed_callback (GtkWidget *widget,
const char *uri,
NautilusNavigationWindow *window)
{
+ int i;
+
g_assert (NAUTILUS_IS_NAVIGATION_WINDOW (window));
- nautilus_window_go_to (NAUTILUS_WINDOW (window), uri);
+
+ /* check whether we already visited the target location */
+ i = bookmark_list_get_uri_index (window->back_list, uri);
+ if (i >= 0) {
+ nautilus_navigation_window_back_or_forward (window, TRUE, i);
+ } else {
+ nautilus_window_go_to (NAUTILUS_WINDOW (window), uri);
+ }
}