Skip to content

Commit

Permalink
Merge remote-tracking branch 'gumbarros/await-foreach' into await-for…
Browse files Browse the repository at this point in the history
…each
  • Loading branch information
gumbarros committed Apr 13, 2024
2 parents 2a3f706 + f7f2785 commit 37d4c59
Show file tree
Hide file tree
Showing 154 changed files with 1,764 additions and 535 deletions.
2 changes: 1 addition & 1 deletion .github/README.md
Expand Up @@ -23,7 +23,7 @@ Files also offers advanced features such as file tagging for easy organization,
- MSVC v143 - VS 2022 C++ x64/x86 or ARM64 build tools (latest)
- C++ ATL for latest v143 build tools (x86 & x64 or ARM64)
- Git for Windows
- [Windows App SDK 1.4](https://learn.microsoft.com/windows/apps/windows-app-sdk/downloads#current-releases)
- [Windows App SDK 1.5](https://learn.microsoft.com/windows/apps/windows-app-sdk/downloads#current-releases)

### 2. Clone the repository

Expand Down
2 changes: 1 addition & 1 deletion src/Files.App (Package)/Files.Package.wapproj
Expand Up @@ -107,7 +107,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240311000" IncludeAssets="build" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240404000" IncludeAssets="build" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.3233" IncludeAssets="build" />
</ItemGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App.Server/Database/FileTagsDatabase.cs
Expand Up @@ -162,9 +162,9 @@ public void UpdateTag(ulong oldFrn, ulong? frn, string? newFilePath)
}
}

public string[]? GetTags(string? filePath, ulong? frn)
public string[] GetTags(string? filePath, ulong? frn)
{
return FindTag(filePath, frn)?.Tags;
return FindTag(filePath, frn)?.Tags ?? [];
}

public IEnumerable<TaggedFile> GetAll()
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App.Storage/FtpStorage/FtpManager.cs
Expand Up @@ -8,7 +8,7 @@ namespace Files.App.Storage.FtpStorage
{
public static class FtpManager
{
public static readonly Dictionary<string, NetworkCredential> Credentials = new();
public static readonly Dictionary<string, NetworkCredential> Credentials = [];

public static readonly NetworkCredential Anonymous = new("anonymous", "anonymous");
}
Expand Down
Expand Up @@ -40,7 +40,7 @@ protected override void Context_PropertyChanged(object? sender, PropertyChangedE
private string ComputeLabel()
{
if (context.SelectedItems == null || context.SelectedItems.Count == 0)
return string.Empty;
return string.Format("BaseLayoutItemContextFlyoutExtractToChildFolder".GetLocalizedResource(), string.Empty);

return context.SelectedItems.Count > 1
? string.Format("BaseLayoutItemContextFlyoutExtractToChildFolder".GetLocalizedResource(), "*")
Expand Down
Expand Up @@ -19,7 +19,7 @@ public RichGlyph Glyph
=> new RichGlyph(opacityStyle: "ColorIconCopyPath");

public HotKey HotKey
=> new(Keys.C, KeyModifiers.MenuCtrl);
=> new(Keys.C, KeyModifiers.CtrlAlt);

public bool IsExecutable
=> context.HasSelection;
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Actions/FileSystem/OpenFileLocationAction.cs
Expand Up @@ -49,7 +49,7 @@ public async Task ExecuteAsync()
context.ShellPage?.NavigateWithArguments(context.ShellPage.InstanceViewModel.FolderSettings.GetLayoutType(folderPath), new NavigationArguments()
{
NavPathParam = folderPath,
SelectItems = new[] { Path.GetFileName(item.TargetPath.TrimPath()) },
SelectItems = [Path.GetFileName(item.TargetPath.TrimPath())],
AssociatedTabInstance = context.ShellPage
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Actions/FileSystem/OpenItemAction.cs
Expand Up @@ -132,7 +132,7 @@ public async Task ExecuteAsync()
context.ShellPage.NavigateWithArguments(context.ShellPage.InstanceViewModel.FolderSettings.GetLayoutType(folderPath), new NavigationArguments()
{
NavPathParam = folderPath,
SelectItems = new[] { item.ItemNameRaw },
SelectItems = [item.ItemNameRaw],
AssociatedTabInstance = context.ShellPage
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Global/EditPathAction.cs
Expand Up @@ -17,7 +17,7 @@ public HotKey HotKey
=> new(Keys.L, KeyModifiers.Ctrl);

public HotKey SecondHotKey
=> new(Keys.D, KeyModifiers.Menu);
=> new(Keys.D, KeyModifiers.Alt);

public EditPathAction()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Global/EnterCompactOverlayAction.cs
Expand Up @@ -17,7 +17,7 @@ public RichGlyph Glyph
=> new(opacityStyle: "ColorIconEnterCompactOverlay");

public HotKey HotKey
=> new(Keys.Up, KeyModifiers.MenuCtrl);
=> new(Keys.Up, KeyModifiers.CtrlAlt);

public string Description
=> "EnterCompactOverlayDescription".GetLocalizedResource();
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Global/ExitCompactOverlayAction.cs
Expand Up @@ -16,7 +16,7 @@ public RichGlyph Glyph
=> new(opacityStyle: "ColorIconExitCompactOverlay");

public HotKey HotKey
=> new(Keys.Down, KeyModifiers.MenuCtrl);
=> new(Keys.Down, KeyModifiers.CtrlAlt);

public string Description
=> "ExitCompactOverlayDescription".GetLocalizedResource();
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/Actions/Navigation/NavigateBackAction.cs
Expand Up @@ -14,7 +14,7 @@ public string Description
=> "NavigateBackDescription".GetLocalizedResource();

public HotKey HotKey
=> new(Keys.Left, KeyModifiers.Menu);
=> new(Keys.Left, KeyModifiers.Alt);

public HotKey SecondHotKey
=> new(Keys.Back);
Expand All @@ -23,7 +23,7 @@ public HotKey ThirdHotKey
=> new(Keys.Mouse4);

public HotKey MediaHotKey
=> new(Keys.GoBack, false);
=> new(Keys.GoBack, KeyModifiers.None, false);

public RichGlyph Glyph
=> new("\uE72B");
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/Actions/Navigation/NavigateForwardAction.cs
Expand Up @@ -14,13 +14,13 @@ public string Description
=> "NavigateForwardDescription".GetLocalizedResource();

public HotKey HotKey
=> new(Keys.Right, KeyModifiers.Menu);
=> new(Keys.Right, KeyModifiers.Alt);

public HotKey SecondHotKey
=> new(Keys.Mouse5);

public HotKey MediaHotKey
=> new(Keys.GoForward, false);
=> new(Keys.GoForward, KeyModifiers.None, false);

public RichGlyph Glyph
=> new("\uE72A");
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Navigation/NavigateUpAction.cs
Expand Up @@ -14,7 +14,7 @@ public string Description
=> "NavigateUpDescription".GetLocalizedResource();

public HotKey HotKey
=> new(Keys.Up, KeyModifiers.Menu);
=> new(Keys.Up, KeyModifiers.Alt);

public RichGlyph Glyph
=> new("\uE74A");
Expand Down
Expand Up @@ -18,7 +18,7 @@ public string Description
=> "OpenInNewWindowDescription".GetLocalizedResource();

public HotKey HotKey
=> new(Keys.Enter, KeyModifiers.MenuCtrl);
=> new(Keys.Enter, KeyModifiers.CtrlAlt);

public RichGlyph Glyph
=> new(opacityStyle: "ColorIconOpenInNewWindow");
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/Actions/Navigation/OpenNewPaneAction.cs
Expand Up @@ -14,10 +14,10 @@ public string Description
=> "OpenNewPaneDescription".GetLocalizedResource();

public HotKey HotKey
=> new(Keys.OemPlus, KeyModifiers.MenuShift);
=> new(Keys.OemPlus, KeyModifiers.AltShift);

public HotKey SecondHotKey
=> new(Keys.Add, KeyModifiers.MenuShift);
=> new(Keys.Add, KeyModifiers.AltShift);

public RichGlyph Glyph
=> new(opacityStyle: "ColorIconOpenNewPane");
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Open/OpenPropertiesAction.cs
Expand Up @@ -17,7 +17,7 @@ public RichGlyph Glyph
=> new(opacityStyle: "ColorIconProperties");

public HotKey HotKey
=> new(Keys.Enter, KeyModifiers.Menu);
=> new(Keys.Enter, KeyModifiers.Alt);

public bool IsExecutable =>
context.PageType is not ContentPageTypes.Home &&
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/Actions/Open/OpenTerminalAction.cs
Expand Up @@ -85,10 +85,10 @@ protected string[] GetPaths()
}
else if (context.Folder is not null)
{
return new string[1] { context.Folder.ItemPath };
return [context.Folder.ItemPath];
}

return Array.Empty<string>();
return [];
}

private bool GetIsExecutable()
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Show/ToggleDetailsPaneAction.cs
Expand Up @@ -18,7 +18,7 @@ public RichGlyph Glyph
=> new(opacityStyle: "ColorIconRightPane");

public HotKey HotKey
=> new(Keys.D, KeyModifiers.MenuCtrl);
=> new(Keys.D, KeyModifiers.CtrlAlt);

public bool IsOn
=> viewModel.IsEnabled;
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Show/ToggleInfoPaneAction.cs
Expand Up @@ -17,7 +17,7 @@ public RichGlyph Glyph
=> new(opacityStyle: "ColorIconRightPane");

public HotKey HotKey
=> new(Keys.I, KeyModifiers.MenuCtrl);
=> new(Keys.I, KeyModifiers.CtrlAlt);

public bool IsOn
=> viewModel.IsEnabled;
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Show/TogglePreviewPaneAction.cs
Expand Up @@ -18,7 +18,7 @@ public RichGlyph Glyph
=> new(opacityStyle: "ColorIconRightPane");

public HotKey HotKey
=> new(Keys.P, KeyModifiers.MenuCtrl);
=> new(Keys.P, KeyModifiers.CtrlAlt);

public bool IsOn
=> viewModel.IsEnabled;
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Sidebar/PinFolderToSidebarAction.cs
Expand Up @@ -47,7 +47,7 @@ public async Task ExecuteAsync()

private bool GetIsExecutable()
{
string[] pinnedFolders = App.QuickAccessManager.Model.PinnedFolders.ToArray();
string[] pinnedFolders = [.. App.QuickAccessManager.Model.PinnedFolders];

return context.HasSelection
? context.SelectedItems.All(IsPinnable)
Expand Down
Expand Up @@ -44,7 +44,7 @@ public async Task ExecuteAsync()

private bool GetIsExecutable()
{
string[] pinnedFolders = App.QuickAccessManager.Model.PinnedFolders.ToArray();
string[] pinnedFolders = [.. App.QuickAccessManager.Model.PinnedFolders];

return context.HasSelection
? context.SelectedItems.All(IsPinned)
Expand Down

0 comments on commit 37d4c59

Please sign in to comment.