IDE codetools defines: do not delete path defines, if no custom options are defined

git-svn-id: trunk@9805 -
This commit is contained in:
mattias 2006-09-04 10:30:54 +00:00
parent 9af660b3bb
commit a22d3ff035
3 changed files with 17 additions and 21 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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 }