mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
code_review: PR #480
* remove `string.IsNullOrEmpty(OS.ShellOrTerminal)` checking from detail backend since it has been checked by `Native.OS.OpenTerminal` * remove `ViewModels.Preference.IsTerminalConfigured` because it is only used by itself (Unlike `IsGitConfigured`). * add `Native.OS.TestShellOrTerminal` and use it instead of setting `Preference.ShellOrTerminal` directly, because we have binded a callback that will save preference into file when its property changed. It may cause lag in some enviroments if we saving preference into file too frequently (see PR #436). * run `dotnet format`
This commit is contained in:
parent
65c2087f6b
commit
bc633e4085
5 changed files with 44 additions and 61 deletions
|
@ -74,12 +74,17 @@ namespace SourceGit.Native
|
|||
return _backend.FindGitExecutable();
|
||||
}
|
||||
|
||||
public static void SetShellOrTerminal(Models.ShellOrTerminal shellOrTerminal)
|
||||
public static bool TestShellOrTerminal(Models.ShellOrTerminal shell)
|
||||
{
|
||||
if (shellOrTerminal == null)
|
||||
return !string.IsNullOrEmpty(_backend.FindTerminal(shell));
|
||||
}
|
||||
|
||||
public static void SetShellOrTerminal(Models.ShellOrTerminal shell)
|
||||
{
|
||||
if (shell == null)
|
||||
ShellOrTerminal = string.Empty;
|
||||
else
|
||||
ShellOrTerminal = _backend.FindTerminal(shellOrTerminal);
|
||||
ShellOrTerminal = _backend.FindTerminal(shell);
|
||||
}
|
||||
|
||||
public static void OpenInFileManager(string path, bool select = false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue