[gitg/wip/actions: 25/26] Separate walker includes and selection



commit d7a5c0e02aefefbcc17db4c35ef34ba2f90c0d74
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Sat Jul 12 10:35:45 2014 +0200

    Separate walker includes and selection

 gitg/history/gitg-history.vala |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/gitg/history/gitg-history.vala b/gitg/history/gitg-history.vala
index 8051943..a9609f8 100644
--- a/gitg/history/gitg-history.vala
+++ b/gitg/history/gitg-history.vala
@@ -426,26 +426,38 @@ namespace GitgHistory
                {
                        d_selected.clear();
 
+                       var include = new Ggit.OId[0];
+                       var isall = d_main.refs_list.is_all;
+
                        foreach (var r in d_main.refs_list.selection)
                        {
                                try
                                {
                                        var resolved = r.resolve();
+                                       Ggit.OId? id;
 
                                        if (resolved.is_tag())
                                        {
                                                var t = 
application.repository.lookup<Ggit.Tag>(resolved.get_target());
-                                               d_selected.add(t.get_target_id());
+
+                                               id = t.get_target_id();
                                        }
                                        else
                                        {
-                                               d_selected.add(resolved.get_target());
+                                               id = resolved.get_target();
+                                       }
+
+                                       include += id;
+
+                                       if (!isall)
+                                       {
+                                               d_selected.add(id);
                                        }
                                }
                                catch {}
                        }
 
-                       d_commit_list_model.set_include(d_selected.to_array());
+                       d_commit_list_model.set_include(include);
                        d_commit_list_model.reload();
                }
        }


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