[gnome-builder/wip/libide] libide: try to chain items before appending



commit 0ee2bfb7665218cac920be1a7f5be72f4390c44f
Author: Christian Hergert <christian hergert me>
Date:   Thu Mar 12 23:37:17 2015 -0700

    libide: try to chain items before appending

 libide/ide-back-forward-list.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/libide/ide-back-forward-list.c b/libide/ide-back-forward-list.c
index e9317c1..d16ad95 100644
--- a/libide/ide-back-forward-list.c
+++ b/libide/ide-back-forward-list.c
@@ -181,7 +181,10 @@ ide_back_forward_list_push (IdeBackForwardList *self,
       g_queue_push_head (self->backward, g_object_ref (self->current_item));
     }
 
-  self->current_item = g_object_ref (item);
+  if (self->backward->head && ide_back_forward_item_chain (self->backward->head->data, item))
+    self->current_item = g_queue_pop_head (self->backward);
+  else
+    self->current_item = g_object_ref (item);
 
   g_object_notify_by_pspec (G_OBJECT (self), gParamSpecs [PROP_CAN_GO_BACKWARD]);
   g_object_notify_by_pspec (G_OBJECT (self), gParamSpecs [PROP_CAN_GO_FORWARD]);


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