Skip to content

Commit

Permalink
Code cleanup 2
Browse files Browse the repository at this point in the history
  • Loading branch information
gave92 committed Aug 13, 2021
1 parent b209d67 commit 11b0b54
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions Files/Filesystem/FilesystemOperations/Helpers/FilesystemHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -657,17 +657,19 @@ public async Task<ReturnResult> CopyItemAsync(IStorageItemWithPath source, strin

public async Task<ReturnResult> RecycleItemsFromClipboard(DataPackageView packageView, string destination, bool showDialog, bool registerHistory)
{
if (!HasDraggedStorageItems(packageView))
{
// Happens if you copy some text and then you Ctrl+V in Files
return ReturnResult.BadArgumentException;
}

var (handledByFtp, source) = await GetDraggedStorageItems(packageView);

if (handledByFtp)
{
// Not supported
return ReturnResult.Failed;
}
if (!source.Any())
{
// Happens if you copy some text and then you Ctrl+V in Files
return ReturnResult.BadArgumentException;
}

ReturnResult returnStatus = ReturnResult.InProgress;

Expand All @@ -680,6 +682,7 @@ public async Task<ReturnResult> RecycleItemsFromClipboard(DataPackageView packag
public async Task<ReturnResult> CopyItemsFromClipboard(DataPackageView packageView, string destination, bool showDialog, bool registerHistory)
{
var (handledByFtp, source) = await GetDraggedStorageItems(packageView);

if (handledByFtp)
{
var connection = await ServiceConnection;
Expand Down Expand Up @@ -899,17 +902,19 @@ public async Task<ReturnResult> MoveItemAsync(IStorageItemWithPath source, strin

public async Task<ReturnResult> MoveItemsFromClipboard(DataPackageView packageView, string destination, bool showDialog, bool registerHistory)
{
if (!HasDraggedStorageItems(packageView))
{
// Happens if you copy some text and then you Ctrl+V in Files
return ReturnResult.BadArgumentException;
}

var (handledByFtp, source) = await GetDraggedStorageItems(packageView);

if (handledByFtp)
{
// Not supported
return ReturnResult.Failed;
}
if (!source.Any())
{
// Happens if you copy some text and then you Ctrl+V in Files
return ReturnResult.BadArgumentException;
}

ReturnResult returnStatus = ReturnResult.InProgress;

Expand Down

0 comments on commit 11b0b54

Please sign in to comment.