refactor: rename Models.Watcher.UpdateSubmodules to Models.Watcher.SetSubmodules

* run `dotnet format`
This commit is contained in:
leo 2024-08-09 11:33:37 +08:00
parent 71d2b295da
commit a75d50bf97
No known key found for this signature in database
7 changed files with 14 additions and 14 deletions

View file

@ -3,6 +3,6 @@
public class Submodule
{
public string Path { get; set; } = "";
public bool IsDirty { get; set; } = false;
public bool IsDirty { get; set; } = false;
}
}

View file

@ -71,7 +71,7 @@ namespace SourceGit.Models
}
}
public void UpdateSubmodules(List<Submodule> submodules)
public void SetSubmodules(List<Submodule> submodules)
{
lock (_lockSubmodule)
{
@ -223,7 +223,7 @@ namespace SourceGit.Models
return;
}
}
}
}
_updateWC = DateTime.Now.AddSeconds(1).ToFileTime();
}

View file

@ -778,8 +778,8 @@ namespace SourceGit.ViewModels
public void RefreshSubmodules()
{
var submodules = new Commands.QuerySubmodules(_fullpath).Result();
if (_watcher != null)
_watcher.UpdateSubmodules(submodules);
if (_watcher != null)
_watcher.SetSubmodules(submodules);
Dispatcher.UIThread.Invoke(() => Submodules = submodules);
}

View file

@ -1238,7 +1238,7 @@ namespace SourceGit.ViewModels
App.RaiseException(_repo.FullPath, "Repository has unfinished job! Please wait!");
return;
}
if (string.IsNullOrWhiteSpace(_commitMessage))
{
App.RaiseException(_repo.FullPath, "Commit without message is NOT allowed!");
@ -1264,7 +1264,7 @@ namespace SourceGit.ViewModels
}
}
}
IsCommitting = true;
_repo.Settings.PushCommitMessage(_commitMessage);
_repo.SetWatcherEnabled(false);

View file

@ -523,9 +523,9 @@ namespace SourceGit.Views
private void OnCommitDataGridKeyDown(object sender, KeyEventArgs e)
{
if (sender is DataGrid grid &&
grid.SelectedItems is { Count: > 0 } selected &&
e.Key == Key.C &&
if (sender is DataGrid grid &&
grid.SelectedItems is { Count: > 0 } selected &&
e.Key == Key.C &&
e.KeyModifiers.HasFlag(KeyModifiers.Control))
{
var builder = new StringBuilder();

View file

@ -43,7 +43,7 @@ namespace SourceGit.Views
private void OnRowHeaderDragOver(object sender, DragEventArgs e)
{
if (DataContext is ViewModels.InteractiveRebase vm &&
e.Data.Get("InteractiveRebaseItem") is ViewModels.InteractiveRebaseItem src &&
e.Data.Get("InteractiveRebaseItem") is ViewModels.InteractiveRebaseItem src &&
sender is Border { DataContext: ViewModels.InteractiveRebaseItem dst } border &&
src != dst)
{
@ -64,8 +64,8 @@ namespace SourceGit.Views
for (var i = srcIdx; i > dstIdx; i--)
vm.MoveItemUp(src);
}
}
}
e.Handled = true;
}
}

View file

@ -66,7 +66,7 @@ namespace SourceGit.Views
else
{
Text = string.Empty;
}
}
}
private void OnTextViewContextRequested(object sender, ContextRequestedEventArgs e)