Commit dab5173a authored by John Sullivan's avatar John Sullivan

Made choosing from the back/forward menus correctly update the back/forward

chains.
parent f7134226
2000-03-21 John Sullivan <sullivan@eazel.com>
Fixed bug 203 (preserve back/forward chain when using
back/forward menus).
* src/ntl-window.h: added enum NautilusLocationChangeType.
Removed window fields is_back and is_reload. Added window
fields location_change_type and location_change_distance.
* src/ntl-window-private.h:
(nautilus_window_back_or_forward): Exposed this function.
(nautilus_window_change_location): Changed name to
nautilus_window_begin_location_change and replaced is_back
and is_forward parameters with type & distance.
(nautilus_window_end_location_change): Removed this prototype
that had no implementation.
* src/ntl-window-msgs.c:
(nautilus_window_update_internals): Rewrote to use
location_change_type and location_change_index.
(nautilus_window_change_location): Changed name to
nautilus_window_begin_location_change and replaced is_back
and is_forward parameters with type & distance.
(nautilus_window_request_location_change): Updated caller of
nautilus_window-change_location.
(nautilus_window_change_location_2): Renamed to
nautilus_window_end_location_change_callback for clarity; removed
useless assignment to window->is_back.
(view_menu_switch_views_cb): Removed useless assignments of
window->is_back and window->is_reload.
(nautilus_window_update_state): Removed is_back from a debug message.
* src/ntl-window.c:
(nautilus_window_back_or_forward): Added distance parameter;
call nautilus_window_begin_location_change properly.
(nautilus_window_back_cb), (nautilus_window_forward_cb):
Pass distance of 0 to nautilus_window_back_or_forward.
* src/nautilus-window-toolbars.c: (activate_back_or_forward_menu_item):
call newly-exposed nautilus_window_back_or_forward.
2000-03-21 Pavel Cisler <pavel@eazel.com>
* libnautilus/nautilus-icon-container.c
......
......@@ -688,36 +688,34 @@ nautilus_window_remove_meta_view(NautilusWindow *window, NautilusView *meta_view
nautilus_window_remove_meta_view_real(window, meta_view);
}
/* FIXME: Factor toolbar stuff out into ntl-window-toolbar.c */
static void
nautilus_window_back_or_forward (NautilusWindow *window, gboolean back)
void
nautilus_window_back_or_forward (NautilusWindow *window, gboolean back, guint distance)
{
Nautilus_NavigationRequestInfo nri;
GSList *list;
g_assert(back ? window->back_list : window->forward_list);
list = back ? window->back_list : window->forward_list;
g_assert (g_slist_length (list) > distance);
memset(&nri, 0, sizeof(nri));
/* FIXME: Have to cast away the const for nri.requested_uri. This field should be
* declared const. */
nri.requested_uri = (char *)nautilus_bookmark_get_uri (back ?
window->back_list->data :
window->forward_list->data);
nri.requested_uri = (char *)nautilus_bookmark_get_uri (g_slist_nth_data (list, distance));
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, back, FALSE);
nautilus_window_begin_location_change (window, &nri, NULL, back ? NAUTILUS_LOCATION_CHANGE_BACK : NAUTILUS_LOCATION_CHANGE_FORWARD, distance);
}
void
nautilus_window_back_cb (GtkWidget *widget, NautilusWindow *window)
{
nautilus_window_back_or_forward (window, TRUE);
nautilus_window_back_or_forward (window, TRUE, 0);
}
void
nautilus_window_forward_cb (GtkWidget *widget, NautilusWindow *window)
{
nautilus_window_back_or_forward (window, FALSE);
nautilus_window_back_or_forward (window, FALSE, 0);
}
const char *
......
......@@ -48,6 +48,13 @@ typedef struct {
typedef struct _NautilusWindowStateInfo NautilusWindowStateInfo;
typedef enum {
NAUTILUS_LOCATION_CHANGE_STANDARD,
NAUTILUS_LOCATION_CHANGE_BACK,
NAUTILUS_LOCATION_CHANGE_FORWARD,
NAUTILUS_LOCATION_CHANGE_RELOAD
} NautilusLocationChangeType;
struct _NautilusWindow {
GnomeApp parent_object;
......@@ -97,9 +104,10 @@ struct _NautilusWindow {
guint action_tag;
guint16 made_changes, making_changes;
NautilusLocationChangeType location_change_type;
guint location_change_distance;
gboolean changes_pending : 1;
gboolean is_back : 1;
gboolean is_reload : 1;
gboolean views_shown : 1;
gboolean view_bombed_out : 1;
gboolean view_activation_complete : 1;
......
......@@ -688,36 +688,34 @@ nautilus_window_remove_meta_view(NautilusWindow *window, NautilusView *meta_view
nautilus_window_remove_meta_view_real(window, meta_view);
}
/* FIXME: Factor toolbar stuff out into ntl-window-toolbar.c */
static void
nautilus_window_back_or_forward (NautilusWindow *window, gboolean back)
void
nautilus_window_back_or_forward (NautilusWindow *window, gboolean back, guint distance)
{
Nautilus_NavigationRequestInfo nri;
GSList *list;
g_assert(back ? window->back_list : window->forward_list);
list = back ? window->back_list : window->forward_list;
g_assert (g_slist_length (list) > distance);
memset(&nri, 0, sizeof(nri));
/* FIXME: Have to cast away the const for nri.requested_uri. This field should be
* declared const. */
nri.requested_uri = (char *)nautilus_bookmark_get_uri (back ?
window->back_list->data :
window->forward_list->data);
nri.requested_uri = (char *)nautilus_bookmark_get_uri (g_slist_nth_data (list, distance));
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, back, FALSE);
nautilus_window_begin_location_change (window, &nri, NULL, back ? NAUTILUS_LOCATION_CHANGE_BACK : NAUTILUS_LOCATION_CHANGE_FORWARD, distance);
}
void
nautilus_window_back_cb (GtkWidget *widget, NautilusWindow *window)
{
nautilus_window_back_or_forward (window, TRUE);
nautilus_window_back_or_forward (window, TRUE, 0);
}
void
nautilus_window_forward_cb (GtkWidget *widget, NautilusWindow *window)
{
nautilus_window_back_or_forward (window, FALSE);
nautilus_window_back_or_forward (window, FALSE, 0);
}
const char *
......
......@@ -48,6 +48,13 @@ typedef struct {
typedef struct _NautilusWindowStateInfo NautilusWindowStateInfo;
typedef enum {
NAUTILUS_LOCATION_CHANGE_STANDARD,
NAUTILUS_LOCATION_CHANGE_BACK,
NAUTILUS_LOCATION_CHANGE_FORWARD,
NAUTILUS_LOCATION_CHANGE_RELOAD
} NautilusLocationChangeType;
struct _NautilusWindow {
GnomeApp parent_object;
......@@ -97,9 +104,10 @@ struct _NautilusWindow {
guint action_tag;
guint16 made_changes, making_changes;
NautilusLocationChangeType location_change_type;
guint location_change_distance;
gboolean changes_pending : 1;
gboolean is_back : 1;
gboolean is_reload : 1;
gboolean views_shown : 1;
gboolean view_bombed_out : 1;
gboolean view_activation_complete : 1;
......
......@@ -688,36 +688,34 @@ nautilus_window_remove_meta_view(NautilusWindow *window, NautilusView *meta_view
nautilus_window_remove_meta_view_real(window, meta_view);
}
/* FIXME: Factor toolbar stuff out into ntl-window-toolbar.c */
static void
nautilus_window_back_or_forward (NautilusWindow *window, gboolean back)
void
nautilus_window_back_or_forward (NautilusWindow *window, gboolean back, guint distance)
{
Nautilus_NavigationRequestInfo nri;
GSList *list;
g_assert(back ? window->back_list : window->forward_list);
list = back ? window->back_list : window->forward_list;
g_assert (g_slist_length (list) > distance);
memset(&nri, 0, sizeof(nri));
/* FIXME: Have to cast away the const for nri.requested_uri. This field should be
* declared const. */
nri.requested_uri = (char *)nautilus_bookmark_get_uri (back ?
window->back_list->data :
window->forward_list->data);
nri.requested_uri = (char *)nautilus_bookmark_get_uri (g_slist_nth_data (list, distance));
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, back, FALSE);
nautilus_window_begin_location_change (window, &nri, NULL, back ? NAUTILUS_LOCATION_CHANGE_BACK : NAUTILUS_LOCATION_CHANGE_FORWARD, distance);
}
void
nautilus_window_back_cb (GtkWidget *widget, NautilusWindow *window)
{
nautilus_window_back_or_forward (window, TRUE);
nautilus_window_back_or_forward (window, TRUE, 0);
}
void
nautilus_window_forward_cb (GtkWidget *widget, NautilusWindow *window)
{
nautilus_window_back_or_forward (window, FALSE);
nautilus_window_back_or_forward (window, FALSE, 0);
}
const char *
......
......@@ -48,6 +48,13 @@ typedef struct {
typedef struct _NautilusWindowStateInfo NautilusWindowStateInfo;
typedef enum {
NAUTILUS_LOCATION_CHANGE_STANDARD,
NAUTILUS_LOCATION_CHANGE_BACK,
NAUTILUS_LOCATION_CHANGE_FORWARD,
NAUTILUS_LOCATION_CHANGE_RELOAD
} NautilusLocationChangeType;
struct _NautilusWindow {
GnomeApp parent_object;
......@@ -97,9 +104,10 @@ struct _NautilusWindow {
guint action_tag;
guint16 made_changes, making_changes;
NautilusLocationChangeType location_change_type;
guint location_change_distance;
gboolean changes_pending : 1;
gboolean is_back : 1;
gboolean is_reload : 1;
gboolean views_shown : 1;
gboolean view_bombed_out : 1;
gboolean view_activation_complete : 1;
......
......@@ -201,46 +201,72 @@ nautilus_window_update_internals(NautilusWindow *window, NautilusNavigationInfo
Nautilus_NavigationInfo *newni;
/* Maintain history lists. */
if(!window->is_reload)
if (window->location_change_type != NAUTILUS_LOCATION_CHANGE_RELOAD)
{
nautilus_add_to_history_list (loci->navinfo.requested_uri);
if (window->is_back)
if (window->location_change_type == NAUTILUS_LOCATION_CHANGE_BACK)
{
/* Going back. Remove one item from the back list and
* add the current item to the forward list.
*/
g_assert(window->back_list);
g_assert(!strcmp(nautilus_bookmark_get_uri (NAUTILUS_BOOKMARK (window->back_list->data)), loci->navinfo.requested_uri));
guint index;
/* Going back. Move items from the back list to the forward list. */
g_assert(g_slist_length (window->back_list) > window->location_change_distance);
g_assert(!strcmp(nautilus_bookmark_get_uri (NAUTILUS_BOOKMARK (g_slist_nth_data (window->back_list, window->location_change_distance))), loci->navinfo.requested_uri));
g_assert(window->ni);
window->forward_list = g_slist_prepend(window->forward_list,
nautilus_bookmark_new (window->ni->requested_uri));
gtk_object_unref(window->back_list->data);
window->back_list = g_slist_remove_link(window->back_list, window->back_list);
/* Move current location to Forward list */
window->forward_list = g_slist_prepend (window->forward_list,
nautilus_bookmark_new (window->ni->requested_uri));
/* Move extra links from Back to Forward list */
for (index = 0; index < window->location_change_distance; ++index)
{
NautilusBookmark *bookmark;
bookmark = window->back_list->data;
window->back_list = g_slist_remove_link (window->back_list, window->back_list);
window->forward_list = g_slist_prepend (window->forward_list, bookmark);
}
/* One bookmark falls out of back/forward lists and becomes viewed location */
gtk_object_unref (window->back_list->data);
window->back_list = g_slist_remove_link (window->back_list, window->back_list);
}
else if (window->location_change_type == NAUTILUS_LOCATION_CHANGE_FORWARD)
{
guint index;
/* Going back. Move items from the forward list to the back list. */
g_assert(g_slist_length (window->forward_list) > window->location_change_distance);
g_assert(!strcmp(nautilus_bookmark_get_uri (NAUTILUS_BOOKMARK (g_slist_nth_data (window->forward_list, window->location_change_distance))), loci->navinfo.requested_uri));
g_assert(window->ni);
/* Move current location to Back list */
window->back_list = g_slist_prepend (window->back_list,
nautilus_bookmark_new (window->ni->requested_uri));
/* Move extra links from Forward to Back list */
for (index = 0; index < window->location_change_distance; ++index)
{
NautilusBookmark *bookmark;
bookmark = window->forward_list->data;
window->forward_list = g_slist_remove_link (window->forward_list, window->forward_list);
window->back_list = g_slist_prepend (window->back_list, bookmark);
}
/* One bookmark falls out of back/forward lists and becomes viewed location */
gtk_object_unref (window->forward_list->data);
window->forward_list = g_slist_remove_link (window->forward_list, window->forward_list);
}
else
{
/* Not going back. Could be an arbitrary new uri, or could be going forward in the forward list.
* Remove one item from the forward list if it's the same as the request.
* Otherwise, clobber the entire forward list. FIXME: This is not quite correct behavior (doesn't
* match web browsers) because it doesn't distinguish between using the Forward button or list
* to move in the Forward chain and coincidentally visiting a site that happens to be in the
* Forward chain.
*/
g_assert (window->location_change_type == NAUTILUS_LOCATION_CHANGE_STANDARD);
/* Clobber the entire forward list, and move displayed location to back list */
if (window->forward_list)
{
if (strcmp (loci->navinfo.requested_uri,
nautilus_bookmark_get_uri (NAUTILUS_BOOKMARK (window->forward_list->data))) == 0)
{
gtk_object_unref(window->forward_list->data);
window->forward_list = g_slist_remove_link(window->forward_list, window->forward_list);
}
else
{
g_slist_foreach(window->forward_list, (GFunc)gtk_object_unref, NULL);
g_slist_free(window->forward_list); window->forward_list = NULL;
}
g_slist_foreach(window->forward_list, (GFunc)gtk_object_unref, NULL);
g_slist_free(window->forward_list); window->forward_list = NULL;
}
if (window->ni)
......@@ -490,7 +516,7 @@ nautilus_window_request_location_change(NautilusWindow *window,
}
else
{
nautilus_window_change_location(window, loc, requesting_view, FALSE, FALSE);
nautilus_window_begin_location_change(window, loc, requesting_view, NAUTILUS_LOCATION_CHANGE_STANDARD, 0);
}
}
......@@ -569,8 +595,8 @@ nautilus_window_update_state(gpointer data)
#ifdef EXTREME_DEBUGGING
g_message(">>> nautilus_window_update_state (action tag is %d):", window->action_tag);
g_print("made_changes %d, making_changes %d\n", window->made_changes, window->making_changes);
g_print("changes_pending %d, is_back %d, views_shown %d, view_bombed_out %d, view_activation_complete %d\n",
window->changes_pending, window->is_back, window->views_shown,
g_print("changes_pending %d, location_change_type %d, views_shown %d, view_bombed_out %d, view_activation_complete %d\n",
window->changes_pending, window->location_change_type, window->views_shown,
window->view_bombed_out, window->view_activation_complete);
g_print("sent_update_view %d, cv_progress_initial %d, cv_progress_done %d, cv_progress_error %d, reset_to_idle %d\n",
window->sent_update_view, window->cv_progress_initial, window->cv_progress_done, window->cv_progress_error,
......@@ -908,7 +934,7 @@ nautilus_window_set_state_info(NautilusWindow *window, ...)
}
static void
nautilus_window_change_location_2(NautilusNavigationInfo *navi, gpointer data)
nautilus_window_end_location_change_callback (NautilusNavigationInfo *navi, gpointer data)
{
NautilusWindow *window = data;
char *requested_uri;
......@@ -983,32 +1009,47 @@ nautilus_window_change_location_2(NautilusNavigationInfo *navi, gpointer data)
{
/* Clean up state of already-showing window */
nautilus_window_allow_stop(window, FALSE);
window->is_back = FALSE;
nautilus_window_progress_indicate(window, PROGRESS_ERROR, 0, error_message);
}
g_free (error_message);
}
/*
* nautilus_window_begin_location_change
*
* Change a window's location.
* @window: The NautilusWindow whose location should be changed.
* @loc: A Nautilus_NavigationRequestInfo specifying info about this transition.
* @requesting_view: The view from which this location change originated, can be NULL.
* @type: Which type of location change is this? Standard, back, forward, or reload?
* @distance: If type is back or forward, the index into the back or forward chain. If
* type is standard or reload, this is ignored, and must be 0.
*/
void
nautilus_window_change_location(NautilusWindow *window,
Nautilus_NavigationRequestInfo *loc,
NautilusView *requesting_view,
gboolean is_back,
gboolean is_reload)
nautilus_window_begin_location_change(NautilusWindow *window,
Nautilus_NavigationRequestInfo *loc,
NautilusView *requesting_view,
NautilusLocationChangeType type,
guint distance)
{
const char *current_iid;
g_assert (NAUTILUS_IS_WINDOW (window));
g_assert (loc != NULL);
g_assert (type == NAUTILUS_LOCATION_CHANGE_BACK ||
type == NAUTILUS_LOCATION_CHANGE_FORWARD ||
distance == 0);
nautilus_window_set_state_info(window, (NautilusWindowStateItem)RESET_TO_IDLE, (NautilusWindowStateItem)SYNC_STATE, (NautilusWindowStateItem)0);
while (gdk_events_pending())
gtk_main_iteration();
nautilus_window_progress_indicate(window, PROGRESS_INITIAL, 0, _("Gathering information"));
window->is_back = is_back;
window->is_reload = is_reload;
window->location_change_type = type;
window->location_change_distance = distance;
window->new_requesting_view = requesting_view;
nautilus_window_allow_stop(window, TRUE);
......@@ -1020,7 +1061,7 @@ nautilus_window_change_location(NautilusWindow *window,
}
window->cancel_tag =
nautilus_navinfo_new(loc, window->ni, nautilus_window_change_location_2, window, current_iid);
nautilus_navinfo_new(loc, window->ni, nautilus_window_end_location_change_callback, window, current_iid);
}
......@@ -1053,8 +1094,6 @@ view_menu_switch_views_cb (GtkWidget *widget, gpointer data)
view = nautilus_window_load_content_view (window, iid, window->ni, NULL);
nautilus_window_set_state_info (window, (NautilusWindowStateItem)NEW_CONTENT_VIEW_ACTIVATED, view, (NautilusWindowStateItem)0);
window->is_back = FALSE;
window->is_reload = TRUE;
}
/*
......
......@@ -33,13 +33,15 @@ void nautilus_window_real_request_progress_change (NautilusWindow *window,
Nautilus_ProgressRequestInfo *loc,
NautilusView *requesting_view);
void nautilus_window_set_status(NautilusWindow *window, const char *txt);
void nautilus_window_change_location(NautilusWindow *window,
Nautilus_NavigationRequestInfo *loc,
NautilusView *requesting_view,
gboolean is_back,
gboolean is_reload);
void nautilus_window_back_or_forward (NautilusWindow *window,
gboolean back,
guint distance);
void nautilus_window_begin_location_change(NautilusWindow *window,
Nautilus_NavigationRequestInfo *loc,
NautilusView *requesting_view,
NautilusLocationChangeType type,
guint distance);
void nautilus_window_remove_meta_view_real(NautilusWindow *window, NautilusView *meta_view);
void nautilus_window_end_location_change(NautilusWindow *window);
void nautilus_window_connect_view (NautilusWindow *window,
NautilusView *view);
void nautilus_window_view_destroyed(NautilusView *view, NautilusWindow *window);
......
......@@ -76,21 +76,12 @@ activate_back_or_forward_menu_item (GtkMenuItem *menu_item,
gboolean back)
{
int index;
NautilusBookmark *bookmark;
g_assert (GTK_IS_MENU_ITEM (menu_item));
g_assert (NAUTILUS_IS_WINDOW (window));
index = GPOINTER_TO_INT (gtk_object_get_user_data (GTK_OBJECT (menu_item)));
bookmark = NAUTILUS_BOOKMARK (g_slist_nth_data (back ? window->back_list
: window->forward_list,
index));
/* FIXME: This should do the equivalent of going back or forward n times,
* rather than just going to the right uri. This is needed to
* keep the back/forward chain intact.
*/
nautilus_window_goto_uri (window, nautilus_bookmark_get_uri (bookmark));
nautilus_window_back_or_forward (window, back, index);
}
static void
......@@ -206,7 +197,7 @@ nautilus_window_reload_cb (GtkWidget *widget, NautilusWindow *window)
memset(&nri, 0, sizeof(nri));
nri.requested_uri = (char *)nautilus_window_get_requested_uri (window);
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location (window, &nri, NULL, FALSE, TRUE);
nautilus_window_begin_location_change (window, &nri, NULL, NAUTILUS_LOCATION_CHANGE_RELOAD, 0);
}
static void
......
......@@ -688,36 +688,34 @@ nautilus_window_remove_meta_view(NautilusWindow *window, NautilusView *meta_view
nautilus_window_remove_meta_view_real(window, meta_view);
}
/* FIXME: Factor toolbar stuff out into ntl-window-toolbar.c */
static void
nautilus_window_back_or_forward (NautilusWindow *window, gboolean back)
void
nautilus_window_back_or_forward (NautilusWindow *window, gboolean back, guint distance)
{
Nautilus_NavigationRequestInfo nri;
GSList *list;
g_assert(back ? window->back_list : window->forward_list);
list = back ? window->back_list : window->forward_list;
g_assert (g_slist_length (list) > distance);
memset(&nri, 0, sizeof(nri));
/* FIXME: Have to cast away the const for nri.requested_uri. This field should be
* declared const. */
nri.requested_uri = (char *)nautilus_bookmark_get_uri (back ?
window->back_list->data :
window->forward_list->data);
nri.requested_uri = (char *)nautilus_bookmark_get_uri (g_slist_nth_data (list, distance));
nri.new_window_default = nri.new_window_suggested = nri.new_window_enforced = Nautilus_V_FALSE;
nautilus_window_change_location(window, &nri, NULL, back, FALSE);
nautilus_window_begin_location_change (window, &nri, NULL, back ? NAUTILUS_LOCATION_CHANGE_BACK : NAUTILUS_LOCATION_CHANGE_FORWARD, distance);
}
void
nautilus_window_back_cb (GtkWidget *widget, NautilusWindow *window)
{
nautilus_window_back_or_forward (window, TRUE);
nautilus_window_back_or_forward (window, TRUE, 0);
}
void
nautilus_window_forward_cb (GtkWidget *widget, NautilusWindow *window)
{
nautilus_window_back_or_forward (window, FALSE);
nautilus_window_back_or_forward (window, FALSE, 0);
}
const char *
......
......@@ -48,6 +48,13 @@ typedef struct {
typedef struct _NautilusWindowStateInfo NautilusWindowStateInfo;
typedef enum {
NAUTILUS_LOCATION_CHANGE_STANDARD,
NAUTILUS_LOCATION_CHANGE_BACK,
NAUTILUS_LOCATION_CHANGE_FORWARD,
NAUTILUS_LOCATION_CHANGE_RELOAD
} NautilusLocationChangeType;
struct _NautilusWindow {
GnomeApp parent_object;
......@@ -97,9 +104,10 @@ struct _NautilusWindow {
guint action_tag;
guint16 made_changes, making_changes;
NautilusLocationChangeType location_change_type;
guint location_change_distance;
gboolean changes_pending : 1;
gboolean is_back : 1;
gboolean is_reload : 1;
gboolean views_shown : 1;
gboolean view_bombed_out : 1;
gboolean view_activation_complete : 1;
......
......@@ -201,46 +201,72 @@ nautilus_window_update_internals(NautilusWindow *window, NautilusNavigationInfo
Nautilus_NavigationInfo *newni;
/* Maintain history lists. */
if(!window->is_reload)
if (window->location_change_type != NAUTILUS_LOCATION_CHANGE_RELOAD)
{
nautilus_add_to_history_list (loci->navinfo.requested_uri);
if (window->is_back)
if (window->location_change_type == NAUTILUS_LOCATION_CHANGE_BACK)
{
/* Going back. Remove one item from the back list and
* add the current item to the forward list.
*/
g_assert(window->back_list);
g_assert(!strcmp(nautilus_bookmark_get_uri (NAUTILUS_BOOKMARK (window->back_list->data)), loci->navinfo.requested_uri));
guint index;
/* Going back. Move items from the back list to the forward list. */
g_assert(g_slist_length (window->back_list) > window->location_change_distance);
g_assert(!strcmp(nautilus_bookmark_get_uri (NAUTILUS_BOOKMARK (g_slist_nth_data (window->back_list, window->location_change_distance))), loci->navinfo.requested_uri));
g_assert(window->ni);
window->forward_list = g_slist_prepend(window->forward_list,
nautilus_bookmark_new (window->ni->requested_uri));
gtk_object_unref(window->back_list->data);
window->back_list = g_slist_remove_link(window->back_list, window->back_list);
/* Move current location to Forward list */
window->forward_list = g_slist_prepend (window->forward_list,
nautilus_bookmark_new (window->ni->requested_uri));
/* Move extra links from Back to Forward list */