[gitg] Do not emit 'ref_activated' signal during a reloading



commit b9dfbc0778eda04da1a8c7fbb74b1f202e088521
Author: Techlive Zheng <techlivezheng gmail com>
Date:   Mon Jun 3 16:52:04 2013 +0800

    Do not emit 'ref_activated' signal during a reloading

 plugins/history/gitg-history-navigation.vala |    8 ++++++++
 plugins/history/gitg-history.vala            |    2 --
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/plugins/history/gitg-history-navigation.vala b/plugins/history/gitg-history-navigation.vala
index d9f0d67..eb69836 100644
--- a/plugins/history/gitg-history-navigation.vala
+++ b/plugins/history/gitg-history-navigation.vala
@@ -68,6 +68,7 @@ namespace GitgHistory
                private SList<Gtk.TreeIter?> d_parents;
                private uint d_sections;
                private Activated[] d_callbacks;
+               private bool d_reloading;
                private Gitg.Repository? d_repository;
                private string? d_selected_head;
                private Gtk.TreeIter? d_selected_iter;
@@ -381,8 +382,10 @@ namespace GitgHistory
                {
                        if (d_repository != null)
                        {
+                               d_reloading = true;
                                clear();
                                populate(d_repository);
+                               d_reloading = false;
                        }
                }
 
@@ -400,6 +403,11 @@ namespace GitgHistory
 
                private void activate_ref(Gitg.Ref? r)
                {
+                       if (d_reloading)
+                       {
+                               return;
+                       }
+
                        if (r != null)
                        {
                                d_selected_head = r.parsed_name.name;
diff --git a/plugins/history/gitg-history.vala b/plugins/history/gitg-history.vala
index 5754eec..d335fff 100644
--- a/plugins/history/gitg-history.vala
+++ b/plugins/history/gitg-history.vala
@@ -200,9 +200,7 @@ namespace GitgHistory
                public void reload()
                {
                        double vadj = d_navigation.get_vadjustment().get_value();
-                       d_navigation.set_model(null);
                        d_navigation_model.reload();
-                       d_navigation.set_model(d_navigation_model);
                        d_navigation.expand_all();
                        d_navigation.select();
                        d_navigation.size_allocate.connect((a) => {


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