mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-11 05:07:56 +02:00
IDE: fixed ignoring empty lines at end of conditionals, no modified if project icon was not touched
git-svn-id: trunk@45541 -
This commit is contained in:
parent
e476ebffab
commit
c39261347a
@ -298,7 +298,7 @@ type
|
||||
function GetUnitOutputDir: string; virtual; abstract;
|
||||
function GetUnitPaths: String; virtual; abstract;
|
||||
procedure SetCompilerPath(const AValue: String); virtual; abstract;
|
||||
procedure SetConditionals(const AValue: string); virtual; abstract;
|
||||
procedure SetConditionals(AValue: string); virtual; abstract;
|
||||
procedure SetCustomOptions(const AValue: string); virtual; abstract;
|
||||
procedure SetDebugPath(const AValue: string); virtual; abstract;
|
||||
procedure SetIncludePaths(const AValue: String); virtual; abstract;
|
||||
|
@ -379,7 +379,6 @@ type
|
||||
FCustomSessionData: TStringToStringTree;
|
||||
FExecutableType: TProjectExecutableType;
|
||||
FFPDocPackageName: string;
|
||||
fModified: boolean;
|
||||
FProjectSessionFile: string;
|
||||
FSessionModified: boolean;
|
||||
FTitle: String;
|
||||
@ -400,13 +399,13 @@ type
|
||||
function GetFiles(Index: integer): TLazProjectFile; virtual; abstract;
|
||||
function GetMainFile: TLazProjectFile; virtual; abstract;
|
||||
function GetMainFileID: Integer; virtual; abstract;
|
||||
function GetModified: boolean; virtual;
|
||||
function GetModified: boolean; virtual; abstract;
|
||||
function GetProjectInfoFile: string; virtual; abstract;
|
||||
function GetUseManifest: boolean; virtual; abstract;
|
||||
procedure SetExecutableType(const AValue: TProjectExecutableType); virtual;
|
||||
procedure SetFlags(const AValue: TProjectFlags); virtual;
|
||||
procedure SetMainFileID(const AValue: Integer); virtual; abstract;
|
||||
procedure SetModified(const AValue: boolean); virtual;
|
||||
procedure SetModified(const AValue: boolean); virtual; abstract;
|
||||
procedure SetProjectInfoFile(const NewFilename: string); virtual; abstract;
|
||||
procedure SetProjectSessionFile(const AValue: string); virtual;
|
||||
procedure SetSessionModified(const AValue: boolean); virtual;
|
||||
@ -1047,12 +1046,6 @@ begin
|
||||
Modified:=true;
|
||||
end;
|
||||
|
||||
procedure TLazProject.SetModified(const AValue: boolean);
|
||||
begin
|
||||
if fModified=AValue then exit;
|
||||
fModified:=AValue;
|
||||
end;
|
||||
|
||||
procedure TLazProject.SetSessionModified(const AValue: boolean);
|
||||
begin
|
||||
if FSessionModified=AValue then exit;
|
||||
@ -1101,11 +1094,6 @@ begin
|
||||
Modified:=true;
|
||||
end;
|
||||
|
||||
function TLazProject.GetModified: boolean;
|
||||
begin
|
||||
Result:=fModified;
|
||||
end;
|
||||
|
||||
procedure TLazProject.SetExecutableType(const AValue: TProjectExecutableType);
|
||||
begin
|
||||
if FExecutableType=AValue then exit;
|
||||
|
@ -46,7 +46,7 @@ uses
|
||||
{$IFNDEF EnableOldExtTools}
|
||||
AvgLvlTree,
|
||||
{$ENDIF}
|
||||
Laz2_DOM, InterfaceBase, LCLProc, Forms, Controls, ExprEval,
|
||||
Laz2_DOM, LazUTF8, InterfaceBase, LCLProc, Forms, Controls, ExprEval,
|
||||
DefineTemplates, CodeToolsCfgScript, CodeToolManager, KeywordFuncLists,
|
||||
BasicCodeTools,
|
||||
// IDEIntf
|
||||
@ -138,7 +138,7 @@ const
|
||||
+'//if SrcOS=''win'' then begin'+LineEnding
|
||||
+'// UnitPath += '';win'';'+LineEnding
|
||||
+'// IncPath += '';win'';'+LineEnding
|
||||
+'//end;'+LineEnding
|
||||
+'//end;'
|
||||
;
|
||||
|
||||
type
|
||||
@ -532,9 +532,9 @@ type
|
||||
function GetSrcPath: string; override;
|
||||
function GetUnitOutputDir: string; override;
|
||||
function GetUnitPaths: String; override;
|
||||
procedure SetBaseDirectory(const AValue: string);
|
||||
procedure SetBaseDirectory(AValue: string);
|
||||
procedure SetCompilerPath(const AValue: String); override;
|
||||
procedure SetConditionals(const AValue: string); override;
|
||||
procedure SetConditionals(AValue: string); override;
|
||||
procedure SetCustomOptions(const AValue: string); override;
|
||||
procedure SetIncludePaths(const AValue: String); override;
|
||||
procedure SetLibraryPaths(const AValue: String); override;
|
||||
@ -1285,6 +1285,9 @@ begin
|
||||
NewValue:=ShortenPath(AValue,false);
|
||||
if IncludePath=NewValue then exit;
|
||||
ParsedOpts.SetUnparsedValue(pcosIncludePath,NewValue);
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetIncludePaths ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -1292,12 +1295,20 @@ procedure TBaseCompilerOptions.SetCompilerPath(const AValue: String);
|
||||
begin
|
||||
if CompilerPath=AValue then exit;
|
||||
ParsedOpts.SetUnparsedValue(pcosCompilerPath,AValue);
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetCompilerPath ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
procedure TBaseCompilerOptions.SetConditionals(const AValue: string);
|
||||
procedure TBaseCompilerOptions.SetConditionals(AValue: string);
|
||||
begin
|
||||
if FConditionals=AValue then exit;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetConditionals ']);
|
||||
debugln('old:"',dbgstr(FConditionals),'"');
|
||||
debugln('new:"',dbgstr(AValue),'"');
|
||||
{$ENDIF}
|
||||
FConditionals:=AValue;
|
||||
if ParsedOpts.InvalidateParseOnChange then
|
||||
IncreaseBuildMacroChangeStamp;
|
||||
@ -1309,6 +1320,9 @@ procedure TBaseCompilerOptions.SetDefaultMakeOptionsFlags(
|
||||
begin
|
||||
if FDefaultMakeOptionsFlags=AValue then exit;
|
||||
FDefaultMakeOptionsFlags:=AValue;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetDefaultMakeOptionsFlags ']);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -1319,6 +1333,9 @@ begin
|
||||
NewValue:=ShortenPath(AValue,false);
|
||||
if SrcPath=NewValue then exit;
|
||||
ParsedOpts.SetUnparsedValue(pcosSrcPath,NewValue);
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetSrcPath ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -1329,6 +1346,9 @@ begin
|
||||
NewValue:=ShortenPath(AValue,false);
|
||||
if DebugPath=NewValue then exit;
|
||||
ParsedOpts.SetUnparsedValue(pcosDebugPath,NewValue);
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetDebugPath ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -1341,6 +1361,9 @@ begin
|
||||
fTargetCPU:=NewValue;
|
||||
if ParsedOpts.InvalidateParseOnChange then
|
||||
IncreaseBuildMacroChangeStamp;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetTargetCPU ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -1350,6 +1373,9 @@ begin
|
||||
fTargetProc:=AValue;
|
||||
if ParsedOpts.InvalidateParseOnChange then
|
||||
IncreaseBuildMacroChangeStamp;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetTargetProc ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -1362,6 +1388,9 @@ begin
|
||||
fTargetOS:=NewValue;
|
||||
if ParsedOpts.InvalidateParseOnChange then
|
||||
IncreaseBuildMacroChangeStamp;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetTargetOS ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -1369,6 +1398,9 @@ procedure TBaseCompilerOptions.SetTargetFilename(const AValue: String);
|
||||
begin
|
||||
if fTargetFilename=AValue then exit;
|
||||
fTargetFilename:=AValue;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetTargetFilename ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -1396,6 +1428,9 @@ end;
|
||||
|
||||
procedure TBaseCompilerOptions.OnItemChanged(Sender: TObject);
|
||||
begin
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.OnItemChanged ',DbgSName(Sender)]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -1403,6 +1438,9 @@ procedure TBaseCompilerOptions.SetCreateMakefileOnBuild(AValue: boolean);
|
||||
begin
|
||||
if FCreateMakefileOnBuild=AValue then Exit;
|
||||
FCreateMakefileOnBuild:=AValue;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetCreateMakefileOnBuild ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -1456,10 +1494,13 @@ begin
|
||||
Result:=ParsedOpts.Values[pcosUnitPath].UnparsedValue;
|
||||
end;
|
||||
|
||||
procedure TBaseCompilerOptions.SetBaseDirectory(const AValue: string);
|
||||
procedure TBaseCompilerOptions.SetBaseDirectory(AValue: string);
|
||||
begin
|
||||
if BaseDirectory=AValue then exit;
|
||||
ParsedOpts.SetUnparsedValue(pcosBaseDir,AValue);
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetBaseDirectory ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -1471,6 +1512,9 @@ begin
|
||||
NewValue:=Trim(AValue);
|
||||
if CustomOptions=NewValue then exit;
|
||||
ParsedOpts.SetUnparsedValue(pcosCustomOptions,NewValue);
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetCustomOptions ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -1481,6 +1525,9 @@ begin
|
||||
NewValue:=ShortenPath(AValue,false);
|
||||
if Libraries=NewValue then exit;
|
||||
ParsedOpts.SetUnparsedValue(pcosLibraryPath,NewValue);
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetLibraryPaths ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -1489,6 +1536,9 @@ begin
|
||||
if LinkerOptions=AValue then exit;
|
||||
fLinkerOptions:=AValue;
|
||||
ParsedOpts.SetUnparsedValue(pcosLinkerOptions,AValue);
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetLinkerOptions ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -1499,6 +1549,9 @@ begin
|
||||
NewValue:=ShortenPath(AValue,false);
|
||||
if OtherUnitFiles=NewValue then exit;
|
||||
ParsedOpts.SetUnparsedValue(pcosUnitPath,NewValue);
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetUnitPaths ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -1506,6 +1559,9 @@ procedure TBaseCompilerOptions.SetUnitOutputDir(const AValue: string);
|
||||
begin
|
||||
if UnitOutputDirectory=AValue then exit;
|
||||
ParsedOpts.SetUnparsedValue(pcosOutputDir,AValue);
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetUnitOutputDir ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -1516,6 +1572,9 @@ begin
|
||||
NewValue:=ShortenPath(AValue,false);
|
||||
if ObjectPath=NewValue then exit;
|
||||
ParsedOpts.SetUnparsedValue(pcosObjectPath,NewValue);
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TBaseCompilerOptions.SetObjectPath ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -1658,7 +1717,8 @@ begin
|
||||
SrcPath := sp(aXMLConfig.GetValue(p+'SrcPath/Value', ''));
|
||||
|
||||
{ Conditionals }
|
||||
FConditionals:=aXMLConfig.GetValue(Path+'Conditionals/Value',DefaultConditionals);
|
||||
FConditionals:=ConvertLineEndings(UTF8Trim(
|
||||
aXMLConfig.GetValue(Path+'Conditionals/Value',DefaultConditionals),[]));
|
||||
TIDEBuildMacros(fBuildMacros).LoadFromXMLConfig(aXMLConfig,
|
||||
Path+'BuildMacros/',PathDelimChange);
|
||||
|
||||
@ -4355,6 +4415,9 @@ procedure TCompilationToolOptions.SetCommand(const AValue: string);
|
||||
begin
|
||||
if FCommand=AValue then exit;
|
||||
FCommand:=AValue;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TCompilationToolOptions.SetCommand ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -4362,6 +4425,9 @@ procedure TCompilationToolOptions.SetScanForFPCMessages(const AValue: boolean);
|
||||
begin
|
||||
if FScanForFPCMessages=AValue then exit;
|
||||
FScanForFPCMessages:=AValue;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TCompilationToolOptions.SetScanForFPCMessages ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -4369,6 +4435,9 @@ procedure TCompilationToolOptions.SetScanForMakeMessages(const AValue: boolean);
|
||||
begin
|
||||
if FScanForMakeMessages=AValue then exit;
|
||||
FScanForMakeMessages:=AValue;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TCompilationToolOptions.SetScanForMakeMessages ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -4376,6 +4445,9 @@ procedure TCompilationToolOptions.SetShowAllMessages(const AValue: boolean);
|
||||
begin
|
||||
if FShowAllMessages=AValue then exit;
|
||||
FShowAllMessages:=AValue;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TCompilationToolOptions.SetShowAllMessages ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -4549,6 +4621,9 @@ begin
|
||||
if (AValue='') or (not IsValidIdent(AValue)) then
|
||||
raise Exception.Create('TIDEBuildMacro.SetIdentifier invalid identifier: '+AValue);
|
||||
FIdentifier:=AValue;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TIDEBuildMacro.SetIdentifier ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
IncreaseBuildMacroChangeStamp;
|
||||
end;
|
||||
@ -4557,6 +4632,9 @@ procedure TIDEBuildMacro.SetDescription(const AValue: string);
|
||||
begin
|
||||
if FDescription=AValue then exit;
|
||||
FDescription:=AValue;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TIDEBuildMacro.SetDescription ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -4564,6 +4642,9 @@ procedure TIDEBuildMacro.SetValueDescriptions(const AValue: TStrings);
|
||||
begin
|
||||
if (FValueDescriptions=AValue) or FValueDescriptions.Equals(AValue) then exit;
|
||||
FValueDescriptions.Assign(AValue);
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TIDEBuildMacro.SetValueDescriptions ',AValue.Text]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -4571,6 +4652,9 @@ procedure TIDEBuildMacro.SetValues(const AValue: TStrings);
|
||||
begin
|
||||
if (FValues=AValue) or FValues.Equals(AValue) then exit;
|
||||
FValues.Assign(AValue);
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TIDEBuildMacro.SetValues ',AValue.Text]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -4871,6 +4955,9 @@ begin
|
||||
fTree.Add(Flag);
|
||||
fTree.ConsistencyCheck;
|
||||
end;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TCompilerMsgIDFlags.SetValues ']);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -4920,6 +5007,9 @@ begin
|
||||
Node.Data:=Flag;
|
||||
Node:=Node.Successor;
|
||||
end;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TCompilerMsgIDFlags.Assign ']);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end else
|
||||
inherited Assign(Source);
|
||||
|
@ -46,6 +46,7 @@ type
|
||||
procedure UseXPManifestCheckBoxChange(Sender: TObject);
|
||||
private
|
||||
FProject: TProject;
|
||||
fIconChanged: boolean;
|
||||
procedure SetIconFromStream(Value: TStream);
|
||||
function GetIconAsStream: TStream;
|
||||
public
|
||||
@ -135,6 +136,7 @@ end;
|
||||
|
||||
procedure TProjectApplicationOptionsFrame.ClearIconButtonClick(Sender: TObject);
|
||||
begin
|
||||
fIconChanged:=true;
|
||||
IconImage.Picture.Clear;
|
||||
end;
|
||||
|
||||
@ -146,17 +148,19 @@ end;
|
||||
procedure TProjectApplicationOptionsFrame.DefaultIconButtonClick(Sender: TObject);
|
||||
begin
|
||||
IconImage.Picture.Icon.LoadFromResourceName(HInstance, 'MAINICONPROJECT');
|
||||
fIconChanged:=true;
|
||||
end;
|
||||
|
||||
procedure TProjectApplicationOptionsFrame.LoadIconButtonClick(Sender: TObject);
|
||||
begin
|
||||
if OpenPictureDialog1.Execute then
|
||||
try
|
||||
IconImage.Picture.LoadFromFile(OpenPictureDialog1.FileName)
|
||||
except
|
||||
on E: Exception do
|
||||
IDEMessageDialog(lisCCOErrorCaption, E.Message, mtError, [mbOK]);
|
||||
end;
|
||||
if not OpenPictureDialog1.Execute then exit;
|
||||
try
|
||||
IconImage.Picture.LoadFromFile(OpenPictureDialog1.FileName);
|
||||
fIconChanged:=true;
|
||||
except
|
||||
on E: Exception do
|
||||
IDEMessageDialog(lisCCOErrorCaption, E.Message, mtError, [mbOK]);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TProjectApplicationOptionsFrame.SaveIconButtonClick(Sender: TObject);
|
||||
@ -261,6 +265,7 @@ begin
|
||||
finally
|
||||
AStream.Free;
|
||||
end;
|
||||
fIconChanged:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -271,11 +276,14 @@ begin
|
||||
with AOptions as TProject do
|
||||
begin
|
||||
Title := TitleEdit.Text;
|
||||
AStream := GetIconAsStream;
|
||||
try
|
||||
ProjResources.ProjectIcon.SetStream(AStream);
|
||||
finally
|
||||
AStream.Free;
|
||||
if fIconChanged then
|
||||
begin
|
||||
AStream := GetIconAsStream;
|
||||
try
|
||||
ProjResources.ProjectIcon.SetStream(AStream);
|
||||
finally
|
||||
AStream.Free;
|
||||
end;
|
||||
end;
|
||||
UseAppBundle := UseAppBundleCheckBox.Checked;
|
||||
with ProjResources.XPManifest do
|
||||
|
126
ide/project.pp
126
ide/project.pp
@ -42,14 +42,13 @@ interface
|
||||
|
||||
{$I ide.inc}
|
||||
|
||||
{off $DEFINE VerboseProjectModified}
|
||||
|
||||
uses
|
||||
{$IFDEF IDE_MEM_CHECK}
|
||||
MemCheck,
|
||||
{$ENDIF}
|
||||
Classes, SysUtils, TypInfo, FPCAdds, LCLProc, LCLIntf, LCLType, Forms,
|
||||
FileUtil, Laz2_XMLCfg, Controls, Dialogs, maps, LazFileUtils, LazFileCache,
|
||||
LazUTF8,
|
||||
// codetools
|
||||
CodeToolsConfig, ExprEval, DefineTemplates,
|
||||
BasicCodeTools, CodeToolsCfgScript, CodeToolManager, CodeCache, FileProcs,
|
||||
@ -523,7 +522,7 @@ type
|
||||
procedure SetSrcPath(const AValue: string); override;
|
||||
procedure SetUnitPaths(const AValue: string); override;
|
||||
procedure SetUnitOutputDir(const AValue: string); override;
|
||||
procedure SetConditionals(const AValue: string); override;
|
||||
procedure SetConditionals(AValue: string); override;
|
||||
function SubstituteProjectMacros(const s: string;
|
||||
PlatformIndependent: boolean): string;
|
||||
public
|
||||
@ -741,6 +740,8 @@ type
|
||||
FAllEditorsInfoList: TUnitEditorInfoList;
|
||||
FAllEditorsInfoMap: TMap;
|
||||
FAutoCreateForms: boolean;
|
||||
FChangeStamp: integer;
|
||||
FChangeStampSaved: integer;
|
||||
FEnableI18NForLFM: boolean;
|
||||
FLastCompileComplete: boolean;
|
||||
FMacroEngine: TTransferMacroList;
|
||||
@ -913,6 +914,8 @@ type
|
||||
function SomethingModified(CheckData, CheckSession: boolean; Verbose: boolean = false): boolean;
|
||||
function SomeDataModified(Verbose: boolean = false): boolean;
|
||||
function SomeSessionModified(Verbose: boolean = false): boolean;
|
||||
procedure IncreaseChangeStamp; inline;
|
||||
property ChangeStamp: integer read FChangeStamp;
|
||||
procedure MainSourceFilenameChanged;
|
||||
procedure GetUnitsChangedOnDisk(var AnUnitList: TFPList);
|
||||
function HasProjectInfoFileChangedOnDisk: boolean;
|
||||
@ -2541,7 +2544,7 @@ end;
|
||||
procedure TUnitInfo.SetModified(const AValue: boolean);
|
||||
begin
|
||||
if Modified=AValue then exit;
|
||||
{$IFDEF VerboseProjectModified}
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TUnitInfo.SetModified ',Filename,' new Modified=',AValue]);
|
||||
{$ENDIF}
|
||||
fModified:=AValue;
|
||||
@ -2584,7 +2587,7 @@ end;
|
||||
procedure TUnitInfo.SetSessionModified(const AValue: boolean);
|
||||
begin
|
||||
if FSessionModified=AValue then exit;
|
||||
{$IFDEF VerboseProjectModified}
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TUnitInfo.SetSessionModified ',Filename,' new Modified=',AValue]);
|
||||
{$ENDIF}
|
||||
FSessionModified:=AValue;
|
||||
@ -3383,7 +3386,13 @@ end;
|
||||
procedure TProject.BackupBuildModes;
|
||||
begin
|
||||
FActiveBuildModeBackup:=BuildModes.IndexOf(ActiveBuildMode);
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProject.BackupBuildModes START=====================']);
|
||||
{$ENDIF}
|
||||
BuildModesBackup.Assign(BuildModes,true);
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProject.BackupBuildModes END===================== Modified=',Modified]);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure TProject.RestoreBuildModes;
|
||||
@ -3632,9 +3641,12 @@ end;
|
||||
|
||||
procedure TProject.UnitModified(AnUnitInfo: TUnitInfo);
|
||||
begin
|
||||
if AnUnitInfo.IsPartOfProject then
|
||||
Modified:=true
|
||||
else
|
||||
if AnUnitInfo.IsPartOfProject then begin
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProject.UnitModified ',AnUnitInfo.Filename]);
|
||||
{$ENDIF}
|
||||
Modified:=true;
|
||||
end else
|
||||
SessionModified:=true;
|
||||
end;
|
||||
|
||||
@ -3687,12 +3699,6 @@ begin
|
||||
inherited SetFlags(AValue);
|
||||
end;
|
||||
|
||||
function TProject.GetModified: boolean;
|
||||
begin
|
||||
Result:=inherited GetModified
|
||||
or ((BuildModes<>nil) and BuildModes.Modified);
|
||||
end;
|
||||
|
||||
procedure TProject.SetMainUnitID(const AValue: Integer);
|
||||
begin
|
||||
if AValue>=UnitCount then
|
||||
@ -3711,19 +3717,26 @@ begin
|
||||
Result:=Units[Index];
|
||||
end;
|
||||
|
||||
function TProject.GetModified: boolean;
|
||||
begin
|
||||
Result:=(FChangeStamp<>FChangeStampSaved)
|
||||
or ((BuildModes<>nil) and BuildModes.Modified);
|
||||
end;
|
||||
|
||||
procedure TProject.SetModified(const AValue: boolean);
|
||||
begin
|
||||
{$IFDEF VerboseProjectModified}
|
||||
{$IFDEF VerboseIDEModified}
|
||||
if Modified<>AValue then begin
|
||||
debugln(['TProject.SetModified ================= ',AValue]);
|
||||
DumpStack;
|
||||
debugln(['TProject.SetModified ================= ',AValue,' ',FChangeStamp]);
|
||||
CTDumpStack;
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
if fDestroying then exit;
|
||||
inherited SetModified(AValue);
|
||||
if not AValue then
|
||||
begin
|
||||
if AValue then
|
||||
IncreaseChangeStamp
|
||||
else begin
|
||||
FChangeStampSaved:=FChangeStamp;
|
||||
PublishOptions.Modified := False;
|
||||
ProjResources.Modified := False;
|
||||
BuildModes.Modified:=false;
|
||||
@ -3734,7 +3747,7 @@ end;
|
||||
procedure TProject.SetSessionModified(const AValue: boolean);
|
||||
begin
|
||||
if AValue=SessionModified then exit;
|
||||
{$IFDEF VerboseProjectModified}
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProject.SetSessionModified new Modified=',AValue]);
|
||||
{$ENDIF}
|
||||
inherited SetSessionModified(AValue);
|
||||
@ -3840,7 +3853,6 @@ begin
|
||||
Result:=CodeToolBoss.AddCreateFormStatement(MainUnitInfo.Source,
|
||||
AClassName,AName);
|
||||
if Result then begin
|
||||
Modified:=true;
|
||||
MainUnitInfo.Modified:=true;
|
||||
end;
|
||||
end else begin
|
||||
@ -3853,7 +3865,6 @@ begin
|
||||
Result:=CodeToolBoss.RemoveCreateFormStatement(MainUnitInfo.Source,
|
||||
AName);
|
||||
if Result then begin
|
||||
Modified:=true;
|
||||
MainUnitInfo.Modified:=true;
|
||||
end;
|
||||
end;
|
||||
@ -4046,6 +4057,9 @@ procedure TProject.SetEnableI18N(const AValue: boolean);
|
||||
begin
|
||||
if FEnableI18N=AValue then exit;
|
||||
FEnableI18N:=AValue;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProject.SetEnableI18N ',AValue]);
|
||||
{$ENDIF}
|
||||
Modified:=true;
|
||||
end;
|
||||
|
||||
@ -4056,6 +4070,9 @@ begin
|
||||
NewValue:=ChompPathDelim(TrimFilename(AValue));
|
||||
if FPOOutputDirectory=NewValue then exit;
|
||||
FPOOutputDirectory:=NewValue;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProject.SetPOOutputDirectory ',AValue]);
|
||||
{$ENDIF}
|
||||
Modified:=true;
|
||||
end;
|
||||
|
||||
@ -4156,6 +4173,9 @@ begin
|
||||
if Assigned(OnChangeProjectInfoFile) then
|
||||
OnChangeProjectInfoFile(Self);
|
||||
FDefineTemplates.SourceDirectoriesChanged;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProject.SetProjectInfoFile ',NewFilename]);
|
||||
{$ENDIF}
|
||||
Modified:=true;
|
||||
EndUpdate;
|
||||
//DebugLn('TProject.SetProjectInfoFile FDefineTemplates.FUpdateLock=',dbgs(FDefineTemplates.FUpdateLock));
|
||||
@ -4165,6 +4185,9 @@ procedure TProject.SetSessionStorage(const AValue: TProjectSessionStorage);
|
||||
begin
|
||||
if SessionStorage=AValue then exit;
|
||||
inherited SetSessionStorage(AValue);
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProject.SetSessionStorage ']);
|
||||
{$ENDIF}
|
||||
Modified:=true;
|
||||
UpdateSessionFilename;
|
||||
end;
|
||||
@ -4382,6 +4405,9 @@ begin
|
||||
DebugLn(['TProject.AddRequiredDependency ']);
|
||||
{$ENDIF}
|
||||
IncreaseCompilerParseStamp;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProject.AddRequiredDependency ',Dependency.PackageName]);
|
||||
{$ENDIF}
|
||||
Modified:=true;
|
||||
EndUpdate;
|
||||
end;
|
||||
@ -4395,6 +4421,9 @@ begin
|
||||
Dependency.Removed:=true;
|
||||
FDefineTemplates.CustomDefinesChanged;
|
||||
IncreaseCompilerParseStamp;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProject.RemoveRequiredDependency ',Dependency.PackageName]);
|
||||
{$ENDIF}
|
||||
Modified:=true;
|
||||
EndUpdate;
|
||||
end;
|
||||
@ -5027,6 +5056,9 @@ begin
|
||||
FCompilerOptions:=nil;
|
||||
FLazCompilerOptions:=nil;
|
||||
end;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProject.SetActiveBuildMode ']);
|
||||
{$ENDIF}
|
||||
SessionModified:=true;
|
||||
if Self=Project1 then
|
||||
IncreaseBuildMacroChangeStamp;
|
||||
@ -5058,6 +5090,9 @@ procedure TProject.SetEnableI18NForLFM(const AValue: boolean);
|
||||
begin
|
||||
if FEnableI18NForLFM=AValue then exit;
|
||||
FEnableI18NForLFM:=AValue;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProject.SetEnableI18NForLFM ',AValue]);
|
||||
{$ENDIF}
|
||||
Modified:=true;
|
||||
end;
|
||||
|
||||
@ -5082,6 +5117,9 @@ procedure TProject.SetStorePathDelim(const AValue: TPathDelimSwitch);
|
||||
begin
|
||||
if FStorePathDelim=AValue then exit;
|
||||
FStorePathDelim:=AValue;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProject.SetStorePathDelim ']);
|
||||
{$ENDIF}
|
||||
Modified:=true;
|
||||
end;
|
||||
|
||||
@ -5167,6 +5205,11 @@ begin
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
procedure TProject.IncreaseChangeStamp;
|
||||
begin
|
||||
LUIncreaseChangeStamp(FChangeStamp);
|
||||
end;
|
||||
|
||||
procedure TProject.MainSourceFilenameChanged;
|
||||
begin
|
||||
|
||||
@ -5729,6 +5772,9 @@ procedure TProjectCompilationToolOptions.SetCompileReasons(
|
||||
begin
|
||||
if FCompileReasons=AValue then exit;
|
||||
FCompileReasons:=AValue;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProjectCompilationToolOptions.SetCompileReasons']);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -5737,6 +5783,9 @@ procedure TProjectCompilationToolOptions.SetDefaultCompileReasons(
|
||||
begin
|
||||
if FDefaultCompileReasons=AValue then exit;
|
||||
FDefaultCompileReasons:=AValue;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProjectCompilationToolOptions.SetDefaultCompileReasons']);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -5906,14 +5955,12 @@ begin
|
||||
LazProject.DefineTemplates.OutputDirectoryChanged;
|
||||
end;
|
||||
|
||||
procedure TProjectCompilerOptions.SetConditionals(const AValue: string);
|
||||
var
|
||||
NewValue: String;
|
||||
procedure TProjectCompilerOptions.SetConditionals(AValue: string);
|
||||
begin
|
||||
NewValue:=Trim(AValue);
|
||||
if Conditionals=NewValue then exit;
|
||||
AValue:=UTF8Trim(AValue,[]);
|
||||
if Conditionals=AValue then exit;
|
||||
InvalidateOptions;
|
||||
inherited SetConditionals(NewValue);
|
||||
inherited SetConditionals(AValue);
|
||||
end;
|
||||
|
||||
function TProjectCompilerOptions.SubstituteProjectMacros(const s: string;
|
||||
@ -6601,11 +6648,17 @@ procedure TProjectBuildMode.SetInSession(const AValue: boolean);
|
||||
begin
|
||||
if FInSession=AValue then exit;
|
||||
FInSession:=AValue;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProjectBuildMode.SetInSession ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
procedure TProjectBuildMode.OnItemChanged(Sender: TObject);
|
||||
begin
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProjectBuildMode.OnItemChanged ',DbgSName(Sender)]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -6623,6 +6676,9 @@ procedure TProjectBuildMode.SetIdentifier(const AValue: string);
|
||||
begin
|
||||
if FIdentifier=AValue then exit;
|
||||
FIdentifier:=AValue;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProjectBuildMode.SetIdentifier ',AValue]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -6701,6 +6757,12 @@ end;
|
||||
|
||||
procedure TProjectBuildMode.IncreaseChangeStamp;
|
||||
begin
|
||||
{$IFDEF VerboseIDEModified}
|
||||
if not Modified then begin
|
||||
debugln(['TProjectBuildMode.IncreaseChangeStamp ']);
|
||||
CTDumpStack;
|
||||
end;
|
||||
{$ENDIF}
|
||||
CTIncreaseChangeStamp64(FChangeStamp);
|
||||
if fOnChanged<>nil then fOnChanged.CallNotifyEvents(Self);
|
||||
end;
|
||||
@ -6751,6 +6813,9 @@ end;
|
||||
|
||||
procedure TProjectBuildModes.OnItemChanged(Sender: TObject);
|
||||
begin
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProjectBuildModes.OnItemChanged ',DbgSName(Sender)]);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
@ -6845,6 +6910,9 @@ begin
|
||||
Item:=Items[Index];
|
||||
fItems.Delete(Index);
|
||||
Item.Free;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProjectBuildModes.Delete ']);
|
||||
{$ENDIF}
|
||||
IncreaseChangeStamp;
|
||||
end;
|
||||
|
||||
|
@ -264,6 +264,9 @@ begin
|
||||
Exit;
|
||||
FData := AValue;
|
||||
fFileAgeValid := false;
|
||||
{$IFDEF VerboseIDEModified}
|
||||
debugln(['TProjectIcon.SetIconData ']);
|
||||
{$ENDIF}
|
||||
Modified := True;
|
||||
end;
|
||||
|
||||
|
@ -39,7 +39,7 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, contnrs, typinfo, LCLProc, LCLType, LResources, Graphics,
|
||||
Forms, FileProcs, FileUtil, AVL_Tree, LazConfigStorage, Laz2_XMLCfg,
|
||||
LazFileUtils, LazFileCache, BasicCodeTools, CodeToolsCfgScript,
|
||||
LazFileUtils, LazFileCache, LazUTF8, BasicCodeTools, CodeToolsCfgScript,
|
||||
DefineTemplates, CodeToolManager, CodeCache, CodeToolsStructs, PropEdits,
|
||||
LazIDEIntf, MacroIntf, MacroDefIntf, PackageIntf, IDEOptionsIntf,
|
||||
EditDefineTree, CompilerOptions, CompOptsModes, IDEOptionDefs,
|
||||
@ -354,7 +354,7 @@ type
|
||||
procedure SetSrcPath(const AValue: string); override;
|
||||
procedure SetUnitPaths(const AValue: string); override;
|
||||
procedure SetUnitOutputDir(const AValue: string); override;
|
||||
procedure SetConditionals(const AValue: string); override;
|
||||
procedure SetConditionals(AValue: string); override;
|
||||
public
|
||||
constructor Create(const AOwner: TObject); override;
|
||||
// IDE options
|
||||
@ -3997,14 +3997,12 @@ begin
|
||||
LazPackage.DefineTemplates.OutputDirectoryChanged;
|
||||
end;
|
||||
|
||||
procedure TPkgCompilerOptions.SetConditionals(const AValue: string);
|
||||
var
|
||||
NewValue: String;
|
||||
procedure TPkgCompilerOptions.SetConditionals(AValue: string);
|
||||
begin
|
||||
NewValue:=Trim(AValue);
|
||||
if Conditionals=NewValue then exit;
|
||||
AValue:=UTF8Trim(AValue,[]);
|
||||
if Conditionals=AValue then exit;
|
||||
InvalidateOptions;
|
||||
inherited SetConditionals(NewValue);
|
||||
inherited SetConditionals(AValue);
|
||||
end;
|
||||
|
||||
constructor TPkgCompilerOptions.Create(const AOwner: TObject);
|
||||
|
Loading…
Reference in New Issue
Block a user