mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Crash if Enter pressed in QuickSearch when file list is empty.
This commit is contained in:
parent
6de400c3f2
commit
5bbbecd928
2 changed files with 23 additions and 23 deletions
|
|
@ -2006,8 +2006,7 @@ begin
|
|||
|
||||
// If on a file/directory then choose it.
|
||||
if (Point.Y >= dgPanel.GetHeaderHeight) and
|
||||
(Point.Y < dgPanel.GridHeight) and
|
||||
(not IsEmpty) then
|
||||
(Point.Y < dgPanel.GridHeight) then
|
||||
begin
|
||||
ChooseFile(GetActiveDisplayFile);
|
||||
end;
|
||||
|
|
@ -2177,8 +2176,7 @@ begin
|
|||
VK_RIGHT:
|
||||
if (Shift = []) and gLynxLike then
|
||||
begin
|
||||
if Assigned(GetActiveDisplayFile) then
|
||||
ChooseFile(GetActiveDisplayFile, True);
|
||||
ChooseFile(GetActiveDisplayFile, True);
|
||||
Key := 0;
|
||||
end;
|
||||
|
||||
|
|
@ -3249,8 +3247,7 @@ end;
|
|||
|
||||
procedure TColumnsFileView.cm_Open(param: string='');
|
||||
begin
|
||||
if Assigned(GetActiveDisplayFile) then
|
||||
ChooseFile(GetActiveDisplayFile);
|
||||
ChooseFile(GetActiveDisplayFile);
|
||||
end;
|
||||
|
||||
procedure TColumnsFileView.cm_CountDirContent(param: string='');
|
||||
|
|
|
|||
|
|
@ -726,23 +726,26 @@ procedure TFileView.ChooseFile(const AFile: TDisplayFile; FolderMode: Boolean =
|
|||
var
|
||||
FSFile: TFile;
|
||||
begin
|
||||
FSFile := AFile.FSFile.Clone;
|
||||
try
|
||||
if FSFile.Name = '..' then
|
||||
ChangePathToParent(True)
|
||||
else if FSFile.IsLinkToDirectory then
|
||||
ChooseSymbolicLink(Self, FSFile)
|
||||
else if FSFile.IsDirectory then
|
||||
ChangePathToChild(FSFile)
|
||||
else if not FolderMode then
|
||||
try
|
||||
uFileSourceUtil.ChooseFile(Self, FSFile);
|
||||
except
|
||||
on e: Exception do
|
||||
MessageDlg('Error', e.Message, mtError, [mbOK], 0);
|
||||
end;
|
||||
finally
|
||||
FSFile.Free;
|
||||
if Assigned(AFile) then
|
||||
begin
|
||||
FSFile := AFile.FSFile.Clone;
|
||||
try
|
||||
if FSFile.Name = '..' then
|
||||
ChangePathToParent(True)
|
||||
else if FSFile.IsLinkToDirectory then
|
||||
ChooseSymbolicLink(Self, FSFile)
|
||||
else if FSFile.IsDirectory then
|
||||
ChangePathToChild(FSFile)
|
||||
else if not FolderMode then
|
||||
try
|
||||
uFileSourceUtil.ChooseFile(Self, FSFile);
|
||||
except
|
||||
on e: Exception do
|
||||
MessageDlg('Error', e.Message, mtError, [mbOK], 0);
|
||||
end;
|
||||
finally
|
||||
FSFile.Free;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue