Skip to content

Commit 98997ce

Browse files
authored
Properly sort shortcut items in Recycle Bin (#3462)
1 parent ce11888 commit 98997ce

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Files.Launcher/Program.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,18 @@ private static async Task ParseRecycleBinActionAsync(AppServiceRequestReceivedEv
609609
{
610610
try
611611
{
612-
var shellFileItem = GetRecycleBinItem(folderItem);
613-
folderContentsList.Add(shellFileItem);
612+
// ShellLink Properties refer to destination and not shortcut
613+
if (folderItem is ShellLink shellLink)
614+
{
615+
using var tempItem = new ShellItem(shellLink.PIDL);
616+
var shellFileItem = GetRecycleBinItem(tempItem);
617+
folderContentsList.Add(shellFileItem);
618+
}
619+
else
620+
{
621+
var shellFileItem = GetRecycleBinItem(folderItem);
622+
folderContentsList.Add(shellFileItem);
623+
}
614624
}
615625
catch (FileNotFoundException)
616626
{

0 commit comments

Comments
 (0)