diff --git a/gitg/history/gitg-history-action-interface.vala b/gitg/history/gitg-history-action-interface.vala index 09e4149a..32911246 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 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 a25cdb53..ed09d87e 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 references + { + owned get + { + var ret = new Gee.LinkedList(); + + @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 4a349914..ee60a82e 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 references { owned get; } public abstract void add_ref(Gitg.Ref reference); public abstract void remove_ref(Gitg.Ref reference);