mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -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;
|
var toggle = sender as ToggleButton;
|
||||||
if (toggle == null) return;
|
if (toggle == null) return;
|
||||||
|
|
||||||
|
var changed = false;
|
||||||
|
|
||||||
if (toggle.DataContext is BranchNode) {
|
if (toggle.DataContext is BranchNode) {
|
||||||
var branch = (toggle.DataContext as BranchNode).Branch;
|
var branch = (toggle.DataContext as BranchNode).Branch;
|
||||||
if (branch == null) return;
|
if (branch == null) return;
|
||||||
|
@ -1101,16 +1103,24 @@ namespace SourceGit.UI {
|
||||||
if (toggle.IsChecked == true) {
|
if (toggle.IsChecked == true) {
|
||||||
if (!repo.LogFilters.Contains(branch.FullName)) {
|
if (!repo.LogFilters.Contains(branch.FullName)) {
|
||||||
repo.LogFilters.Add(branch.FullName);
|
repo.LogFilters.Add(branch.FullName);
|
||||||
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(branch.Upstream) && !repo.LogFilters.Contains(branch.Upstream)) {
|
if (!string.IsNullOrEmpty(branch.Upstream) && !repo.LogFilters.Contains(branch.Upstream)) {
|
||||||
repo.LogFilters.Add(branch.Upstream);
|
repo.LogFilters.Add(branch.Upstream);
|
||||||
UpdateBranches(false);
|
UpdateBranches(false);
|
||||||
|
changed = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
repo.LogFilters.Remove(branch.FullName);
|
if (repo.LogFilters.Contains(branch.FullName)) {
|
||||||
if (!string.IsNullOrEmpty(branch.Upstream)) {
|
repo.LogFilters.Remove(branch.FullName);
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(branch.Upstream) && repo.LogFilters.Contains(branch.Upstream)) {
|
||||||
repo.LogFilters.Remove(branch.Upstream);
|
repo.LogFilters.Remove(branch.Upstream);
|
||||||
UpdateBranches(false);
|
UpdateBranches(false);
|
||||||
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1121,13 +1131,17 @@ namespace SourceGit.UI {
|
||||||
if (toggle.IsChecked == true) {
|
if (toggle.IsChecked == true) {
|
||||||
if (!repo.LogFilters.Contains(tag.Name)) {
|
if (!repo.LogFilters.Contains(tag.Name)) {
|
||||||
repo.LogFilters.Add(tag.Name);
|
repo.LogFilters.Add(tag.Name);
|
||||||
|
changed = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
repo.LogFilters.Remove(tag.Name);
|
if (repo.LogFilters.Contains(tag.Name)) {
|
||||||
|
repo.LogFilters.Remove(tag.Name);
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateHistories();
|
if (changed) UpdateHistories();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue