fixed invalidating file references, when it was never valid

git-svn-id: trunk@9444 -
This commit is contained in:
mattias 2006-06-18 19:52:01 +00:00
parent 2f5b6755ce
commit bf9d40f2ea
3 changed files with 10 additions and 7 deletions

View File

@ -86,6 +86,7 @@ type
function CreateFileList: TStringList;
property TimeStamp: integer read FTimeStamp;
property OnChanged: TNotifyEvent read FOnChanged write FOnChanged;
property UpdateLock: integer read FUpdateLock;
end;
implementation
@ -175,7 +176,6 @@ end;
procedure TFileReferenceList.Invalidate;
begin
IncreaseTimeStamp;
if not (frfSearchPathValid in FFlags) then exit;
Exclude(FFlags,frfSearchPathValid);
if FUpdateLock>0 then
Include(FFlags,frfChanged)
@ -211,7 +211,7 @@ end;
procedure TFileReferenceList.EndUpdate;
begin
if FUpdateLock=0 then RaiseException('TFileReferenceList.EndUpdate');
if FUpdateLock<=0 then RaiseException('TFileReferenceList.EndUpdate');
dec(FUpdateLock);
if (frfChanged in FFlags) then begin
Exclude(FFlags,frfChanged);

View File

@ -4918,13 +4918,16 @@ function TMainIDE.CreateProjectObject(ProjectDesc,
begin
Result:=TProject.Create(ProjectDesc);
// custom initialization
Result.BeginUpdate(true);
if ProjectDesc.InitProject(Result)<>mrOk then begin
Result.EndUpdate;
Result.Free;
Result:=nil;
if FallbackProjectDesc=nil then exit;
Result:=TProject.Create(FallbackProjectDesc);
FallbackProjectDesc.InitProject(Result);
end;
Result.EndUpdate;
Result.MainProject:=true;
Result.OnFileBackup:=@DoBackupFile;

View File

@ -1204,15 +1204,15 @@ begin
if FSourceDirNeedReference then begin
if not SourceDirectoryReferenced then begin
fLastDirectoryReferenced:=GetDirectory;
Project.SourceDirectories.AddFilename(fLastDirectoryReferenced);
//DebugLn('TUnitInfo.UpdateSourceDirectoryReference ADD File="',Filename,' Path="',Project.SourceDirectories.CreateSearchPathFromAllFiles,'"');
//DebugLn('TUnitInfo.UpdateSourceDirectoryReference ADD File="',Filename,'" Project.SourceDirectories.TimeStamp=',dbgs(Project.SourceDirectories.TimeStamp));
FSourceDirectoryReferenced:=true;
Project.SourceDirectories.AddFilename(fLastDirectoryReferenced);
end;
end else begin
if SourceDirectoryReferenced then begin
Project.SourceDirectories.RemoveFilename(fLastDirectoryReferenced);
//DebugLn('TUnitInfo.UpdateSourceDirectoryReference REMOVE File="',Filename,' Path="',Project.SourceDirectories.CreateSearchPathFromAllFiles,'"');
//DebugLn('TUnitInfo.UpdateSourceDirectoryReference REMOVE File="',Filename,'" Project.SourceDirectories.TimeStamp=',dbgs(Project.SourceDirectories.TimeStamp));
FSourceDirectoryReferenced:=false;
Project.SourceDirectories.RemoveFilename(fLastDirectoryReferenced);
end;
end;
end;
@ -1976,7 +1976,7 @@ begin
SessionStorage:=StrToProjectSessionStorage(
XMLConfig.GetValue(Path+'General/SessionStorage/Value',
ProjectSessionStorageNames[pssInProjectInfo]));
DebugLn('TProject.ReadProject SessionStorage=',dbgs(ord(SessionStorage)),' ProjectSessionFile=',ProjectSessionFile);
//DebugLn('TProject.ReadProject SessionStorage=',dbgs(ord(SessionStorage)),' ProjectSessionFile=',ProjectSessionFile);
NewMainUnitID := xmlconfig.GetValue(Path+'General/MainUnit/Value', -1);
AutoCreateForms := xmlconfig.GetValue(