Переглянути джерело

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

Alexander Koblov 2 роки тому
батько
коміт
199e3c7567
1 змінених файлів з 15 додано та 12 видалено
  1. 15 12
      src/fileviews/ufileviewheader.pas

+ 15 - 12
src/fileviews/ufileviewheader.pas

@@ -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;