mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-10-31 13:03:20 -07:00
optimize<Dashboard>: do NOT update commits without log filter changes
This commit is contained in:
parent
cdc31a47e6
commit
4ee9234289
1 changed files with 18 additions and 4 deletions
|
@ -1094,6 +1094,8 @@ namespace SourceGit.UI {
|
|||
var toggle = sender as ToggleButton;
|
||||
if (toggle == null) return;
|
||||
|
||||
var changed = false;
|
||||
|
||||
if (toggle.DataContext is BranchNode) {
|
||||
var branch = (toggle.DataContext as BranchNode).Branch;
|
||||
if (branch == null) return;
|
||||
|
@ -1101,16 +1103,24 @@ namespace SourceGit.UI {
|
|||
if (toggle.IsChecked == true) {
|
||||
if (!repo.LogFilters.Contains(branch.FullName)) {
|
||||
repo.LogFilters.Add(branch.FullName);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(branch.Upstream) && !repo.LogFilters.Contains(branch.Upstream)) {
|
||||
repo.LogFilters.Add(branch.Upstream);
|
||||
UpdateBranches(false);
|
||||
changed = true;
|
||||
}
|
||||
} else {
|
||||
if (repo.LogFilters.Contains(branch.FullName)) {
|
||||
repo.LogFilters.Remove(branch.FullName);
|
||||
if (!string.IsNullOrEmpty(branch.Upstream)) {
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(branch.Upstream) && repo.LogFilters.Contains(branch.Upstream)) {
|
||||
repo.LogFilters.Remove(branch.Upstream);
|
||||
UpdateBranches(false);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1121,13 +1131,17 @@ namespace SourceGit.UI {
|
|||
if (toggle.IsChecked == true) {
|
||||
if (!repo.LogFilters.Contains(tag.Name)) {
|
||||
repo.LogFilters.Add(tag.Name);
|
||||
changed = true;
|
||||
}
|
||||
} else {
|
||||
if (repo.LogFilters.Contains(tag.Name)) {
|
||||
repo.LogFilters.Remove(tag.Name);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UpdateHistories();
|
||||
if (changed) UpdateHistories();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue