Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions src/Files.App/Helpers/NavigationHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ private static async Task<FilesystemResult> OpenDirectory(string path, IShellPag
var opened = (FilesystemResult)false;
bool isHiddenItem = NativeFileOperationsHelper.HasFileAttribute(path, System.IO.FileAttributes.Hidden);
bool isShortcut = FileExtensionHelpers.IsShortcutOrUrlFile(path);
bool isNetwork = path.StartsWith(@"\\", StringComparison.Ordinal);

if (isShortcut)
{
Expand All @@ -274,27 +273,6 @@ private static async Task<FilesystemResult> OpenDirectory(string path, IShellPag
await OpenPath(forceOpenInNewTab, userSettingsService.FoldersSettingsService.OpenFoldersInNewTab, path, associatedInstance);
opened = (FilesystemResult)true;
}
else if (isNetwork)
{
var auth = await NetworkDrivesAPI.AuthenticateNetworkShare(path);
if (auth)
{
if (forceOpenInNewTab || userSettingsService.FoldersSettingsService.OpenFoldersInNewTab)
{
await OpenPathInNewTab(path);
}
else
{
associatedInstance.ToolbarViewModel.PathControlDisplayText = path;
associatedInstance.NavigateWithArguments(associatedInstance.InstanceViewModel.FolderSettings.GetLayoutType(path), new NavigationArguments()
{
NavPathParam = path,
AssociatedTabInstance = associatedInstance
});
}
opened = (FilesystemResult)true;
}
}
else
{
opened = await associatedInstance.FilesystemViewModel.GetFolderWithPathFromPathAsync(path)
Expand Down
8 changes: 8 additions & 0 deletions src/Files.App/ViewModels/ItemViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1403,10 +1403,18 @@ public async Task<int> EnumerateItemsFromStandardFolderAsync(string path, Cancel
{
// Flag to use FindFirstFileExFromApp or StorageFolder enumeration - Use storage folder for Box Drive (#4629)
var isBoxFolder = App.CloudDrivesManager.Drives.FirstOrDefault(x => x.Text == "Box")?.Path?.TrimEnd('\\') is string boxFolder && path.StartsWith(boxFolder);
bool isNetwork = path.StartsWith(@"\\", StringComparison.Ordinal);
bool enumFromStorageFolder = isBoxFolder;

BaseStorageFolder? rootFolder = null;

if (isNetwork)
{
var auth = await NetworkDrivesAPI.AuthenticateNetworkShare(path);
if (!auth)
return -1;
}

if (!enumFromStorageFolder && FolderHelpers.CheckFolderAccessWithWin32(path))
{
// Will enumerate with FindFirstFileExFromApp, rootFolder only used for Bitlocker
Expand Down
7 changes: 0 additions & 7 deletions src/Files.App/ViewModels/ToolbarViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -955,13 +955,6 @@ public async Task CheckPathInput(string currentInput, string currentSelectedPath
if (currentInput.StartsWith('\\') && !currentInput.StartsWith("\\\\", StringComparison.Ordinal))
currentInput = currentInput.Insert(0, "\\");

if (currentInput.StartsWith('\\'))
{
var auth = await NetworkDrivesAPI.AuthenticateNetworkShare(currentInput);
if (!auth)
return;
}

if (currentSelectedPath == currentInput || string.IsNullOrWhiteSpace(currentInput))
return;

Expand Down