mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 23:49:28 +02:00
IDE codetools defines: do not delete path defines, if no custom options are defined
git-svn-id: trunk@9805 -
This commit is contained in:
parent
9af660b3bb
commit
a22d3ff035
@ -223,7 +223,7 @@ type
|
||||
function SelfOrParentContainsFlag(AFlag: TDefineTemplateFlag): boolean;
|
||||
procedure AddChild(ADefineTemplate: TDefineTemplate);
|
||||
procedure ReplaceChild(ADefineTemplate: TDefineTemplate);
|
||||
procedure DeleteChild(const AName: string);
|
||||
function DeleteChild(const AName: string): boolean;
|
||||
procedure Assign(ADefineTemplate: TDefineTemplate; WithSubNodes,
|
||||
WithNextSiblings, ClearOldSiblings: boolean); virtual;
|
||||
procedure AssignValues(ADefineTemplate: TDefineTemplate);
|
||||
@ -819,15 +819,17 @@ begin
|
||||
AddChild(ADefineTemplate);
|
||||
end;
|
||||
|
||||
procedure TDefineTemplate.DeleteChild(const AName: string);
|
||||
function TDefineTemplate.DeleteChild(const AName: string): boolean;
|
||||
var
|
||||
OldTempl: TDefineTemplate;
|
||||
begin
|
||||
OldTempl:=FindChildByName(AName);
|
||||
if OldTempl<>nil then begin
|
||||
Result:=true;
|
||||
OldTempl.Unbind;
|
||||
OldTempl.Free;
|
||||
end;
|
||||
end else
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
procedure TDefineTemplate.InsertBehind(APrior: TDefineTemplate);
|
||||
|
@ -4040,17 +4040,14 @@ begin
|
||||
if OptionsDefTempl=nil then begin
|
||||
// no custom options -> delete old template
|
||||
if FSrcDirIfDef<>nil then begin
|
||||
FSrcDirIfDef.UnBind;
|
||||
FSrcDirIfDef.Free;
|
||||
FSrcDirIfDef:=nil;
|
||||
if FSrcDirIfDef.DeleteChild('Custom Options') then
|
||||
CodeToolBoss.DefineTree.ClearCache;
|
||||
end;
|
||||
exit;
|
||||
end else begin
|
||||
UpdateSrcDirIfDef;
|
||||
FSrcDirIfDef.ReplaceChild(OptionsDefTempl);
|
||||
CodeToolBoss.DefineTree.ClearCache;
|
||||
end;
|
||||
|
||||
UpdateSrcDirIfDef;
|
||||
FSrcDirIfDef.ReplaceChild(OptionsDefTempl);
|
||||
|
||||
CodeToolBoss.DefineTree.ClearCache;
|
||||
end;
|
||||
|
||||
constructor TProjectDefineTemplates.Create(OwnerProject: TProject);
|
||||
|
@ -3835,17 +3835,14 @@ begin
|
||||
if OptionsDefTempl=nil then begin
|
||||
// no custom options -> delete old template
|
||||
if FCustomDefines<>nil then begin
|
||||
FCustomDefines.UnBind;
|
||||
FCustomDefines.Free;
|
||||
FCustomDefines:=nil;
|
||||
if FCustomDefines.DeleteChild('Custom Options') then
|
||||
CodeToolBoss.DefineTree.ClearCache;
|
||||
end;
|
||||
exit;
|
||||
end else begin
|
||||
UpdateSrcDirIfDef;
|
||||
FCustomDefines.ReplaceChild(OptionsDefTempl);
|
||||
CodeToolBoss.DefineTree.ClearCache;
|
||||
end;
|
||||
|
||||
UpdateSrcDirIfDef;
|
||||
FCustomDefines.ReplaceChild(OptionsDefTempl);
|
||||
|
||||
CodeToolBoss.DefineTree.ClearCache;
|
||||
end;
|
||||
|
||||
{ TBasePackageEditor }
|
||||
|
Loading…
Reference in New Issue
Block a user