[gitg] Add getting references from ref action interface



commit 80360ef458f89ed9fdafba3db2505b99182d55f3
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Thu Aug 13 20:02:31 2015 +0200

    Add getting references from ref action interface

 gitg/history/gitg-history-action-interface.vala |    5 +++++
 gitg/history/gitg-history-refs-list.vala        |   19 +++++++++++++++++++
 libgitg-ext/gitg-ext-ref-action-interface.vala  |    1 +
 3 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/gitg/history/gitg-history-action-interface.vala b/gitg/history/gitg-history-action-interface.vala
index 09e4149..3291124 100644
--- a/gitg/history/gitg-history-action-interface.vala
+++ b/gitg/history/gitg-history-action-interface.vala
@@ -35,6 +35,11 @@ class ActionInterface : Object, GitgExt.RefActionInterface
                d_refs_list = refs_list;
        }
 
+       public Gee.List<Gitg.Ref> references
+       {
+               owned get { return d_refs_list.references; }
+       }
+
        public void add_ref(Gitg.Ref reference)
        {
                application.repository.clear_refs_cache();
diff --git a/gitg/history/gitg-history-refs-list.vala b/gitg/history/gitg-history-refs-list.vala
index a25cdb5..ed09d87 100644
--- a/gitg/history/gitg-history-refs-list.vala
+++ b/gitg/history/gitg-history-refs-list.vala
@@ -555,6 +555,25 @@ public class RefsList : Gtk.ListBox
                              SettingsBindFlags.GET | SettingsBindFlags.SET);
        }
 
+       public Gee.List<Gitg.Ref> references
+       {
+               owned get
+               {
+                       var ret = new Gee.LinkedList<Gitg.Ref>();
+
+                       @foreach((child) => {
+                               var row = child as RefRow;
+
+                               if (row != null && row.reference != null)
+                               {
+                                       ret.add(row.reference);
+                               }
+                       });
+
+                       return ret;
+               }
+       }
+
        public string reference_sort_order
        {
                get
diff --git a/libgitg-ext/gitg-ext-ref-action-interface.vala b/libgitg-ext/gitg-ext-ref-action-interface.vala
index 4a34991..ee60a82 100644
--- a/libgitg-ext/gitg-ext-ref-action-interface.vala
+++ b/libgitg-ext/gitg-ext-ref-action-interface.vala
@@ -25,6 +25,7 @@ public delegate void RefNameEditingDone(string new_name, bool cancelled);
 public interface RefActionInterface : Object
 {
        public abstract Application application { owned get; construct set; }
+       public abstract Gee.List<Gitg.Ref> references { owned get; }
 
        public abstract void add_ref(Gitg.Ref reference);
        public abstract void remove_ref(Gitg.Ref reference);


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