mirror of
https://github.com/claunia/romrepomgr.git
synced 2025-12-16 19:24:51 +00:00
[Refactor] Replace OrderBy with Order for file sorting in ImportDatFolderViewModel and FileImporter
This commit is contained in:
@@ -77,7 +77,7 @@ public class FileImporter
|
|||||||
Message = Localization.EnumeratingFiles
|
Message = Localization.EnumeratingFiles
|
||||||
});
|
});
|
||||||
|
|
||||||
string[] files = Directory.GetFiles(path, "*", SearchOption.AllDirectories).OrderBy(p => p).ToArray();
|
string[] files = Directory.GetFiles(path, "*", SearchOption.AllDirectories).Order().ToArray();
|
||||||
_totalFiles += files.LongLength;
|
_totalFiles += files.LongLength;
|
||||||
|
|
||||||
SetProgressBounds?.Invoke(this,
|
SetProgressBounds?.Invoke(this,
|
||||||
|
|||||||
@@ -231,12 +231,13 @@ public sealed class ImportDatFolderViewModel : ViewModelBase
|
|||||||
|
|
||||||
if(_allFilesChecked)
|
if(_allFilesChecked)
|
||||||
{
|
{
|
||||||
_datFiles = Directory
|
_datFiles = Directory.GetFiles(FolderPath,
|
||||||
.GetFiles(FolderPath,
|
"*.*",
|
||||||
"*.*",
|
_recursiveChecked
|
||||||
_recursiveChecked ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly)
|
? SearchOption.AllDirectories
|
||||||
.OrderBy(f => f)
|
: SearchOption.TopDirectoryOnly)
|
||||||
.ToArray();
|
.Order()
|
||||||
|
.ToArray();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -252,7 +253,7 @@ public sealed class ImportDatFolderViewModel : ViewModelBase
|
|||||||
? SearchOption.AllDirectories
|
? SearchOption.AllDirectories
|
||||||
: SearchOption.TopDirectoryOnly);
|
: SearchOption.TopDirectoryOnly);
|
||||||
|
|
||||||
_datFiles = dats.Concat(xmls).OrderBy(f => f).ToArray();
|
_datFiles = dats.Concat(xmls).Order().ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
Dispatcher.UIThread.Post(() =>
|
Dispatcher.UIThread.Post(() =>
|
||||||
|
|||||||
Reference in New Issue
Block a user