mirror of
https://git.ryujinx.app/kenji-nx/ryujinx.git
synced 2025-12-16 13:37:03 +00:00
misc: chore: Use 'foreach' statement in place of Gommon ForEach in "delete all" mod manager crash fix
* Simplify statement for valid mod folder checking
This commit is contained in:
parent
d2a532f971
commit
f9780b33bb
1 changed files with 2 additions and 8 deletions
|
|
@ -4,7 +4,6 @@ using Avalonia.Controls.ApplicationLifetimes;
|
||||||
using Avalonia.Platform.Storage;
|
using Avalonia.Platform.Storage;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
using DynamicData;
|
using DynamicData;
|
||||||
using Gommon;
|
|
||||||
using Ryujinx.Ava.Common.Locale;
|
using Ryujinx.Ava.Common.Locale;
|
||||||
using Ryujinx.Ava.UI.Helpers;
|
using Ryujinx.Ava.UI.Helpers;
|
||||||
using Ryujinx.Ava.UI.Models;
|
using Ryujinx.Ava.UI.Models;
|
||||||
|
|
@ -261,12 +260,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
var destinationDir = ModLoader.GetApplicationDir(ModLoader.GetSdModsBasePath(), _applicationId.ToString("x16"));
|
var destinationDir = ModLoader.GetApplicationDir(ModLoader.GetSdModsBasePath(), _applicationId.ToString("x16"));
|
||||||
|
|
||||||
// TODO: More robust checking for valid mod folders
|
// TODO: More robust checking for valid mod folders
|
||||||
var isDirectoryValid = true;
|
var isDirectoryValid = directories.Length != 0;
|
||||||
|
|
||||||
if (directories.Length == 0)
|
|
||||||
{
|
|
||||||
isDirectoryValid = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isDirectoryValid)
|
if (!isDirectoryValid)
|
||||||
{
|
{
|
||||||
|
|
@ -324,7 +318,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
|
||||||
public void DeleteAll()
|
public void DeleteAll()
|
||||||
{
|
{
|
||||||
Mods.ForEach(it => Delete(it, false));
|
foreach (var it in Mods) Delete(it, false);
|
||||||
Mods.Clear();
|
Mods.Clear();
|
||||||
OnPropertyChanged(nameof(ModCount));
|
OnPropertyChanged(nameof(ModCount));
|
||||||
Sort();
|
Sort();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue