mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 22:58:50 +02:00
IDE: check if project info file is a lpi file and allow to abort
git-svn-id: trunk@22951 -
This commit is contained in:
parent
79fd904fdf
commit
0b3d343290
@ -583,6 +583,9 @@ resourcestring
|
||||
lisUnableToReadFile2 = 'Unable to read file %s%s%s!';
|
||||
lisUnableToReadTheProjectInfoFile = 'Unable to read the project info file%s%'
|
||||
+'s%s%s.';
|
||||
lisStrangeLpiFile = 'Strange lpi file';
|
||||
lisTheFileDoesNotLookLikeALpiFile = 'The file %s does not look like a lpi '
|
||||
+'file.';
|
||||
lisUnableToReadTheProjectInfoFile2 = 'Unable to read the project info file%'
|
||||
+'s%s%s%s.';
|
||||
lisWriteError = 'Write Error';
|
||||
|
@ -2492,8 +2492,6 @@ begin
|
||||
try
|
||||
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TProject.ReadProject A reading lpi');{$ENDIF}
|
||||
xmlconfig := TXMLConfig.Create(ProjectInfoFile);
|
||||
fLastReadLPIFilename:=ProjectInfoFile;
|
||||
fLastReadLPIFileDate:=Now;
|
||||
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TProject.ReadProject B done lpi');{$ENDIF}
|
||||
except
|
||||
MessageDlg(Format(lisUnableToReadTheProjectInfoFile, [#13, '"',
|
||||
@ -2503,6 +2501,9 @@ begin
|
||||
exit;
|
||||
end;
|
||||
|
||||
fLastReadLPIFilename:=ProjectInfoFile;
|
||||
fLastReadLPIFileDate:=Now;
|
||||
|
||||
NewMainUnitID:=-1;
|
||||
try
|
||||
Path:='ProjectOptions/';
|
||||
@ -2512,6 +2513,13 @@ begin
|
||||
|
||||
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TProject.ReadProject C reading values');{$ENDIF}
|
||||
FileVersion:= XMLConfig.GetValue(Path+'Version/Value',0);
|
||||
if (Fileversion=0) and (xmlconfig.GetValue(Path+'Units/Count',0)=0) then
|
||||
begin
|
||||
if MessageDlg(lisStrangeLpiFile,
|
||||
Format(lisTheFileDoesNotLookLikeALpiFile, [ProjectInfoFile]),
|
||||
mtConfirmation,[mbIgnore,mbAbort],0)<>mrIgnore then exit;
|
||||
end;
|
||||
|
||||
LoadFlags(XMLConfig,Path);
|
||||
|
||||
SessionStorage:=StrToProjectSessionStorage(
|
||||
|
Loading…
Reference in New Issue
Block a user