mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-03 06:40:26 +02:00
IDE: TUnitInfo.Modified now checks Source.ChangeStep
git-svn-id: trunk@13042 -
This commit is contained in:
parent
d6c8262c2a
commit
7187688e75
@ -158,11 +158,13 @@ type
|
||||
fUnitName: String;
|
||||
fUsageCount: extended;
|
||||
fUserReadOnly: Boolean;
|
||||
fSourceChangeStep: LongInt;
|
||||
FSourceDirectoryReferenced: boolean;
|
||||
FSourceDirNeedReference: boolean;
|
||||
fLastDirectoryReferenced: string;
|
||||
|
||||
function GetHasResources:boolean;
|
||||
function GetModified: boolean;
|
||||
function GetNextAutoRevertLockedUnit: TUnitInfo;
|
||||
function GetNextLoadedUnit: TUnitInfo;
|
||||
function GetNextPartOfProject: TUnitInfo;
|
||||
@ -179,6 +181,7 @@ type
|
||||
procedure SetFileReadOnly(const AValue: Boolean);
|
||||
procedure SetComponent(const AValue: TComponent);
|
||||
procedure SetLoaded(const AValue: Boolean);
|
||||
procedure SetModified(const AValue: boolean);
|
||||
procedure SetProject(const AValue: TProject);
|
||||
procedure SetRunFileIfActive(const AValue: boolean);
|
||||
procedure SetSessionModified(const AValue: boolean);
|
||||
@ -272,7 +275,7 @@ type
|
||||
property HasResources: boolean read GetHasResources write fHasResources;
|
||||
property Loaded: Boolean read fLoaded write SetLoaded;
|
||||
property LoadingComponent: boolean read FLoadingComponent write FLoadingComponent;
|
||||
property Modified: boolean read fModified write fModified;// not Session data
|
||||
property Modified: boolean read GetModified write SetModified;// not Session data
|
||||
property SessionModified: boolean read FSessionModified write SetSessionModified;
|
||||
property OnFileBackup: TOnFileBackup read fOnFileBackup write fOnFileBackup;
|
||||
property OnLoadSaveFilename: TOnLoadSaveFilename
|
||||
@ -970,8 +973,8 @@ begin
|
||||
FIgnoreFileDateOnDiskValid := false;
|
||||
fAutoReferenceSourceDir := true;
|
||||
inherited SetIsPartOfProject(false);
|
||||
fModified := false;
|
||||
FSessionModified := false;
|
||||
Modified := false;
|
||||
SessionModified := false;
|
||||
FRunFileIfActive:=false;
|
||||
fSyntaxHighlighter := lshText;
|
||||
fTopLine := -1;
|
||||
@ -1366,6 +1369,7 @@ begin
|
||||
fSource:=ABuffer;
|
||||
FIgnoreFileDateOnDiskValid:=false;
|
||||
if (fSource<>nil) then begin
|
||||
fSourceChangeStep:=FSource.ChangeStep;
|
||||
if IsAutoRevertLocked then
|
||||
fSource.LockAutoDiskRevert;
|
||||
SetInternalFilename(fSource.FileName);
|
||||
@ -1405,6 +1409,13 @@ begin
|
||||
Result:=fHasResources or (ComponentName<>'');
|
||||
end;
|
||||
|
||||
function TUnitInfo.GetModified: boolean;
|
||||
begin
|
||||
if (not fModified) and (Source<>nil) then
|
||||
fModified:=Source.ChangeStep<>fSourceChangeStep;
|
||||
Result:=fModified;
|
||||
end;
|
||||
|
||||
function TUnitInfo.GetNextAutoRevertLockedUnit: TUnitInfo;
|
||||
begin
|
||||
Result:=fNext[uilAutoRevertLocked];
|
||||
@ -1524,6 +1535,16 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TUnitInfo.SetModified(const AValue: boolean);
|
||||
begin
|
||||
if fModified=AValue then exit;
|
||||
fModified:=AValue;
|
||||
if not fModified then begin
|
||||
if Source<>nil then
|
||||
fSourceChangeStep:=Source.ChangeStep;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TUnitInfo.SetProject(const AValue: TProject);
|
||||
var
|
||||
ListType: TUnitInfoList;
|
||||
@ -2516,6 +2537,7 @@ begin
|
||||
CompilerOptions.Modified:=false;
|
||||
SessionModified:=false;
|
||||
VersionInfo.Modified:=false;
|
||||
XPManifest.Modified:=false;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -2525,10 +2547,6 @@ begin
|
||||
inherited SetSessionModified(AValue);
|
||||
end;
|
||||
|
||||
//function TProject.GetVersionInfo: TVersionInfo;
|
||||
//begin
|
||||
//end;
|
||||
|
||||
function TProject.UnitCount:integer;
|
||||
begin
|
||||
Result:=FUnitList.Count;
|
||||
|
@ -455,14 +455,12 @@ begin
|
||||
if ModalResult = mrOk then
|
||||
begin
|
||||
|
||||
with Project do
|
||||
begin
|
||||
Title := TitleEdit.Text;
|
||||
TargetFilename := TargetFileEdit.Text;
|
||||
UseAppBundle := UseAppBundleCheckBox.Checked;
|
||||
XPManifest.UseManifest := UseXPManifestCheckBox.Checked;
|
||||
XPManifest.UpdateMainSourceFile(Project.MainFilename);
|
||||
end;
|
||||
Project.Title := TitleEdit.Text;
|
||||
Project.TargetFilename := TargetFileEdit.Text;
|
||||
Project.UseAppBundle := UseAppBundleCheckBox.Checked;
|
||||
Project.XPManifest.UseManifest := UseXPManifestCheckBox.Checked;
|
||||
if Project.XPManifest.Modified then
|
||||
Project.XPManifest.UpdateMainSourceFile(Project.MainFilename);
|
||||
|
||||
// flags
|
||||
NewFlags := Project.Flags;
|
||||
@ -544,10 +542,10 @@ procedure TProjectOptionsDialog.AdditionalInfoButtonClick(Sender: TObject);
|
||||
var
|
||||
InfoModified: Boolean;
|
||||
begin
|
||||
InfoModified:=false;
|
||||
ShowVersionInfoAdditionailInfoForm(Project.VersionInfo,InfoModified);
|
||||
if InfoModified then
|
||||
Project.Modified:=InfoModified;
|
||||
InfoModified:=false;
|
||||
ShowVersionInfoAdditionailInfoForm(Project.VersionInfo,InfoModified);
|
||||
if InfoModified then
|
||||
Project.Modified:=true;
|
||||
end;
|
||||
|
||||
procedure TProjectOptionsDialog.EnableI18NCheckBoxChange(Sender: TObject);
|
||||
|
@ -43,6 +43,7 @@ type
|
||||
TProjectXPManifest = class(TObject)
|
||||
private
|
||||
FMessages: TStrings;
|
||||
FModified: boolean;
|
||||
FUseManifest: boolean;
|
||||
resFilename: string;
|
||||
procedure SetUseManifest(const AValue: boolean);
|
||||
@ -57,6 +58,7 @@ type
|
||||
|
||||
property Messages: TStrings read FMessages;
|
||||
property UseManifest: boolean read FUseManifest write SetUseManifest;
|
||||
property Modified: boolean read FModified write FModified;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -109,7 +111,9 @@ end;
|
||||
|
||||
procedure TProjectXPManifest.SetUseManifest(const AValue: boolean);
|
||||
begin
|
||||
if FUseManifest = AValue then exit;
|
||||
FUseManifest := AValue;
|
||||
Modified:=true;
|
||||
end;
|
||||
|
||||
{-----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user