Move SetCoreDumpable call to StorageProviderExtensions

This commit is contained in:
KeatonTheBot
2026-03-06 18:13:04 -06:00
parent 72c187a4b8
commit c47219558e
8 changed files with 23 additions and 119 deletions

View File

@@ -1299,8 +1299,6 @@ namespace Ryujinx.Ava.UI.ViewModels
private async Task LoadContentFromFolder(LocaleKeys localeMessageAddedKey, LocaleKeys localeMessageRemovedKey,
LoadContentFromFolderDelegate onDirsSelected, LocaleKeys dirSelectDialogTitle)
{
OsUtils.SetCoreDumpable(true);
Optional<IReadOnlyList<IStorageFolder>> result =
await StorageProvider.OpenMultiFolderPickerAsync(
new FolderPickerOpenOptions { Title = LocaleManager.Instance[dirSelectDialogTitle] });
@@ -1328,11 +1326,6 @@ namespace Ryujinx.Ava.UI.ViewModels
(int)Symbol.Checkmark);
});
}
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
}
#endregion
@@ -1395,8 +1388,6 @@ namespace Ryujinx.Ava.UI.ViewModels
public async Task InstallFirmwareFromFile()
{
OsUtils.SetCoreDumpable(true);
Optional<IStorageFile> result = await StorageProvider.OpenSingleFilePickerAsync(new FilePickerOpenOptions
{
FileTypeFilter = new List<FilePickerFileType>
@@ -1426,34 +1417,20 @@ namespace Ryujinx.Ava.UI.ViewModels
{
await HandleFirmwareInstallation(result.Value.Path.LocalPath);
}
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
}
public async Task InstallFirmwareFromFolder()
{
OsUtils.SetCoreDumpable(true);
Optional<IStorageFolder> result = await StorageProvider.OpenSingleFolderPickerAsync();
if (result.HasValue)
{
await HandleFirmwareInstallation(result.Value.Path.LocalPath);
}
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
}
public async Task InstallKeysFromFile()
{
OsUtils.SetCoreDumpable(true);
Optional<IStorageFile> result = await StorageProvider.OpenSingleFilePickerAsync(new FilePickerOpenOptions
{
FileTypeFilter = new List<FilePickerFileType>
@@ -1471,28 +1448,16 @@ namespace Ryujinx.Ava.UI.ViewModels
{
await HandleKeysInstallation(result.Value.Path.LocalPath);
}
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
}
public async Task InstallKeysFromFolder()
{
OsUtils.SetCoreDumpable(true);
Optional<IStorageFolder> result = await StorageProvider.OpenSingleFolderPickerAsync();
if (result.HasValue)
{
await HandleKeysInstallation(result.Value.Path.LocalPath);
}
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
}
public void OpenRyujinxFolder()
@@ -1596,8 +1561,6 @@ namespace Ryujinx.Ava.UI.ViewModels
public async Task OpenFile()
{
OsUtils.SetCoreDumpable(true);
Optional<IStorageFile> result = await StorageProvider.OpenSingleFilePickerAsync(new FilePickerOpenOptions
{
Title = LocaleManager.Instance[LocaleKeys.LoadApplicationFromFileDialogTitle],
@@ -1669,11 +1632,6 @@ namespace Ryujinx.Ava.UI.ViewModels
LocaleManager.Instance[LocaleKeys.MenuBarFileOpenFromFileError]);
}
}
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
}
public async Task LoadDlcFromFolder()
@@ -1696,8 +1654,6 @@ namespace Ryujinx.Ava.UI.ViewModels
public async Task OpenFolder()
{
OsUtils.SetCoreDumpable(true);
Optional<IStorageFolder> result = await StorageProvider.OpenSingleFolderPickerAsync(
new FolderPickerOpenOptions
{
@@ -1713,11 +1669,6 @@ namespace Ryujinx.Ava.UI.ViewModels
await LoadApplication(applicationData);
}
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
}
public static bool InitializeUserConfig(ApplicationData application)
@@ -1925,8 +1876,6 @@ namespace Ryujinx.Ava.UI.ViewModels
public async Task OpenBinFile()
{
OsUtils.SetCoreDumpable(true);
if (AppHost.Device.System.SearchingForAmiibo(out _) && IsGameRunning)
{
Optional<IStorageFile> result = await StorageProvider.OpenSingleFilePickerAsync(
@@ -1946,11 +1895,6 @@ namespace Ryujinx.Ava.UI.ViewModels
{
AppHost.Device.System.ScanAmiiboFromBin(result.Value.Path.LocalPath);
}
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
}
}
public async Task OpenSkylanderWindow()