mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Navigate to correct file source when opening path from command line
This commit is contained in:
parent
c0e020f675
commit
6ffb9f51cd
2 changed files with 16 additions and 4 deletions
|
|
@ -176,7 +176,9 @@ end;
|
|||
|
||||
function TWinNetFileSource.IsNetworkPath(const Path: String): Boolean;
|
||||
begin
|
||||
Result:= (NumCountChars(PathDelim, ExcludeTrailingPathDelimiter(Path)) < 3);
|
||||
Result:= (Path = PathDelim) or
|
||||
((Pos(PathDelim + PathDelim, Path) = 1) and
|
||||
(NumCountChars(PathDelim, ExcludeTrailingPathDelimiter(Path)) < 3));
|
||||
end;
|
||||
|
||||
function TWinNetFileSource.SetCurrentWorkingDirectory(NewDir: String): Boolean;
|
||||
|
|
|
|||
|
|
@ -6364,18 +6364,28 @@ end;
|
|||
procedure TfrmMain.LoadTabsCommandLine(Params: TCommandLineParams);
|
||||
|
||||
procedure LoadPanel(aNoteBook: TFileViewNotebook; aPath: String);
|
||||
var
|
||||
AFileView: TFileView;
|
||||
begin
|
||||
if Length(aPath) <> 0 then
|
||||
begin
|
||||
aPath:= ReplaceEnvVars(ReplaceTilde(aPath));
|
||||
if not mbFileSystemEntryExists(aPath) then
|
||||
if not mbFileSystemEntryExists(aPath) and (Pos('\\', aPath) <> 1) then
|
||||
aPath:= GetDeepestExistingPath(aPath);
|
||||
if Length(aPath) <> 0 then
|
||||
begin
|
||||
if Params.NewTab then
|
||||
AddTab(aNoteBook, aPath)
|
||||
else
|
||||
aNoteBook.ActivePage.FileView.ChangePathAndSetActiveFile(aPath)
|
||||
else begin
|
||||
AFileView:= aNoteBook.ActivePage.FileView;
|
||||
if mbFileExists(aPath) then
|
||||
begin
|
||||
if ChooseFileSource(AFileView, ExtractFileDir(aPath)) then
|
||||
AFileView.SetActiveFile(ExtractFileName(aPath));
|
||||
end
|
||||
else
|
||||
ChooseFileSource(AFileView, aPath);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue