[gitg/wip/simplify-arch] Set initial selection



commit 119d10e80ee4cdd237c724c0770dabab660da3cc
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Mon Jul 1 10:19:14 2013 +0200

    Set initial selection

 plugins/files/gitg-files.vala |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/plugins/files/gitg-files.vala b/plugins/files/gitg-files.vala
index b863f3f..88f0dd7 100644
--- a/plugins/files/gitg-files.vala
+++ b/plugins/files/gitg-files.vala
@@ -73,18 +73,11 @@ namespace GitgFiles
                private void on_selection_changed(GitgExt.History history)
                {
                        history.foreach_selected((commit) => {
-                               var c = commit as Ggit.Commit;
+                               d_whenMapped.update(() => {
+                                       d_model.tree = c.get_tree();
+                               }, this);
 
-                               if (c != null)
-                               {
-                                       d_whenMapped.update(() => {
-                                               d_model.tree = c.get_tree();
-                                       }, this);
-
-                                       return false;
-                               }
-
-                               return true;
+                               return false;
                        });
                }
 
@@ -181,6 +174,7 @@ namespace GitgFiles
                        }
 
                        d_whenMapped = new Gitg.WhenMapped(d_paned);
+                       on_selection_changed(history);
                }
 
                public Gtk.Widget? widget


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