fixed changing unitname during update

git-svn-id: trunk@4288 -
This commit is contained in:
mattias 2003-06-19 09:26:58 +00:00
parent 85512fcfb5
commit d1bd70761c
2 changed files with 31 additions and 14 deletions

View File

@ -155,7 +155,7 @@ type
procedure IgnoreCurrentFileDateOnDisk;
procedure IncreaseAutoRevertLock;
procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string);
procedure ReadUnitNameFromSource;
procedure ReadUnitNameFromSource(TryCache: boolean);
function CreateUnitName: string;
procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string);
procedure UpdateUsageCount(Min, IfBelowThis, IncIfBelow: extended);
@ -359,7 +359,7 @@ type
procedure GetUnitsChangedOnDisk(var AnUnitList: TList);
function ReadProject(const LPIFilename: string): TModalResult;
function WriteProject(ProjectWriteFlags: TProjectWriteFlags;
const OverrideProjectInfoFile: string): TModalResult;
const OverrideProjectInfoFile: string): TModalResult;
// units
function UnitCount:integer;
@ -662,8 +662,17 @@ begin
Result:=mrOk;
end;
procedure TUnitInfo.ReadUnitNameFromSource;
procedure TUnitInfo.ReadUnitNameFromSource(TryCache: boolean);
var
NewUnitName: String;
begin
if TryCache then begin
NewUnitName:=CodeToolBoss.GetCachedSourceName(Source);
if NewUnitName<>'' then begin
fUnitName:=NewUnitName;
exit;
end;
end;
fUnitName:=CodeToolBoss.GetSourceName(fSource,false);
end;
@ -2155,14 +2164,12 @@ begin
if Load then begin
// make filename absolute
if (AFilename<>'') and (not FilenameIsAbsolute(AFilename)) then
AFilename:=ProjectPath+AFilename;
AFilename:=TrimFilename(ProjectPath+AFilename);
end else begin
// try making filename relative to project file
if (AFilename<>'') and FilenameIsAbsolute(AFilename)
and (CompareFileNames(copy(AFilename,1,length(ProjectPath)),ProjectPath)=0)
then
AFilename:=copy(AFilename,length(ProjectPath)+1,
length(AFilename)-length(ProjectPath));
and FileIsInPath(AFilename,ProjectPath) then
AFilename:=CreateRelativePath(AFilename,ProjectPath);
end;
end;
@ -2647,6 +2654,9 @@ end.
{
$Log$
Revision 1.129 2003/06/19 09:26:58 mattias
fixed changing unitname during update
Revision 1.128 2003/06/08 11:05:45 mattias
implemented filename case check before adding to project

View File

@ -113,7 +113,7 @@ begin
// create as many TRadioButton as needed
while (FButtonList.Count<FItems.Count) do begin
Temp := TRadioButton.Create (self);
Temp := TRadioButton.Create(Self);
Temp.Name:='RadioButton'+IntToStr(FButtonList.Count);
Temp.AutoSize := False;
Temp.OnClick := @Clicked;
@ -138,7 +138,8 @@ begin
for i:=0 to FItems.Count-1 do begin
Temp := TRadioButton(FButtonList[i]);
Temp.Caption := FItems[i];
Temp.Parent := Self;
Temp.Parent:=Self;
Temp.SetZOrder(false);
end;
with FHiddenButton do begin
FHiddenButton.Visible:=false;
@ -156,7 +157,7 @@ begin
FHiddenButton.Checked:=(fItemIndex=-1);
end;
//writeln('[TCustomRadioGroup.CreateWnd] F ',Name,':',ClassName,' FItems.Count=',FItems.Count,' HandleAllocated=',HandleAllocated,' ItemIndex=',ItemIndex);
FCreatingWnd := false;
end;
@ -179,7 +180,8 @@ end;
------------------------------------------------------------------------------}
procedure TCustomRadioGroup.ItemsChanged (Sender : TObject);
begin
if HandleAllocated then RecreateWnd;
if HandleAllocated and (csLoading in ComponentState) then
RecreateWnd;
OwnerFormDesignerModified(Self);
end;
@ -199,7 +201,8 @@ begin
if (Value < 1)
then raise Exception.Create('TCustomRadioGroup: Columns must be >= 1');
FColumns := Value;
if HandleAllocated then RecreateWnd;
if HandleAllocated and (csLoading in ComponentState) then
RecreateWnd;
end;
end;
@ -215,7 +218,8 @@ begin
if (Value <> FItems) then
begin
FItems.Assign(Value);
if HandleAllocated then RecreateWnd;
if HandleAllocated and (csLoading in ComponentState) then
RecreateWnd;
end;
end;
@ -376,6 +380,9 @@ end;
{
$Log$
Revision 1.21 2003/06/19 09:26:58 mattias
fixed changing unitname during update
Revision 1.20 2003/03/17 23:39:30 mattias
added TCheckGroup