Make Directory a common property for Project and Package in their base class.

git-svn-id: trunk@53131 -
This commit is contained in:
juha 2016-10-16 21:03:00 +00:00
parent a7bbf675a0
commit d54596a90f
3 changed files with 23 additions and 3 deletions

View File

@ -53,8 +53,12 @@ type
protected
FIDEOptions: TAbstractIDEOptions; //actually TProjectIDEOptions or TPackageIDEOptions;
FLazCompilerOptions: TLazCompilerOptions;
function GetDirectory: string; virtual; abstract;
//procedure SetDirectory(AValue: string); virtual; abstract;
function HasDirectory: boolean; virtual;
function GetLazCompilerOptions: TLazCompilerOptions;
public
property Directory: string read GetDirectory;// write SetDirectory; // directory of .lpi or .lpk file
property LazCompilerOptions: TLazCompilerOptions read GetLazCompilerOptions;
end;
@ -63,6 +67,11 @@ implementation
{ TIDEProjPackBase }
function TIDEProjPackBase.HasDirectory: boolean;
begin
Result := True;
end;
function TIDEProjPackBase.GetLazCompilerOptions: TLazCompilerOptions;
begin
Result := FLazCompilerOptions;

View File

@ -839,6 +839,7 @@ type
procedure SaveToSession;
function DoWrite(Filename: String; IsLpi: Boolean): TModalResult;
protected
function GetDirectory: string; override;
function GetActiveBuildModeID: string; override;
function GetDefineTemplates: TProjPackDefineTemplates;
function GetFiles(Index: integer): TLazProjectFile; override;
@ -1089,7 +1090,7 @@ type
property OnSaveUnitSessionInfo: TOnSaveUnitSessionInfoInfo
read FOnSaveUnitSessionInfo write FOnSaveUnitSessionInfo;
property POOutputDirectory: string read FPOOutputDirectory write SetPOOutputDirectory;
property ProjectDirectory: string read fProjectDirectory;
property ProjectDirectory: string read GetDirectory; deprecated 'Use Directory instead.';
property ProjectInfoFile: string read GetProjectInfoFile write SetProjectInfoFile;
property PublishOptions: TPublishProjectOptions read FPublishOptions write FPublishOptions;
property ProjResources: TProjectResources read GetProjResources;
@ -3292,6 +3293,11 @@ begin
until Result<>mrRetry;
end;
function TProject.GetDirectory: string;
begin
Result:=fProjectDirectory;
end;
// Method WriteProject itself
function TProject.WriteProject(ProjectWriteFlags: TProjectWriteFlags;
const OverrideProjectInfoFile: string;

View File

@ -609,6 +609,7 @@ type
procedure UpdateSourceDirectories;
procedure SourceDirectoriesChanged(Sender: TObject);
protected
function GetDirectory: string; override;
function GetDefineTemplates: TProjPackDefineTemplates;
function GetFileCount: integer; override;
function GetPkgFiles(Index: integer): TLazPackageFile; override;
@ -647,7 +648,7 @@ type
function ExtendUnitSearchPath(NewUnitPaths: string): boolean;
function ExtendIncSearchPath(NewIncPaths: string): boolean;
function IsVirtual: boolean; override;
function HasDirectory: boolean;
function HasDirectory: boolean; override;
function HasStaticDirectory: boolean;
function GetFullFilename(ResolveMacros: boolean): string;
function GetResolvedFilename(ResolveMacros: boolean): string; // GetFullFilename + resolve symlinks
@ -759,7 +760,6 @@ type
property DefineTemplates: TLazPackageDefineTemplates read FDefineTemplates
write FDefineTemplates;
property Description: string read FDescription write SetDescription;
property Directory: string read FDirectory; // the directory of the .lpk file with macros
property Editor: TBasePackageEditor read FPackageEditor write SetPackageEditor;
property EnableI18N: Boolean read FEnableI18N write SetEnableI18N;
property EnableI18NForLFM: boolean read FEnableI18NForLFM write SetEnableI18NForLFM;
@ -2855,6 +2855,11 @@ begin
FDefineTemplates.SourceDirectoriesChanged;
end;
function TLazPackage.GetDirectory: string;
begin
Result:=FDirectory;
end;
procedure TLazPackage.LockModified;
begin
inc(FModifiedLock);