[gthumb] fixed wrong behaviuor in navigation history



commit 2f66759e4732943aebd8d5f22f7a80274cc356a8
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Fri Mar 23 13:38:58 2012 +0100

    fixed wrong behaviuor in navigation history
    
    steps to reproduce the problem:
    
    open A,  open B, back button, open C
    
    before the change the history was: C, B, A; but B wasn't the
    previuos visited folder, after the change the history is: C, A.

 gthumb/gth-browser.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index aab3d35..ab71969 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -798,7 +798,17 @@ _gth_browser_add_to_history (GthBrowser *browser,
 	if ((browser->priv->history_current == NULL) || ! _g_file_equal_uris (file, browser->priv->history_current->data)) {
 		GList *scan;
 
-		/* remove all the occurrences of file from the history */
+		/* remove all files after the current position */
+		for (scan = browser->priv->history; scan && (scan != browser->priv->history_current); /* void */) {
+			GList *next = scan->next;
+
+			browser->priv->history = g_list_remove_link (browser->priv->history, scan);
+			_g_object_list_unref (scan);
+
+			scan = next;
+		}
+
+		/* remove all the occurrences of 'file' from the history */
 		for (scan = browser->priv->history; scan; /* void */) {
 			GList *next = scan->next;
 			GFile *file_in_history = scan->data;



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