Make drag-and-drop follow Windows Explorer and refresh the tree after folder operations.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -71,12 +71,13 @@ public sealed class TransferQueue : BackgroundService
|
||||
}
|
||||
}
|
||||
|
||||
public async Task EnqueueDeleteAsync(IReadOnlyList<string> paths, CancellationToken cancellationToken = default)
|
||||
public async Task EnqueueDeleteAsync(IReadOnlyList<string> paths, bool permanent = false, CancellationToken cancellationToken = default)
|
||||
{
|
||||
await EnqueueAsync(new TransferJob
|
||||
{
|
||||
Op = TransferOp.Delete,
|
||||
SourcePath = string.Join("|", paths),
|
||||
DestinationPath = permanent ? "permanent" : "recycle",
|
||||
Status = TransferStatus.Queued,
|
||||
CreatedUtc = DateTimeOffset.UtcNow,
|
||||
AdditionalSources = paths.ToList()
|
||||
@@ -291,7 +292,8 @@ public sealed class TransferQueue : BackgroundService
|
||||
var paths = job.AdditionalSources.Count > 0
|
||||
? job.AdditionalSources
|
||||
: job.SourcePath.Split('|', StringSplitOptions.RemoveEmptyEntries);
|
||||
if (!_shell.DeleteToRecycleBin(paths, out var error))
|
||||
var recycle = !string.Equals(job.DestinationPath, "permanent", StringComparison.Ordinal);
|
||||
if (!_shell.Delete(paths, recycle, out var error))
|
||||
{
|
||||
job.Status = TransferStatus.Failed;
|
||||
job.Error = error;
|
||||
|
||||
Reference in New Issue
Block a user