IDE: Improve treatment of a .lpr project file dropped onto the IDE. Ask to open as a file/project. Issue #39663.

(cherry picked from commit 7ef64b00e4)
This commit is contained in:
Juha 2022-03-04 03:32:46 +02:00 committed by Maxim Ganetsky
parent a02fb4b56b
commit 62bd9dbb9a

View File

@ -5758,7 +5758,18 @@ begin
FileList := TStringList.Create;
FileList.AddStrings(FileNames);
try
MaybeOpenProject(FileList);
if FilenameExtIs(FileList[0],'lpr') then
begin
SourceEditorManager.IncUpdateLock;
OpenEditorFile(FileList[0],-1,WindowIndex,Nil,[ofAddToRecent]);
SourceEditorManager.DecUpdateLock;
FileList.Delete(0);
end
else if FilenameExtIs(FileList[0],'lpi',true) then
begin
DoOpenProjectFile(FileList[0],[ofAddToRecent]);
FileList.Delete(0);
end;
MaybeOpenEditorFiles(FileList, WindowIndex);
finally
FileList.Free;