Move SetCoreDumpable call to StorageProviderExtensions

This commit is contained in:
KeatonTheBot
2026-03-06 18:13:04 -06:00
committed by sh0inx
parent 9a2df6451c
commit b36667e216
7 changed files with 0 additions and 110 deletions

View File

@@ -18,7 +18,6 @@ using Ryujinx.Ava.UI.Windows;
using Ryujinx.Ava.Utilities; using Ryujinx.Ava.Utilities;
using Ryujinx.Common.Helper; using Ryujinx.Common.Helper;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.Common.Utilities;
using Ryujinx.HLE.FileSystem; using Ryujinx.HLE.FileSystem;
using Ryujinx.HLE.HOS.Services.Account.Acc; using Ryujinx.HLE.HOS.Services.Account.Acc;
using Ryujinx.HLE.Loaders.Processes.Extensions; using Ryujinx.HLE.Loaders.Processes.Extensions;
@@ -411,8 +410,6 @@ namespace Ryujinx.Ava.Common
public static async Task ExtractAoc(IStorageProvider storageProvider, string updateFilePath, string updateName) public static async Task ExtractAoc(IStorageProvider storageProvider, string updateFilePath, string updateName)
{ {
OsUtils.SetCoreDumpable(true);
Gommon.Optional<IStorageFolder> result = await storageProvider.OpenSingleFolderPickerAsync(new FolderPickerOpenOptions Gommon.Optional<IStorageFolder> result = await storageProvider.OpenSingleFolderPickerAsync(new FolderPickerOpenOptions
{ {
Title = LocaleManager.Instance[LocaleKeys.FolderDialogExtractTitle] Title = LocaleManager.Instance[LocaleKeys.FolderDialogExtractTitle]
@@ -422,17 +419,10 @@ namespace Ryujinx.Ava.Common
return; return;
ExtractAoc(result.Value.Path.LocalPath, updateFilePath, updateName); ExtractAoc(result.Value.Path.LocalPath, updateFilePath, updateName);
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
} }
public static async Task ExtractSection(IStorageProvider storageProvider, NcaSectionType ncaSectionType, string titleFilePath, string titleName, int programIndex = 0) public static async Task ExtractSection(IStorageProvider storageProvider, NcaSectionType ncaSectionType, string titleFilePath, string titleName, int programIndex = 0)
{ {
OsUtils.SetCoreDumpable(true);
Gommon.Optional<IStorageFolder> result = await storageProvider.OpenSingleFolderPickerAsync(new FolderPickerOpenOptions Gommon.Optional<IStorageFolder> result = await storageProvider.OpenSingleFolderPickerAsync(new FolderPickerOpenOptions
{ {
Title = LocaleManager.Instance[LocaleKeys.FolderDialogExtractTitle] Title = LocaleManager.Instance[LocaleKeys.FolderDialogExtractTitle]
@@ -442,11 +432,6 @@ namespace Ryujinx.Ava.Common
return; return;
ExtractSection(result.Value.Path.LocalPath, ncaSectionType, titleFilePath, titleName, programIndex); ExtractSection(result.Value.Path.LocalPath, ncaSectionType, titleFilePath, titleName, programIndex);
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
} }
public static (Result? result, bool canceled) CopyDirectory(FileSystemClient fs, string sourcePath, string destPath, CancellationToken token) public static (Result? result, bool canceled) CopyDirectory(FileSystemClient fs, string sourcePath, string destPath, CancellationToken token)

View File

@@ -8,7 +8,6 @@ using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.Common.Models; using Ryujinx.Ava.Common.Models;
using Ryujinx.Ava.Systems.AppLibrary; using Ryujinx.Ava.Systems.AppLibrary;
using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Common.Utilities;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.IO; using System.IO;
@@ -129,8 +128,6 @@ namespace Ryujinx.Ava.UI.ViewModels
public async void Add() public async void Add()
{ {
OsUtils.SetCoreDumpable(true);
IReadOnlyList<IStorageFile> result = await _storageProvider.OpenFilePickerAsync(new FilePickerOpenOptions IReadOnlyList<IStorageFile> result = await _storageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
{ {
Title = LocaleManager.Instance[LocaleKeys.SelectDlcDialogTitle], Title = LocaleManager.Instance[LocaleKeys.SelectDlcDialogTitle],
@@ -161,11 +158,6 @@ namespace Ryujinx.Ava.UI.ViewModels
{ {
await ShowNewDlcAddedDialog(totalDlcAdded); await ShowNewDlcAddedDialog(totalDlcAdded);
} }
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
} }
private bool AddDownloadableContent(string path, out int numDlcAdded) private bool AddDownloadableContent(string path, out int numDlcAdded)

View File

@@ -1323,8 +1323,6 @@ namespace Ryujinx.Ava.UI.ViewModels
private async Task LoadContentFromFolder(LocaleKeys localeMessageAddedKey, LocaleKeys localeMessageRemovedKey, private async Task LoadContentFromFolder(LocaleKeys localeMessageAddedKey, LocaleKeys localeMessageRemovedKey,
LoadContentFromFolderDelegate onDirsSelected, LocaleKeys dirSelectDialogTitle) LoadContentFromFolderDelegate onDirsSelected, LocaleKeys dirSelectDialogTitle)
{ {
OsUtils.SetCoreDumpable(true);
Optional<IReadOnlyList<IStorageFolder>> result = Optional<IReadOnlyList<IStorageFolder>> result =
await StorageProvider.OpenMultiFolderPickerAsync( await StorageProvider.OpenMultiFolderPickerAsync(
new FolderPickerOpenOptions { Title = LocaleManager.Instance[dirSelectDialogTitle] }); new FolderPickerOpenOptions { Title = LocaleManager.Instance[dirSelectDialogTitle] });
@@ -1352,11 +1350,6 @@ namespace Ryujinx.Ava.UI.ViewModels
(int)Symbol.Checkmark); (int)Symbol.Checkmark);
}); });
} }
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
} }
#endregion #endregion
@@ -1419,8 +1412,6 @@ namespace Ryujinx.Ava.UI.ViewModels
public async Task InstallFirmwareFromFile() public async Task InstallFirmwareFromFile()
{ {
OsUtils.SetCoreDumpable(true);
Optional<IStorageFile> result = await StorageProvider.OpenSingleFilePickerAsync(new FilePickerOpenOptions Optional<IStorageFile> result = await StorageProvider.OpenSingleFilePickerAsync(new FilePickerOpenOptions
{ {
FileTypeFilter = new List<FilePickerFileType> FileTypeFilter = new List<FilePickerFileType>
@@ -1450,34 +1441,20 @@ namespace Ryujinx.Ava.UI.ViewModels
{ {
await HandleFirmwareInstallation(result.Value.Path.LocalPath); await HandleFirmwareInstallation(result.Value.Path.LocalPath);
} }
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
} }
public async Task InstallFirmwareFromFolder() public async Task InstallFirmwareFromFolder()
{ {
OsUtils.SetCoreDumpable(true);
Optional<IStorageFolder> result = await StorageProvider.OpenSingleFolderPickerAsync(); Optional<IStorageFolder> result = await StorageProvider.OpenSingleFolderPickerAsync();
if (result.HasValue) if (result.HasValue)
{ {
await HandleFirmwareInstallation(result.Value.Path.LocalPath); await HandleFirmwareInstallation(result.Value.Path.LocalPath);
} }
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
} }
public async Task InstallKeysFromFile() public async Task InstallKeysFromFile()
{ {
OsUtils.SetCoreDumpable(true);
Optional<IStorageFile> result = await StorageProvider.OpenSingleFilePickerAsync(new FilePickerOpenOptions Optional<IStorageFile> result = await StorageProvider.OpenSingleFilePickerAsync(new FilePickerOpenOptions
{ {
FileTypeFilter = new List<FilePickerFileType> FileTypeFilter = new List<FilePickerFileType>
@@ -1495,28 +1472,16 @@ namespace Ryujinx.Ava.UI.ViewModels
{ {
await HandleKeysInstallation(result.Value.Path.LocalPath); await HandleKeysInstallation(result.Value.Path.LocalPath);
} }
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
} }
public async Task InstallKeysFromFolder() public async Task InstallKeysFromFolder()
{ {
OsUtils.SetCoreDumpable(true);
Optional<IStorageFolder> result = await StorageProvider.OpenSingleFolderPickerAsync(); Optional<IStorageFolder> result = await StorageProvider.OpenSingleFolderPickerAsync();
if (result.HasValue) if (result.HasValue)
{ {
await HandleKeysInstallation(result.Value.Path.LocalPath); await HandleKeysInstallation(result.Value.Path.LocalPath);
} }
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
} }
public void OpenRyujinxFolder() public void OpenRyujinxFolder()
@@ -1620,8 +1585,6 @@ namespace Ryujinx.Ava.UI.ViewModels
public async Task OpenFile() public async Task OpenFile()
{ {
OsUtils.SetCoreDumpable(true);
Optional<IStorageFile> result = await StorageProvider.OpenSingleFilePickerAsync(new FilePickerOpenOptions Optional<IStorageFile> result = await StorageProvider.OpenSingleFilePickerAsync(new FilePickerOpenOptions
{ {
Title = LocaleManager.Instance[LocaleKeys.LoadApplicationFromFileDialogTitle], Title = LocaleManager.Instance[LocaleKeys.LoadApplicationFromFileDialogTitle],
@@ -1693,11 +1656,6 @@ namespace Ryujinx.Ava.UI.ViewModels
LocaleManager.Instance[LocaleKeys.MenuBarFileOpenFromFileError]); LocaleManager.Instance[LocaleKeys.MenuBarFileOpenFromFileError]);
} }
} }
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
} }
public async Task LoadDlcFromFolder() public async Task LoadDlcFromFolder()
@@ -1720,8 +1678,6 @@ namespace Ryujinx.Ava.UI.ViewModels
public async Task OpenFolder() public async Task OpenFolder()
{ {
OsUtils.SetCoreDumpable(true);
Optional<IStorageFolder> result = await StorageProvider.OpenSingleFolderPickerAsync( Optional<IStorageFolder> result = await StorageProvider.OpenSingleFolderPickerAsync(
new FolderPickerOpenOptions new FolderPickerOpenOptions
{ {
@@ -1737,11 +1693,6 @@ namespace Ryujinx.Ava.UI.ViewModels
await LoadApplication(applicationData); await LoadApplication(applicationData);
} }
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
} }
public static bool InitializeUserConfig(ApplicationData application) public static bool InitializeUserConfig(ApplicationData application)
@@ -1949,8 +1900,6 @@ namespace Ryujinx.Ava.UI.ViewModels
public async Task OpenBinFile() public async Task OpenBinFile()
{ {
OsUtils.SetCoreDumpable(true);
if (AppHost.Device.System.SearchingForAmiibo(out _) && IsGameRunning) if (AppHost.Device.System.SearchingForAmiibo(out _) && IsGameRunning)
{ {
Optional<IStorageFile> result = await StorageProvider.OpenSingleFilePickerAsync( Optional<IStorageFile> result = await StorageProvider.OpenSingleFilePickerAsync(
@@ -1970,11 +1919,6 @@ namespace Ryujinx.Ava.UI.ViewModels
{ {
AppHost.Device.System.ScanAmiiboFromBin(result.Value.Path.LocalPath); AppHost.Device.System.ScanAmiiboFromBin(result.Value.Path.LocalPath);
} }
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
} }
} }
public async Task OpenSkylanderWindow() public async Task OpenSkylanderWindow()

View File

@@ -288,8 +288,6 @@ namespace Ryujinx.Ava.UI.ViewModels
public async void Add() public async void Add()
{ {
OsUtils.SetCoreDumpable(true);
IReadOnlyList<IStorageFolder> result = await _storageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions IReadOnlyList<IStorageFolder> result = await _storageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
{ {
Title = LocaleManager.Instance[LocaleKeys.SelectModDialogTitle], Title = LocaleManager.Instance[LocaleKeys.SelectModDialogTitle],
@@ -300,11 +298,6 @@ namespace Ryujinx.Ava.UI.ViewModels
{ {
AddMod(new DirectoryInfo(folder.Path.LocalPath)); AddMod(new DirectoryInfo(folder.Path.LocalPath));
} }
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
} }
public void DeleteAll() public void DeleteAll()

View File

@@ -7,7 +7,6 @@ using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.Common.Models; using Ryujinx.Ava.Common.Models;
using Ryujinx.Ava.Systems.AppLibrary; using Ryujinx.Ava.Systems.AppLibrary;
using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Common.Utilities;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@@ -149,8 +148,6 @@ namespace Ryujinx.Ava.UI.ViewModels
public async Task Add() public async Task Add()
{ {
OsUtils.SetCoreDumpable(true);
IReadOnlyList<IStorageFile> result = await _storageProvider.OpenFilePickerAsync(new FilePickerOpenOptions IReadOnlyList<IStorageFile> result = await _storageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
{ {
AllowMultiple = true, AllowMultiple = true,
@@ -180,11 +177,6 @@ namespace Ryujinx.Ava.UI.ViewModels
{ {
await ShowNewUpdatesAddedDialog(totalUpdatesAdded); await ShowNewUpdatesAddedDialog(totalUpdatesAdded);
} }
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
} }
public void Save() public void Save()

View File

@@ -7,7 +7,6 @@ using Ryujinx.Ava.UI.Controls;
using Ryujinx.Ava.UI.Helpers; using Ryujinx.Ava.UI.Helpers;
using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Ava.UI.ViewModels;
using Ryujinx.Ava.Utilities; using Ryujinx.Ava.Utilities;
using Ryujinx.Common.Utilities;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@@ -28,8 +27,6 @@ namespace Ryujinx.Ava.UI.Views.Settings
private async Task AddDirButton(TextBox addDirBox, AvaloniaList<string> directories) private async Task AddDirButton(TextBox addDirBox, AvaloniaList<string> directories)
{ {
OsUtils.SetCoreDumpable(true);
string path = addDirBox.Text; string path = addDirBox.Text;
if (!string.IsNullOrWhiteSpace(path) && Directory.Exists(path) && !directories.Contains(path)) if (!string.IsNullOrWhiteSpace(path) && Directory.Exists(path) && !directories.Contains(path))
@@ -51,11 +48,6 @@ namespace Ryujinx.Ava.UI.Views.Settings
ViewModel.GameListNeedsRefresh = true; ViewModel.GameListNeedsRefresh = true;
} }
} }
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
} }
private void RemoveGameDirButton_OnClick(object sender, RoutedEventArgs e) private void RemoveGameDirButton_OnClick(object sender, RoutedEventArgs e)

View File

@@ -8,7 +8,6 @@ using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.Controls; using Ryujinx.Ava.UI.Controls;
using Ryujinx.Ava.UI.Models; using Ryujinx.Ava.UI.Models;
using Ryujinx.Ava.UI.ViewModels; using Ryujinx.Ava.UI.ViewModels;
using Ryujinx.Common.Utilities;
using Ryujinx.HLE.FileSystem; using Ryujinx.HLE.FileSystem;
using SkiaSharp; using SkiaSharp;
using System.Collections.Generic; using System.Collections.Generic;
@@ -63,8 +62,6 @@ namespace Ryujinx.Ava.UI.Views.User
private async void Import_OnClick(object sender, RoutedEventArgs e) private async void Import_OnClick(object sender, RoutedEventArgs e)
{ {
OsUtils.SetCoreDumpable(true);
IReadOnlyList<IStorageFile> result = await ((Window)this.GetVisualRoot()!).StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions IReadOnlyList<IStorageFile> result = await ((Window)this.GetVisualRoot()!).StorageProvider.OpenFilePickerAsync(new FilePickerOpenOptions
{ {
AllowMultiple = false, AllowMultiple = false,
@@ -84,11 +81,6 @@ namespace Ryujinx.Ava.UI.Views.User
_profile.Image = ProcessProfileImage(File.ReadAllBytes(result[0].Path.LocalPath)); _profile.Image = ProcessProfileImage(File.ReadAllBytes(result[0].Path.LocalPath));
_parent.GoBack(); _parent.GoBack();
} }
if (!Program.CoreDumpArg)
{
OsUtils.SetCoreDumpable(false);
}
} }
private void GoBack(object sender, RoutedEventArgs e) private void GoBack(object sender, RoutedEventArgs e)