misc: chore: Fix object creation in Avalonia project

This commit is contained in:
Evan Husted 2025-01-26 15:16:50 -06:00
parent 5f023ca49b
commit 3cdaaa0b69
25 changed files with 63 additions and 63 deletions

View file

@ -1802,7 +1802,7 @@ namespace Ryujinx.Ava.UI.ViewModels
return;
}
XCIFileTrimmer trimmer = new XCIFileTrimmer(filename, new XCITrimmerLog.MainWindow(this));
XCIFileTrimmer trimmer = new(filename, new XCITrimmerLog.MainWindow(this));
if (trimmer.CanBeTrimmed)
{

View file

@ -82,13 +82,13 @@ namespace Ryujinx.Ava.UI.ViewModels
foreach (string path in modsBasePaths)
{
bool inSd = path == ModLoader.GetSdModsBasePath();
ModLoader.ModCache modCache = new ModLoader.ModCache();
ModLoader.ModCache modCache = new();
ModLoader.QueryContentsDir(modCache, new DirectoryInfo(Path.Combine(path, "contents")), applicationId);
foreach (ModLoader.Mod<DirectoryInfo> mod in modCache.RomfsDirs)
{
ModModel modModel = new ModModel(mod.Path.Parent.FullName, mod.Name, mod.Enabled, inSd);
ModModel modModel = new(mod.Path.Parent.FullName, mod.Name, mod.Enabled, inSd);
if (Mods.All(x => x.Path != mod.Path.Parent.FullName))
{
Mods.Add(modModel);
@ -102,7 +102,7 @@ namespace Ryujinx.Ava.UI.ViewModels
foreach (ModLoader.Mod<DirectoryInfo> mod in modCache.ExefsDirs)
{
ModModel modModel = new ModModel(mod.Path.Parent.FullName, mod.Name, mod.Enabled, inSd);
ModModel modModel = new(mod.Path.Parent.FullName, mod.Name, mod.Enabled, inSd);
if (Mods.All(x => x.Path != mod.Path.Parent.FullName))
{
Mods.Add(modModel);

View file

@ -104,7 +104,7 @@ namespace Ryujinx.Ava.UI.ViewModels
// TODO: Parse DatabaseInfo.bin and table.bin files for more accuracy.
if (item.Type == DirectoryEntryType.File && item.FullPath.Contains("chara") && item.FullPath.Contains("szs"))
{
using UniqueRef<IFile> file = new UniqueRef<IFile>();
using UniqueRef<IFile> file = new();
romfs.OpenFile(ref file.Ref, ("/" + item.FullPath).ToU8Span(), OpenMode.Read).ThrowIfFailure();

View file

@ -183,7 +183,7 @@ namespace Ryujinx.Ava.UI.ViewModels
if (cancellationToken.IsCancellationRequested)
break;
XCIFileTrimmer trimmer = new XCIFileTrimmer(xciApp.Path, _logger);
XCIFileTrimmer trimmer = new(xciApp.Path, _logger);
Dispatcher.UIThread.Post(() =>
{