Add getting references from ref action interface

This commit is contained in:
Jesse van den Kieboom 2015-08-13 20:02:31 +02:00
parent 5145fbc805
commit 80360ef458
3 changed files with 25 additions and 0 deletions

View file

@ -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();

View file

@ -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

View file

@ -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);