Do not emit 'ref_activated' signal during a reloading

This commit is contained in:
Techlive Zheng 2013-06-03 16:52:04 +08:00
parent 5cf7434857
commit b9dfbc0778
2 changed files with 8 additions and 2 deletions

View file

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

View file

@ -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) => {