UPD: Check file name on the local file system only (issue #709)

This commit is contained in:
Alexander Koblov 2022-12-13 19:49:04 +03:00
commit 199e3c7567

View file

@ -86,7 +86,7 @@ implementation
uses
LCLType, ShellCtrls, Graphics, uDCUtils, DCOSUtils, DCStrUtils, uKeyboard,
fMain, uFileSourceUtil, uGlobs, uPixMapManager, uLng, uFileFunctions,
uArchiveFileSource, uFileViewWithPanels;
uArchiveFileSource, uFileViewWithPanels, uVfsModule;
const
SortingImageIndex: array[TSortDirection] of Integer = (-1, 0, 1);
@ -225,20 +225,23 @@ end;
procedure TFileViewHeader.onKeyRETURN(Sender: TObject);
var
NewPath: String;
AClass: TFileSourceClass;
begin
NewPath:= NormalizePathDelimiters(FPathEdit.Text);
NewPath:= ReplaceEnvVars(ReplaceTilde(NewPath));
if not mbFileExists(NewPath) then
begin
if not ChooseFileSource(FFileView, NewPath, True) then
Exit;
end
else
begin
if not ChooseFileSource(FFileView, ExtractFileDir(NewPath)) then
Exit;
FFileView.SetActiveFile(ExtractFileName(NewPath));
end;
AClass:= gVfsModuleList.GetFileSource(NewPath);
// Check file name on the local file system only
if not ((AClass = nil) and mbFileExists(NewPath)) then
begin
if not ChooseFileSource(FFileView, NewPath, True) then
Exit;
end
else begin
if not ChooseFileSource(FFileView, ExtractFileDir(NewPath)) then
Exit;
FFileView.SetActiveFile(ExtractFileName(NewPath));
end;
FPathEdit.Visible := False;
FFileView.SetFocus;
end;