[gnome-builder/wip/libide] libide: implement history branching in back-forward-list
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/libide] libide: implement history branching in back-forward-list
- Date: Tue, 10 Feb 2015 20:56:42 +0000 (UTC)
commit e77c16be74bea5b6deb3a8f9bf0d052852d93ea7
Author: Christian Hergert <christian hergert me>
Date: Tue Feb 10 12:56:34 2015 -0800
libide: implement history branching in back-forward-list
libide/ide-back-forward-list.c | 34 ++++++++++++++++++++++++++++++++--
1 files changed, 32 insertions(+), 2 deletions(-)
---
diff --git a/libide/ide-back-forward-list.c b/libide/ide-back-forward-list.c
index eab5d6f..ad4630e 100644
--- a/libide/ide-back-forward-list.c
+++ b/libide/ide-back-forward-list.c
@@ -182,9 +182,39 @@ ide_back_forward_list_push (IdeBackForwardList *self,
}
IdeBackForwardList *
-ide_back_forward_list_branch (IdeBackForwardList *list)
+ide_back_forward_list_branch (IdeBackForwardList *self)
{
- return NULL;
+ IdeBackForwardListPrivate *priv;
+ IdeBackForwardList *ret;
+ IdeContext *context;
+ GList *iter;
+
+ g_return_val_if_fail (IDE_IS_BACK_FORWARD_LIST (self), NULL);
+
+ priv = ide_back_forward_list_get_instance_private (self);
+
+ context = ide_object_get_context (IDE_OBJECT (self));
+
+ ret = g_object_new (IDE_TYPE_BACK_FORWARD_LIST,
+ "context", context,
+ NULL);
+
+ for (iter = priv->backward->head; iter; iter = iter->next)
+ {
+ IdeBackForwardItem *item = iter->data;
+ ide_back_forward_list_push (ret, item);
+ }
+
+ if (priv->current_item)
+ ide_back_forward_list_push (ret, priv->current_item);
+
+ for (iter = priv->forward->head; iter; iter = iter->next)
+ {
+ IdeBackForwardItem *item = iter->data;
+ ide_back_forward_list_push (ret, item);
+ }
+
+ return ret;
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]