This commit is contained in:
Xpl0itR 2020-02-07 18:14:28 +00:00
commit 2894c6bca1
No known key found for this signature in database
GPG key ID: 91798184109676AD

View file

@ -22,6 +22,8 @@ namespace Ryujinx.Ui
{ {
public class GameTableContextMenu : Menu public class GameTableContextMenu : Menu
{ {
public static Result OperationCancelled = new Result(468, 1357);
private ListStore _gameTableStore; private ListStore _gameTableStore;
private TreeIter _rowIter; private TreeIter _rowIter;
private VirtualFileSystem _virtualFileSystem; private VirtualFileSystem _virtualFileSystem;
@ -250,8 +252,8 @@ namespace Ryujinx.Ui
FileSystemClient fsClient = _virtualFileSystem.FsClient; FileSystemClient fsClient = _virtualFileSystem.FsClient;
string source = new Random().Next(0, 999999999).ToString(); string source = DateTime.Now.ToFileTime().ToString().Substring(10);
string output = new Random().Next(0, 999999999).ToString(); string output = DateTime.Now.ToFileTime().ToString().Substring(10);
fsClient.Register(source.ToU8Span(), ncaFileSystem); fsClient.Register(source.ToU8Span(), ncaFileSystem);
fsClient.Register(output.ToU8Span(), new LocalFileSystem(destination)); fsClient.Register(output.ToU8Span(), new LocalFileSystem(destination));
@ -260,7 +262,7 @@ namespace Ryujinx.Ui
if (resultCode.IsFailure()) if (resultCode.IsFailure())
{ {
if (resultCode.ErrorCode != "2468-1357") if (resultCode != OperationCancelled)
{ {
Logger.PrintError(LogClass.Application, $"LibHac returned error code: {resultCode.ErrorCode}"); Logger.PrintError(LogClass.Application, $"LibHac returned error code: {resultCode.ErrorCode}");
@ -311,7 +313,10 @@ namespace Ryujinx.Ui
{ {
foreach (DirectoryEntryEx entry in fs.EnumerateEntries(sourcePath, "*", SearchOptions.Default)) foreach (DirectoryEntryEx entry in fs.EnumerateEntries(sourcePath, "*", SearchOptions.Default))
{ {
if (_cancel) return new Result(468, 1357); if (_cancel)
{
return OperationCancelled;
}
string subSrcPath = PathTools.Normalize(PathTools.Combine(sourcePath, entry.Name)); string subSrcPath = PathTools.Normalize(PathTools.Combine(sourcePath, entry.Name));
string subDstPath = PathTools.Normalize(PathTools.Combine(destPath, entry.Name)); string subDstPath = PathTools.Normalize(PathTools.Combine(destPath, entry.Name));