mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-03 18:01:29 +02:00
IDE: Join boolean variables of TUnitInfo into FFlags set.
This commit is contained in:
parent
fe828040ce
commit
63bee05d67
321
ide/project.pp
321
ide/project.pp
@ -163,10 +163,24 @@ type
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
TUnitInfoFlag = (
|
TUnitInfoFlag = (
|
||||||
|
uifAutoReferenceSourceDir,
|
||||||
|
uifBuildFileIfActive,
|
||||||
uifComponentUsedByDesigner,
|
uifComponentUsedByDesigner,
|
||||||
uifComponentIndirectlyUsedByDesigner,
|
uifComponentIndirectlyUsedByDesigner,
|
||||||
|
uifCustomDefaultHighlighter,
|
||||||
|
uifDisableI18NForLFM,
|
||||||
|
uifFileReadOnly,
|
||||||
|
uifHasErrorInLFM,
|
||||||
|
uifHasResources, // source has resource file
|
||||||
|
uifInternalFile, // data from an internal source (e.g. an editor macro (pascal script) from memory)
|
||||||
|
uifLoaded, // loaded in the source editor, needed to restore open files
|
||||||
|
uifLoadedDesigner, // has a visible designer, needed to restore open designers
|
||||||
|
uifLoadingComponent,
|
||||||
uifMarked,
|
uifMarked,
|
||||||
uifInternalFile // data from an internal source (e.g. an editor macro (pascal script) from memory)
|
uifModified,
|
||||||
|
uifRunFileIfActive,
|
||||||
|
uifSessionModified,
|
||||||
|
uifUserReadOnly
|
||||||
);
|
);
|
||||||
TUnitInfoFlags = set of TUnitInfoFlag;
|
TUnitInfoFlags = set of TUnitInfoFlag;
|
||||||
|
|
||||||
@ -256,14 +270,10 @@ type
|
|||||||
private
|
private
|
||||||
FComponentTypesToClasses: TStringToPointerTree;
|
FComponentTypesToClasses: TStringToPointerTree;
|
||||||
FComponentVarsToClasses: TStringToPointerTree;
|
FComponentVarsToClasses: TStringToPointerTree;
|
||||||
FCustomDefaultHighlighter: boolean;
|
|
||||||
FDefaultSyntaxHighlighter: TLazSyntaxHighlighter;
|
FDefaultSyntaxHighlighter: TLazSyntaxHighlighter;
|
||||||
FDisableI18NForLFM: boolean;
|
|
||||||
FEditorInfoList: TUnitEditorInfoList;
|
FEditorInfoList: TUnitEditorInfoList;
|
||||||
FAutoReferenceSourceDir: boolean;
|
|
||||||
fAutoRevertLockCount: integer;// =0 means, codetools can auto update from disk
|
fAutoRevertLockCount: integer;// =0 means, codetools can auto update from disk
|
||||||
fBookmarks: TFileBookmarks;
|
fBookmarks: TFileBookmarks;
|
||||||
FBuildFileIfActive: boolean;
|
|
||||||
fComponent: TComponent;
|
fComponent: TComponent;
|
||||||
FComponentState: TWindowState; // state of component when we save it
|
FComponentState: TWindowState; // state of component when we save it
|
||||||
FResourceBaseClass: TPFComponentBaseClass;
|
FResourceBaseClass: TPFComponentBaseClass;
|
||||||
@ -277,38 +287,37 @@ type
|
|||||||
FComponentLastLRSStreamSize: TStreamSeekType;
|
FComponentLastLRSStreamSize: TStreamSeekType;
|
||||||
FDirectives: TStrings;
|
FDirectives: TStrings;
|
||||||
fFileName: string; // with path = saved, without path = not yet saved
|
fFileName: string; // with path = saved, without path = not yet saved
|
||||||
fFileReadOnly: Boolean;
|
|
||||||
FFirstRequiredComponent: TUnitComponentDependency;
|
FFirstRequiredComponent: TUnitComponentDependency;
|
||||||
FFirstUsedByComponent: TUnitComponentDependency;
|
FFirstUsedByComponent: TUnitComponentDependency;
|
||||||
FFlags: TUnitInfoFlags;
|
FFlags: TUnitInfoFlags;
|
||||||
fHasResources: boolean; // source has resource file
|
|
||||||
fLoaded: Boolean; // loaded in the source editor, needed to restore open files
|
|
||||||
fLoadedDesigner: Boolean; // has a visible designer, needed to restore open designers
|
|
||||||
FLoadingComponent: boolean;
|
|
||||||
fHasErrorInLFM: boolean;
|
|
||||||
fModified: boolean;
|
|
||||||
fNext, fPrev: array[TUnitInfoList] of TUnitInfo;
|
fNext, fPrev: array[TUnitInfoList] of TUnitInfo;
|
||||||
fOnFileBackup: TOnFileBackup;
|
fOnFileBackup: TOnFileBackup;
|
||||||
fOnLoadSaveFilename: TOnLoadSaveFilename;
|
fOnLoadSaveFilename: TOnLoadSaveFilename;
|
||||||
FOnUnitNameChange: TOnUnitNameChange;
|
FOnUnitNameChange: TOnUnitNameChange;
|
||||||
FProject: TProject;
|
FProject: TProject;
|
||||||
FRevertLockCount: integer;// >0 means IDE is currently reverting this unit
|
FRevertLockCount: integer;// >0 means IDE is currently reverting this unit
|
||||||
FRunFileIfActive: boolean;
|
|
||||||
FSessionModified: boolean;
|
|
||||||
fSource: TCodeBuffer;
|
fSource: TCodeBuffer;
|
||||||
FSourceLFM: TCodeBuffer;
|
FSourceLFM: TCodeBuffer;
|
||||||
fUsageCount: extended;
|
fUsageCount: extended;
|
||||||
fUserReadOnly: Boolean;
|
|
||||||
fSourceChangeStep: LongInt;
|
fSourceChangeStep: LongInt;
|
||||||
FSourceDirectoryReferenced: boolean;
|
FSourceDirectoryReferenced: boolean;
|
||||||
FSourceDirNeedReference: boolean;
|
|
||||||
fLastDirectoryReferenced: string;
|
fLastDirectoryReferenced: string;
|
||||||
FSetBookmarLock: Integer;
|
FSetBookmarLock: Integer;
|
||||||
FUnitResourceFileformat: TUnitResourcefileFormatClass;
|
FUnitResourceFileformat: TUnitResourcefileFormatClass;
|
||||||
|
|
||||||
function ComponentLFMOnDiskHasChanged: boolean;
|
function ComponentLFMOnDiskHasChanged: boolean;
|
||||||
|
function GetAutoReferenceSourceDir: boolean;
|
||||||
|
function GetBuildFileIfActive: boolean;
|
||||||
|
function GetCustomDefaultHighlighter: boolean;
|
||||||
|
function GetDisableI18NForLFM: boolean;
|
||||||
function GetEditorInfo(Index: Integer): TUnitEditorInfo;
|
function GetEditorInfo(Index: Integer): TUnitEditorInfo;
|
||||||
|
function GetFileReadOnly: Boolean;
|
||||||
|
function GetHasErrorInLFM: boolean;
|
||||||
function GetHasResources: boolean;
|
function GetHasResources: boolean;
|
||||||
|
function GetInternalFile: boolean;
|
||||||
|
function GetLoaded: Boolean;
|
||||||
|
function GetLoadedDesigner: Boolean;
|
||||||
|
function GetLoadingComponent: boolean;
|
||||||
function GetModified: boolean;
|
function GetModified: boolean;
|
||||||
function GetNextAutoRevertLockedUnit: TUnitInfo;
|
function GetNextAutoRevertLockedUnit: TUnitInfo;
|
||||||
function GetNextLoadedUnit: TUnitInfo;
|
function GetNextLoadedUnit: TUnitInfo;
|
||||||
@ -321,17 +330,23 @@ type
|
|||||||
function GetPrevPartOfProject: TUnitInfo;
|
function GetPrevPartOfProject: TUnitInfo;
|
||||||
function GetPrevUnitWithComponent: TUnitInfo;
|
function GetPrevUnitWithComponent: TUnitInfo;
|
||||||
function GetPrevUnitWithEditorIndex: TUnitInfo;
|
function GetPrevUnitWithEditorIndex: TUnitInfo;
|
||||||
|
function GetRunFileIfActive: boolean;
|
||||||
|
function GetSessionModified: boolean;
|
||||||
function GetUnitResourceFileformat: TUnitResourcefileFormatClass;
|
function GetUnitResourceFileformat: TUnitResourcefileFormatClass;
|
||||||
|
function GetUserReadOnly: Boolean;
|
||||||
procedure SetAutoReferenceSourceDir(const AValue: boolean);
|
procedure SetAutoReferenceSourceDir(const AValue: boolean);
|
||||||
procedure SetBuildFileIfActive(const AValue: boolean);
|
procedure SetBuildFileIfActive(const AValue: boolean);
|
||||||
|
procedure SetCustomDefaultHighlighter(AValue: boolean);
|
||||||
procedure SetDefaultSyntaxHighlighter(const AValue: TLazSyntaxHighlighter);
|
procedure SetDefaultSyntaxHighlighter(const AValue: TLazSyntaxHighlighter);
|
||||||
procedure SetDirectives(const AValue: TStrings);
|
|
||||||
procedure SetDisableI18NForLFM(const AValue: boolean);
|
procedure SetDisableI18NForLFM(const AValue: boolean);
|
||||||
procedure SetFileReadOnly(const AValue: Boolean);
|
procedure SetFileReadOnly(const AValue: Boolean);
|
||||||
procedure SetComponent(const AValue: TComponent);
|
procedure SetComponent(const AValue: TComponent);
|
||||||
procedure SetHasErrorInLFM(AValue: boolean);
|
procedure SetHasErrorInLFM(AValue: boolean);
|
||||||
|
procedure SetHasResources(AValue: boolean);
|
||||||
|
procedure SetInternalFile(AValue: boolean);
|
||||||
procedure SetLoaded(const AValue: Boolean);
|
procedure SetLoaded(const AValue: Boolean);
|
||||||
procedure SetLoadedDesigner(const AValue: Boolean);
|
procedure SetLoadedDesigner(const AValue: Boolean);
|
||||||
|
procedure SetLoadingComponent(AValue: boolean);
|
||||||
procedure SetModified(const AValue: boolean);
|
procedure SetModified(const AValue: boolean);
|
||||||
procedure SetProject(const AValue: TProject);
|
procedure SetProject(const AValue: TProject);
|
||||||
procedure SetRunFileIfActive(const AValue: boolean);
|
procedure SetRunFileIfActive(const AValue: boolean);
|
||||||
@ -437,7 +452,7 @@ type
|
|||||||
property PrevPartOfProject: TUnitInfo read GetPrevPartOfProject;
|
property PrevPartOfProject: TUnitInfo read GetPrevPartOfProject;
|
||||||
public
|
public
|
||||||
property Bookmarks: TFileBookmarks read FBookmarks write FBookmarks;
|
property Bookmarks: TFileBookmarks read FBookmarks write FBookmarks;
|
||||||
property BuildFileIfActive: boolean read FBuildFileIfActive
|
property BuildFileIfActive: boolean read GetBuildFileIfActive
|
||||||
write SetBuildFileIfActive;
|
write SetBuildFileIfActive;
|
||||||
property Component: TComponent read fComponent write SetComponent;
|
property Component: TComponent read fComponent write SetComponent;
|
||||||
property ComponentName: string read fComponentName write fComponentName;
|
property ComponentName: string read fComponentName write fComponentName;
|
||||||
@ -457,36 +472,34 @@ type
|
|||||||
property ComponentLastLFMStreamSize: TStreamSeekType
|
property ComponentLastLFMStreamSize: TStreamSeekType
|
||||||
read FComponentLastLFMStreamSize write FComponentLastLFMStreamSize;
|
read FComponentLastLFMStreamSize write FComponentLastLFMStreamSize;
|
||||||
property CustomDefaultHighlighter: boolean
|
property CustomDefaultHighlighter: boolean
|
||||||
read FCustomDefaultHighlighter write FCustomDefaultHighlighter;
|
read GetCustomDefaultHighlighter write SetCustomDefaultHighlighter;
|
||||||
property Directives: TStrings read FDirectives write SetDirectives;
|
property Directives: TStrings read FDirectives write FDirectives;
|
||||||
property DisableI18NForLFM: boolean read FDisableI18NForLFM write SetDisableI18NForLFM;
|
property DisableI18NForLFM: boolean read GetDisableI18NForLFM write SetDisableI18NForLFM;
|
||||||
property FileReadOnly: Boolean read fFileReadOnly write SetFileReadOnly;
|
property FileReadOnly: Boolean read GetFileReadOnly write SetFileReadOnly;
|
||||||
property FirstRequiredComponent: TUnitComponentDependency
|
property FirstRequiredComponent: TUnitComponentDependency read FFirstRequiredComponent;
|
||||||
read FFirstRequiredComponent;
|
property FirstUsedByComponent: TUnitComponentDependency read FFirstUsedByComponent;
|
||||||
property FirstUsedByComponent: TUnitComponentDependency
|
property Flags: TUnitInfoFlags read FFlags;
|
||||||
read FFirstUsedByComponent;
|
property HasErrorInLFM: boolean read GetHasErrorInLFM write SetHasErrorInLFM;
|
||||||
property Flags: TUnitInfoFlags read FFlags write FFlags;
|
property HasResources: boolean read GetHasResources write SetHasResources;
|
||||||
property HasResources: boolean read GetHasResources write fHasResources;
|
property InternalFile: boolean read GetInternalFile write SetInternalFile;
|
||||||
property Loaded: Boolean read fLoaded write SetLoaded;
|
property Loaded: Boolean read GetLoaded write SetLoaded;
|
||||||
property LoadedDesigner: Boolean read fLoadedDesigner write SetLoadedDesigner;
|
property LoadedDesigner: Boolean read GetLoadedDesigner write SetLoadedDesigner;
|
||||||
property LoadingComponent: boolean read FLoadingComponent write FLoadingComponent;
|
property LoadingComponent: boolean read GetLoadingComponent write SetLoadingComponent;
|
||||||
property HasErrorInLFM: boolean read fHasErrorInLFM write SetHasErrorInLFM;
|
|
||||||
property Modified: boolean read GetModified write SetModified;// not Session data
|
property Modified: boolean read GetModified write SetModified;// not Session data
|
||||||
property SessionModified: boolean read FSessionModified write SetSessionModified;
|
property SessionModified: boolean read GetSessionModified write SetSessionModified;
|
||||||
property OnFileBackup: TOnFileBackup read fOnFileBackup write fOnFileBackup;
|
property OnFileBackup: TOnFileBackup read fOnFileBackup write fOnFileBackup;
|
||||||
property OnLoadSaveFilename: TOnLoadSaveFilename
|
property OnLoadSaveFilename: TOnLoadSaveFilename
|
||||||
read fOnLoadSaveFilename write fOnLoadSaveFilename;
|
read fOnLoadSaveFilename write fOnLoadSaveFilename;
|
||||||
property OnUnitNameChange: TOnUnitNameChange
|
property OnUnitNameChange: TOnUnitNameChange
|
||||||
read FOnUnitNameChange write FOnUnitNameChange;
|
read FOnUnitNameChange write FOnUnitNameChange;
|
||||||
property Project: TProject read FProject write SetProject;
|
property Project: TProject read FProject write SetProject;
|
||||||
property RunFileIfActive: boolean read FRunFileIfActive write SetRunFileIfActive;
|
property RunFileIfActive: boolean read GetRunFileIfActive write SetRunFileIfActive;
|
||||||
property Source: TCodeBuffer read fSource write SetSource;
|
property Source: TCodeBuffer read fSource write SetSource;
|
||||||
property SourceLFM: TCodeBuffer read FSourceLFM write SetSourceLFM;
|
property SourceLFM: TCodeBuffer read FSourceLFM write SetSourceLFM;
|
||||||
property DefaultSyntaxHighlighter: TLazSyntaxHighlighter
|
property DefaultSyntaxHighlighter: TLazSyntaxHighlighter
|
||||||
read FDefaultSyntaxHighlighter write SetDefaultSyntaxHighlighter;
|
read FDefaultSyntaxHighlighter write SetDefaultSyntaxHighlighter;
|
||||||
property UserReadOnly: Boolean read fUserReadOnly write SetUserReadOnly;
|
property UserReadOnly: Boolean read GetUserReadOnly write SetUserReadOnly;
|
||||||
property SourceDirectoryReferenced: boolean read FSourceDirectoryReferenced;
|
property AutoReferenceSourceDir: boolean read GetAutoReferenceSourceDir
|
||||||
property AutoReferenceSourceDir: boolean read FAutoReferenceSourceDir
|
|
||||||
write SetAutoReferenceSourceDir;
|
write SetAutoReferenceSourceDir;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1747,26 +1760,26 @@ procedure TUnitInfo.Clear;
|
|||||||
begin
|
begin
|
||||||
FBookmarks.Clear;
|
FBookmarks.Clear;
|
||||||
FSetBookmarLock := 0;
|
FSetBookmarLock := 0;
|
||||||
FBuildFileIfActive:=false;
|
BuildFileIfActive:=false;
|
||||||
fComponent := nil;
|
fComponent := nil;
|
||||||
fComponentName := '';
|
fComponentName := '';
|
||||||
fComponentResourceName := '';
|
fComponentResourceName := '';
|
||||||
FComponentState := wsNormal;
|
FComponentState := wsNormal;
|
||||||
FDefaultSyntaxHighlighter := lshText;
|
FDefaultSyntaxHighlighter := lshText;
|
||||||
FDisableI18NForLFM:=false;
|
DisableI18NForLFM:=false;
|
||||||
FCustomDefaultHighlighter := False;
|
CustomDefaultHighlighter := False;
|
||||||
FEditorInfoList.ClearEachInfo;
|
FEditorInfoList.ClearEachInfo;
|
||||||
fFilename := '';
|
fFilename := '';
|
||||||
fFileReadOnly := false;
|
FileReadOnly := false;
|
||||||
fHasResources := false;
|
HasResources := false;
|
||||||
fAutoReferenceSourceDir := true;
|
AutoReferenceSourceDir := true;
|
||||||
inherited SetIsPartOfProject(false);
|
inherited SetIsPartOfProject(false);
|
||||||
Modified := false;
|
Modified := false;
|
||||||
SessionModified := false;
|
SessionModified := false;
|
||||||
FRunFileIfActive:=false;
|
RunFileIfActive:=false;
|
||||||
FUnitName := '';
|
FUnitName := '';
|
||||||
fUsageCount:=-1;
|
fUsageCount:=-1;
|
||||||
fUserReadOnly := false;
|
UserReadOnly := false;
|
||||||
if fSource<>nil then fSource.Clear;
|
if fSource<>nil then fSource.Clear;
|
||||||
Loaded := false;
|
Loaded := false;
|
||||||
LoadedDesigner := false;
|
LoadedDesigner := false;
|
||||||
@ -1833,13 +1846,13 @@ begin
|
|||||||
if SaveSession and Assigned(Project.OnSaveUnitSessionInfo) then
|
if SaveSession and Assigned(Project.OnSaveUnitSessionInfo) then
|
||||||
Project.OnSaveUnitSessionInfo(Self);
|
Project.OnSaveUnitSessionInfo(Self);
|
||||||
if IsPartOfProject and SaveData then
|
if IsPartOfProject and SaveData then
|
||||||
XMLConfig.SetDeleteValue(Path+'DisableI18NForLFM/Value',FDisableI18NForLFM,false);
|
XMLConfig.SetDeleteValue(Path+'DisableI18NForLFM/Value',DisableI18NForLFM,false);
|
||||||
|
|
||||||
// context data (project/session)
|
// context data (project/session)
|
||||||
if (IsPartOfProject and SaveData) or ((not IsPartOfProject) and SaveSession)
|
if (IsPartOfProject and SaveData) or ((not IsPartOfProject) and SaveSession)
|
||||||
then begin
|
then begin
|
||||||
XMLConfig.SetDeleteValue(Path+'ComponentName/Value',fComponentName,'');
|
XMLConfig.SetDeleteValue(Path+'ComponentName/Value',fComponentName,'');
|
||||||
XMLConfig.SetDeleteValue(Path+'HasResources/Value',fHasResources,false);
|
XMLConfig.SetDeleteValue(Path+'HasResources/Value',uifHasResources in FFlags,false);
|
||||||
XMLConfig.SetDeleteValue(Path+'ResourceBaseClass/Value',
|
XMLConfig.SetDeleteValue(Path+'ResourceBaseClass/Value',
|
||||||
PFComponentBaseClassNames[FResourceBaseClass],
|
PFComponentBaseClassNames[FResourceBaseClass],
|
||||||
PFComponentBaseClassNames[pfcbcNone]);
|
PFComponentBaseClassNames[pfcbcNone]);
|
||||||
@ -1875,13 +1888,13 @@ begin
|
|||||||
BM.CursorPos := Point(X, Y);
|
BM.CursorPos := Point(X, Y);
|
||||||
end;
|
end;
|
||||||
FBookmarks.SaveToXMLConfig(XMLConfig,Path+'Bookmarks/');
|
FBookmarks.SaveToXMLConfig(XMLConfig,Path+'Bookmarks/');
|
||||||
XMLConfig.SetDeleteValue(Path+'Loaded/Value',fLoaded,false);
|
XMLConfig.SetDeleteValue(Path+'Loaded/Value',Loaded,false);
|
||||||
XMLConfig.SetDeleteValue(Path+'LoadedDesigner/Value',fLoadedDesigner,false);
|
XMLConfig.SetDeleteValue(Path+'LoadedDesigner/Value',LoadedDesigner,false);
|
||||||
XMLConfig.SetDeleteValue(Path+'ReadOnly/Value',fUserReadOnly,false);
|
XMLConfig.SetDeleteValue(Path+'ReadOnly/Value',UserReadOnly,false);
|
||||||
XMLConfig.SetDeleteValue(Path+'BuildFileIfActive/Value',
|
XMLConfig.SetDeleteValue(Path+'BuildFileIfActive/Value',
|
||||||
FBuildFileIfActive,false);
|
BuildFileIfActive,false);
|
||||||
XMLConfig.SetDeleteValue(Path+'RunFileIfActive/Value',
|
XMLConfig.SetDeleteValue(Path+'RunFileIfActive/Value',
|
||||||
FRunFileIfActive,false);
|
RunFileIfActive,false);
|
||||||
// save custom session data
|
// save custom session data
|
||||||
SaveStringToStringTree(XMLConfig,CustomSessionData,Path+'CustomSessionData/');
|
SaveStringToStringTree(XMLConfig,CustomSessionData,Path+'CustomSessionData/');
|
||||||
XMLConfig.SetDeleteValue(Path+'DefaultSyntaxHighlighter/Value',
|
XMLConfig.SetDeleteValue(Path+'DefaultSyntaxHighlighter/Value',
|
||||||
@ -1912,7 +1925,7 @@ begin
|
|||||||
if fComponentName='' then
|
if fComponentName='' then
|
||||||
fComponentName:=XMLConfig.GetValue(Path+'FormName/Value','');
|
fComponentName:=XMLConfig.GetValue(Path+'FormName/Value','');
|
||||||
FComponentState := TWindowState(XMLConfig.GetValue(Path+'ComponentState/Value',0));
|
FComponentState := TWindowState(XMLConfig.GetValue(Path+'ComponentState/Value',0));
|
||||||
FDisableI18NForLFM:=XMLConfig.GetValue(Path+'DisableI18NForLFM/Value',false);
|
DisableI18NForLFM:=XMLConfig.GetValue(Path+'DisableI18NForLFM/Value',false);
|
||||||
HasResources:=XMLConfig.GetValue(Path+'HasResources/Value',false);
|
HasResources:=XMLConfig.GetValue(Path+'HasResources/Value',false);
|
||||||
FResourceBaseClass:=StrToComponentBaseClass(
|
FResourceBaseClass:=StrToComponentBaseClass(
|
||||||
XMLConfig.GetValue(Path+'ResourceBaseClass/Value',''));
|
XMLConfig.GetValue(Path+'ResourceBaseClass/Value',''));
|
||||||
@ -1953,9 +1966,9 @@ begin
|
|||||||
LoadedDesigner:=XMLConfig.GetValue(Path+'LoadedDesigner/Value',FileVersion<8)
|
LoadedDesigner:=XMLConfig.GetValue(Path+'LoadedDesigner/Value',FileVersion<8)
|
||||||
else
|
else
|
||||||
LoadedDesigner:=false;
|
LoadedDesigner:=false;
|
||||||
fUserReadOnly:=XMLConfig.GetValue(Path+'ReadOnly/Value',false);
|
UserReadOnly:=XMLConfig.GetValue(Path+'ReadOnly/Value',false);
|
||||||
FBuildFileIfActive:=XMLConfig.GetValue(Path+'BuildFileIfActive/Value',false);
|
BuildFileIfActive:=XMLConfig.GetValue(Path+'BuildFileIfActive/Value',false);
|
||||||
FRunFileIfActive:=XMLConfig.GetValue(Path+'RunFileIfActive/Value',false);
|
RunFileIfActive:=XMLConfig.GetValue(Path+'RunFileIfActive/Value',false);
|
||||||
fUsageCount:=XMLConfig.GetValue(Path+'UsageCount/Value',-1);
|
fUsageCount:=XMLConfig.GetValue(Path+'UsageCount/Value',-1);
|
||||||
if fUsageCount<1 then begin
|
if fUsageCount<1 then begin
|
||||||
UpdateUsageCount(uuIsLoaded,1);
|
UpdateUsageCount(uuIsLoaded,1);
|
||||||
@ -2014,7 +2027,7 @@ begin
|
|||||||
//DebugLn('TUnitInfo.SetInternalFilename Old=',fFileName,' New=',NewFilename);
|
//DebugLn('TUnitInfo.SetInternalFilename Old=',fFileName,' New=',NewFilename);
|
||||||
|
|
||||||
// if directory changed then remove the old directory reference
|
// if directory changed then remove the old directory reference
|
||||||
if SourceDirectoryReferenced
|
if FSourceDirectoryReferenced
|
||||||
and (Project<>nil)
|
and (Project<>nil)
|
||||||
and (fLastDirectoryReferenced<>GetDirectory) then begin
|
and (fLastDirectoryReferenced<>GetDirectory) then begin
|
||||||
Project.SourceDirectories.RemoveFilename(fLastDirectoryReferenced);
|
Project.SourceDirectories.RemoveFilename(fLastDirectoryReferenced);
|
||||||
@ -2031,7 +2044,7 @@ procedure TUnitInfo.UpdateHasCustomHighlighter(aDefaultHighlighter: TLazSyntaxHi
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
FCustomDefaultHighlighter := FDefaultSyntaxHighlighter <> aDefaultHighlighter;
|
CustomDefaultHighlighter := FDefaultSyntaxHighlighter <> aDefaultHighlighter;
|
||||||
for i := 0 to FEditorInfoList.Count - 1 do
|
for i := 0 to FEditorInfoList.Count - 1 do
|
||||||
FEditorInfoList[i].CustomHighlighter :=
|
FEditorInfoList[i].CustomHighlighter :=
|
||||||
FEditorInfoList[i].SyntaxHighlighter <> aDefaultHighlighter;
|
FEditorInfoList[i].SyntaxHighlighter <> aDefaultHighlighter;
|
||||||
@ -2079,7 +2092,7 @@ var
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
//debugln(['TUnitInfo.UpdateDefaultHighlighter ',Filename,' ',ord(aDefaultHighlighter)]);
|
//debugln(['TUnitInfo.UpdateDefaultHighlighter ',Filename,' ',ord(aDefaultHighlighter)]);
|
||||||
if not FCustomDefaultHighlighter then
|
if not CustomDefaultHighlighter then
|
||||||
DefaultSyntaxHighlighter := aDefaultHighlighter
|
DefaultSyntaxHighlighter := aDefaultHighlighter
|
||||||
else
|
else
|
||||||
for i := 0 to FEditorInfoList.Count - 1 do
|
for i := 0 to FEditorInfoList.Count - 1 do
|
||||||
@ -2184,6 +2197,26 @@ begin
|
|||||||
if SourceLFM.FileOnDiskHasChanged then exit(true);
|
if SourceLFM.FileOnDiskHasChanged then exit(true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TUnitInfo.GetAutoReferenceSourceDir: boolean;
|
||||||
|
begin
|
||||||
|
Result:=uifAutoReferenceSourceDir in FFlags;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TUnitInfo.GetBuildFileIfActive: boolean;
|
||||||
|
begin
|
||||||
|
Result:=uifBuildFileIfActive in FFlags;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TUnitInfo.GetCustomDefaultHighlighter: boolean;
|
||||||
|
begin
|
||||||
|
Result:=uifCustomDefaultHighlighter in FFlags;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TUnitInfo.GetDisableI18NForLFM: boolean;
|
||||||
|
begin
|
||||||
|
Result:=uifDisableI18NForLFM in FFlags;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TUnitInfo.SetTimeStamps;
|
procedure TUnitInfo.SetTimeStamps;
|
||||||
begin
|
begin
|
||||||
if FSource<>nil then
|
if FSource<>nil then
|
||||||
@ -2243,17 +2276,16 @@ end;
|
|||||||
|
|
||||||
procedure TUnitInfo.UpdateSourceDirectoryReference;
|
procedure TUnitInfo.UpdateSourceDirectoryReference;
|
||||||
begin
|
begin
|
||||||
FSourceDirNeedReference:=IsPartOfProject and (FilenameIsPascalSource(Filename));
|
|
||||||
if (not AutoReferenceSourceDir) or (FProject=nil) then exit;
|
if (not AutoReferenceSourceDir) or (FProject=nil) then exit;
|
||||||
if FSourceDirNeedReference then begin
|
if IsPartOfProject and (FilenameIsPascalSource(Filename)) then begin
|
||||||
if not SourceDirectoryReferenced then begin
|
if not FSourceDirectoryReferenced then begin
|
||||||
fLastDirectoryReferenced:=GetDirectory;
|
fLastDirectoryReferenced:=GetDirectory;
|
||||||
//DebugLn('TUnitInfo.UpdateSourceDirectoryReference ADD File="',Filename,'" Project.SourceDirectories.TimeStamp=',dbgs(Project.SourceDirectories.TimeStamp));
|
//DebugLn('TUnitInfo.UpdateSourceDirectoryReference ADD File="',Filename,'" Project.SourceDirectories.TimeStamp=',dbgs(Project.SourceDirectories.TimeStamp));
|
||||||
FSourceDirectoryReferenced:=true;
|
FSourceDirectoryReferenced:=true;
|
||||||
Project.SourceDirectories.AddFilename(fLastDirectoryReferenced);
|
Project.SourceDirectories.AddFilename(fLastDirectoryReferenced);
|
||||||
end;
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
if SourceDirectoryReferenced then begin
|
if FSourceDirectoryReferenced then begin
|
||||||
//DebugLn('TUnitInfo.UpdateSourceDirectoryReference REMOVE File="',Filename,'" Project.SourceDirectories.TimeStamp=',dbgs(Project.SourceDirectories.TimeStamp));
|
//DebugLn('TUnitInfo.UpdateSourceDirectoryReference REMOVE File="',Filename,'" Project.SourceDirectories.TimeStamp=',dbgs(Project.SourceDirectories.TimeStamp));
|
||||||
FSourceDirectoryReferenced:=false;
|
FSourceDirectoryReferenced:=false;
|
||||||
Project.SourceDirectories.RemoveFilename(fLastDirectoryReferenced);
|
Project.SourceDirectories.RemoveFilename(fLastDirectoryReferenced);
|
||||||
@ -2455,24 +2487,57 @@ end;
|
|||||||
|
|
||||||
procedure TUnitInfo.SetUserReadOnly(const NewValue: boolean);
|
procedure TUnitInfo.SetUserReadOnly(const NewValue: boolean);
|
||||||
begin
|
begin
|
||||||
fUserReadOnly:=NewValue;
|
if NewValue then
|
||||||
|
Include(FFlags, uifUserReadOnly)
|
||||||
|
else
|
||||||
|
Exclude(FFlags, uifUserReadOnly);
|
||||||
if fSource<>nil then
|
if fSource<>nil then
|
||||||
fSource.ReadOnly:=ReadOnly;
|
fSource.ReadOnly:=ReadOnly;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TUnitInfo.GetHasResources:boolean;
|
function TUnitInfo.GetHasResources:boolean;
|
||||||
begin
|
begin
|
||||||
Result:=fHasResources or (ComponentName<>'');
|
Result:=(uifHasResources in FFlags) or (ComponentName<>'');
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TUnitInfo.GetInternalFile: boolean;
|
||||||
|
begin
|
||||||
|
Result:=uifInternalFile in FFlags;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TUnitInfo.GetLoaded: Boolean;
|
||||||
|
begin
|
||||||
|
Result:=uifLoaded in FFlags;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TUnitInfo.GetLoadedDesigner: Boolean;
|
||||||
|
begin
|
||||||
|
Result:=uifLoadedDesigner in FFlags;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TUnitInfo.GetLoadingComponent: boolean;
|
||||||
|
begin
|
||||||
|
Result:=uifLoadingComponent in FFlags;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TUnitInfo.GetEditorInfo(Index: Integer): TUnitEditorInfo;
|
function TUnitInfo.GetEditorInfo(Index: Integer): TUnitEditorInfo;
|
||||||
begin
|
begin
|
||||||
Result := FEditorInfoList[Index];
|
Result:=FEditorInfoList[Index];
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TUnitInfo.GetFileReadOnly: Boolean;
|
||||||
|
begin
|
||||||
|
Result:=uifFileReadOnly in FFlags;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TUnitInfo.GetHasErrorInLFM: boolean;
|
||||||
|
begin
|
||||||
|
Result:=uifHasErrorInLFM in FFlags;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TUnitInfo.GetModified: boolean;
|
function TUnitInfo.GetModified: boolean;
|
||||||
begin
|
begin
|
||||||
Result:=fModified
|
Result:=(uifModified in FFlags)
|
||||||
or ((Source<>nil) and (Source.ChangeStep<>fSourceChangeStep));
|
or ((Source<>nil) and (Source.ChangeStep<>fSourceChangeStep));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2531,6 +2596,16 @@ begin
|
|||||||
Result:=fPrev[uilWithEditorIndex];
|
Result:=fPrev[uilWithEditorIndex];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TUnitInfo.GetRunFileIfActive: boolean;
|
||||||
|
begin
|
||||||
|
Result:=uifRunFileIfActive in FFlags;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TUnitInfo.GetSessionModified: boolean;
|
||||||
|
begin
|
||||||
|
Result:=uifSessionModified in FFlags;
|
||||||
|
end;
|
||||||
|
|
||||||
function TUnitInfo.GetUnitResourceFileformat: TUnitResourcefileFormatClass;
|
function TUnitInfo.GetUnitResourceFileformat: TUnitResourcefileFormatClass;
|
||||||
var
|
var
|
||||||
ResourceFormats : TUnitResourcefileFormatArr;
|
ResourceFormats : TUnitResourcefileFormatArr;
|
||||||
@ -2558,20 +2633,39 @@ begin
|
|||||||
Result := FUnitResourceFileformat;
|
Result := FUnitResourceFileformat;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TUnitInfo.GetUserReadOnly: Boolean;
|
||||||
|
begin
|
||||||
|
Result:=uifUserReadOnly in FFlags;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TUnitInfo.SetAutoReferenceSourceDir(const AValue: boolean);
|
procedure TUnitInfo.SetAutoReferenceSourceDir(const AValue: boolean);
|
||||||
begin
|
begin
|
||||||
if FAutoReferenceSourceDir=AValue then exit;
|
if AutoReferenceSourceDir=AValue then exit;
|
||||||
FAutoReferenceSourceDir:=AValue;
|
if AValue then
|
||||||
|
Include(FFlags, uifAutoReferenceSourceDir)
|
||||||
|
else
|
||||||
|
Exclude(FFlags, uifAutoReferenceSourceDir);
|
||||||
UpdateSourceDirectoryReference;
|
UpdateSourceDirectoryReference;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TUnitInfo.SetBuildFileIfActive(const AValue: boolean);
|
procedure TUnitInfo.SetBuildFileIfActive(const AValue: boolean);
|
||||||
begin
|
begin
|
||||||
if FBuildFileIfActive=AValue then exit;
|
if BuildFileIfActive=AValue then exit;
|
||||||
FBuildFileIfActive:=AValue;
|
if AValue then
|
||||||
|
Include(FFlags, uifBuildFileIfActive)
|
||||||
|
else
|
||||||
|
Exclude(FFlags, uifBuildFileIfActive);
|
||||||
SessionModified:=true;
|
SessionModified:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TUnitInfo.SetCustomDefaultHighlighter(AValue: boolean);
|
||||||
|
begin
|
||||||
|
if AValue then
|
||||||
|
Include(FFlags, uifCustomDefaultHighlighter)
|
||||||
|
else
|
||||||
|
Exclude(FFlags, uifCustomDefaultHighlighter);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TUnitInfo.SetDefaultSyntaxHighlighter(const AValue: TLazSyntaxHighlighter);
|
procedure TUnitInfo.SetDefaultSyntaxHighlighter(const AValue: TLazSyntaxHighlighter);
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
@ -2583,23 +2677,23 @@ begin
|
|||||||
FEditorInfoList[i].SyntaxHighlighter := AValue;
|
FEditorInfoList[i].SyntaxHighlighter := AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TUnitInfo.SetDirectives(const AValue: TStrings);
|
|
||||||
begin
|
|
||||||
if FDirectives=AValue then exit;
|
|
||||||
FDirectives:=AValue;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TUnitInfo.SetDisableI18NForLFM(const AValue: boolean);
|
procedure TUnitInfo.SetDisableI18NForLFM(const AValue: boolean);
|
||||||
begin
|
begin
|
||||||
if FDisableI18NForLFM=AValue then exit;
|
if DisableI18NForLFM=AValue then exit;
|
||||||
FDisableI18NForLFM:=AValue;
|
if AValue then
|
||||||
|
Include(FFlags, uifDisableI18NForLFM)
|
||||||
|
else
|
||||||
|
Exclude(FFlags, uifDisableI18NForLFM);
|
||||||
Modified:=true;
|
Modified:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TUnitInfo.SetFileReadOnly(const AValue: Boolean);
|
procedure TUnitInfo.SetFileReadOnly(const AValue: Boolean);
|
||||||
begin
|
begin
|
||||||
if fFileReadOnly=AValue then exit;
|
if FileReadOnly=AValue then exit;
|
||||||
fFileReadOnly:=AValue;
|
if AValue then
|
||||||
|
Include(FFlags, uifFileReadOnly)
|
||||||
|
else
|
||||||
|
Exclude(FFlags, uifFileReadOnly);
|
||||||
if fSource<>nil then
|
if fSource<>nil then
|
||||||
fSource.ReadOnly:=ReadOnly;
|
fSource.ReadOnly:=ReadOnly;
|
||||||
end;
|
end;
|
||||||
@ -2617,11 +2711,30 @@ end;
|
|||||||
|
|
||||||
procedure TUnitInfo.SetHasErrorInLFM(AValue: boolean);
|
procedure TUnitInfo.SetHasErrorInLFM(AValue: boolean);
|
||||||
begin
|
begin
|
||||||
if fHasErrorInLFM=AValue then Exit;
|
if HasErrorInLFM=AValue then Exit;
|
||||||
fHasErrorInLFM:=AValue;
|
if AValue then
|
||||||
|
Include(FFlags, uifHasErrorInLFM)
|
||||||
|
else
|
||||||
|
Exclude(FFlags, uifHasErrorInLFM);
|
||||||
Modified:=true;
|
Modified:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TUnitInfo.SetHasResources(AValue: boolean);
|
||||||
|
begin
|
||||||
|
if AValue then
|
||||||
|
Include(FFlags, uifHasResources)
|
||||||
|
else
|
||||||
|
Exclude(FFlags, uifHasResources);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TUnitInfo.SetInternalFile(AValue: boolean);
|
||||||
|
begin
|
||||||
|
if AValue then
|
||||||
|
Include(FFlags, uifInternalFile)
|
||||||
|
else
|
||||||
|
Exclude(FFlags, uifInternalFile);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TUnitInfo.SetIsPartOfProject(const AValue: boolean);
|
procedure TUnitInfo.SetIsPartOfProject(const AValue: boolean);
|
||||||
begin
|
begin
|
||||||
if IsPartOfProject=AValue then exit;
|
if IsPartOfProject=AValue then exit;
|
||||||
@ -2643,12 +2756,13 @@ end;
|
|||||||
-------------------------------------------------------------------------------}
|
-------------------------------------------------------------------------------}
|
||||||
procedure TUnitInfo.SetLoaded(const AValue: Boolean);
|
procedure TUnitInfo.SetLoaded(const AValue: Boolean);
|
||||||
begin
|
begin
|
||||||
if fLoaded=AValue then exit;
|
if Loaded=AValue then exit;
|
||||||
fLoaded:=AValue;
|
if AValue then begin
|
||||||
if fLoaded then begin
|
Include(FFlags, uifLoaded);
|
||||||
IncreaseAutoRevertLock;
|
IncreaseAutoRevertLock;
|
||||||
UpdateUsageCount(uuIsLoaded,0);
|
UpdateUsageCount(uuIsLoaded,0);
|
||||||
end else begin
|
end else begin
|
||||||
|
Exclude(FFlags, uifLoaded);
|
||||||
DecreaseAutoRevertLock;
|
DecreaseAutoRevertLock;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -2663,8 +2777,18 @@ end;
|
|||||||
-------------------------------------------------------------------------------}
|
-------------------------------------------------------------------------------}
|
||||||
procedure TUnitInfo.SetLoadedDesigner(const AValue: Boolean);
|
procedure TUnitInfo.SetLoadedDesigner(const AValue: Boolean);
|
||||||
begin
|
begin
|
||||||
if fLoadedDesigner=AValue then exit;
|
if AValue then
|
||||||
fLoadedDesigner:=AValue;
|
Include(FFlags, uifLoadedDesigner)
|
||||||
|
else
|
||||||
|
Exclude(FFlags, uifLoadedDesigner);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TUnitInfo.SetLoadingComponent(AValue: boolean);
|
||||||
|
begin
|
||||||
|
if AValue then
|
||||||
|
Include(FFlags, uifLoadingComponent)
|
||||||
|
else
|
||||||
|
Exclude(FFlags, uifLoadingComponent);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TUnitInfo.SetModified(const AValue: boolean);
|
procedure TUnitInfo.SetModified(const AValue: boolean);
|
||||||
@ -2673,8 +2797,11 @@ begin
|
|||||||
{$IFDEF VerboseIDEModified}
|
{$IFDEF VerboseIDEModified}
|
||||||
debugln(['TUnitInfo.SetModified ',Filename,' new Modified=',AValue]);
|
debugln(['TUnitInfo.SetModified ',Filename,' new Modified=',AValue]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
fModified:=AValue;
|
if AValue then
|
||||||
if (not fModified) and Assigned(Source) then
|
Include(FFlags, uifModified)
|
||||||
|
else
|
||||||
|
Exclude(FFlags, uifModified);
|
||||||
|
if (not AValue) and Assigned(Source) then
|
||||||
SetTimeStamps;
|
SetTimeStamps;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2709,18 +2836,24 @@ end;
|
|||||||
|
|
||||||
procedure TUnitInfo.SetRunFileIfActive(const AValue: boolean);
|
procedure TUnitInfo.SetRunFileIfActive(const AValue: boolean);
|
||||||
begin
|
begin
|
||||||
if FRunFileIfActive=AValue then exit;
|
if RunFileIfActive=AValue then exit;
|
||||||
FRunFileIfActive:=AValue;
|
if AValue then
|
||||||
|
Include(FFlags, uifRunFileIfActive)
|
||||||
|
else
|
||||||
|
Exclude(FFlags, uifRunFileIfActive);
|
||||||
SessionModified:=true;
|
SessionModified:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TUnitInfo.SetSessionModified(const AValue: boolean);
|
procedure TUnitInfo.SetSessionModified(const AValue: boolean);
|
||||||
begin
|
begin
|
||||||
if FSessionModified=AValue then exit;
|
if SessionModified=AValue then exit;
|
||||||
{$IFDEF VerboseIDEModified}
|
{$IFDEF VerboseIDEModified}
|
||||||
debugln(['TUnitInfo.SetSessionModified ',Filename,' new Modified=',AValue]);
|
debugln(['TUnitInfo.SetSessionModified ',Filename,' new Modified=',AValue]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
FSessionModified:=AValue;
|
if AValue then
|
||||||
|
Include(FFlags, uifSessionModified)
|
||||||
|
else
|
||||||
|
Exclude(FFlags, uifSessionModified);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -889,7 +889,7 @@ begin
|
|||||||
else begin
|
else begin
|
||||||
FNewUnitInfo:=Project1.Units[FUnitIndex];
|
FNewUnitInfo:=Project1.Units[FUnitIndex];
|
||||||
end;
|
end;
|
||||||
FNewUnitInfo.Flags := FNewUnitInfo.Flags + [uifInternalFile];
|
FNewUnitInfo.InternalFile := True;
|
||||||
|
|
||||||
if FNewUnitInfo.OpenEditorInfoCount > 0 then begin
|
if FNewUnitInfo.OpenEditorInfoCount > 0 then begin
|
||||||
FNewEditorInfo := FNewUnitInfo.OpenEditorInfo[0];
|
FNewEditorInfo := FNewUnitInfo.OpenEditorInfo[0];
|
||||||
|
@ -205,7 +205,6 @@ type
|
|||||||
property Flags: TPkgFileFlags read FFlags write SetFlags;
|
property Flags: TPkgFileFlags read FFlags write SetFlags;
|
||||||
property HasRegisterProc: boolean read GetHasRegisterProc write SetHasRegisterProc;
|
property HasRegisterProc: boolean read GetHasRegisterProc write SetHasRegisterProc;
|
||||||
property LazPackage: TLazPackage read FPackage;
|
property LazPackage: TLazPackage read FPackage;
|
||||||
property SourceDirectoryReferenced: boolean read FSourceDirectoryReferenced;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1579,12 +1578,12 @@ procedure TPkgFile.UpdateSourceDirectoryReference;
|
|||||||
begin
|
begin
|
||||||
if (not AutoReferenceSourceDir) or (FPackage=nil) then exit;
|
if (not AutoReferenceSourceDir) or (FPackage=nil) then exit;
|
||||||
if FSourceDirNeedReference then begin
|
if FSourceDirNeedReference then begin
|
||||||
if not SourceDirectoryReferenced then begin
|
if not FSourceDirectoryReferenced then begin
|
||||||
LazPackage.SourceDirectories.AddFilename(FDirectory);
|
LazPackage.SourceDirectories.AddFilename(FDirectory);
|
||||||
FSourceDirectoryReferenced:=true;
|
FSourceDirectoryReferenced:=true;
|
||||||
end;
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
if SourceDirectoryReferenced then begin
|
if FSourceDirectoryReferenced then begin
|
||||||
LazPackage.SourceDirectories.RemoveFilename(FDirectory);
|
LazPackage.SourceDirectories.RemoveFilename(FDirectory);
|
||||||
FSourceDirectoryReferenced:=false;
|
FSourceDirectoryReferenced:=false;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user