mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-28 04:29:27 +02:00
IDE: path delim loading
git-svn-id: trunk@18136 -
This commit is contained in:
parent
ae4d09be24
commit
56d598901b
@ -85,6 +85,13 @@ type
|
|||||||
pdsUnix, // switch to slash /
|
pdsUnix, // switch to slash /
|
||||||
pdsWindows // switch to backslash \
|
pdsWindows // switch to backslash \
|
||||||
);
|
);
|
||||||
|
const
|
||||||
|
PathDelimSwitchToDelim: array[TPathDelimSwitch] of char = (
|
||||||
|
PathDelim, // pdsNone
|
||||||
|
PathDelim, // pdsSystem
|
||||||
|
'/', // pdsUnix
|
||||||
|
'\' // pdsWindows
|
||||||
|
);
|
||||||
|
|
||||||
// file names
|
// file names
|
||||||
function CompareFilenames(const Filename1, Filename2: string): integer;
|
function CompareFilenames(const Filename1, Filename2: string): integer;
|
||||||
@ -99,6 +106,7 @@ function CreateRelativePath(const Filename, BaseDirectory: string;
|
|||||||
UsePointDirectory: boolean = false): string;
|
UsePointDirectory: boolean = false): string;
|
||||||
function SwitchPathDelims(const Filename: string; Switch: TPathDelimSwitch): string;
|
function SwitchPathDelims(const Filename: string; Switch: TPathDelimSwitch): string;
|
||||||
function SwitchPathDelims(const Filename: string; Switch: boolean): string;
|
function SwitchPathDelims(const Filename: string; Switch: boolean): string;
|
||||||
|
function CheckPathDelim(const OldPathDelim: string; out Changed: boolean): TPathDelimSwitch;
|
||||||
function ChompEndNumber(const s: string): string;
|
function ChompEndNumber(const s: string): string;
|
||||||
|
|
||||||
// file stats
|
// file stats
|
||||||
@ -843,6 +851,22 @@ begin
|
|||||||
Result:=Filename;
|
Result:=Filename;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function CheckPathDelim(const OldPathDelim: string; out Changed: boolean
|
||||||
|
): TPathDelimSwitch;
|
||||||
|
begin
|
||||||
|
Changed:=OldPathDelim<>PathDelim;
|
||||||
|
if Changed then begin
|
||||||
|
if OldPathDelim='/' then
|
||||||
|
Result:=pdsUnix
|
||||||
|
else if OldPathDelim='\' then
|
||||||
|
Result:=pdsWindows
|
||||||
|
else
|
||||||
|
Result:=pdsSystem;
|
||||||
|
end else begin
|
||||||
|
Result:=pdsNone;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function ChompEndNumber(const s: string): string;
|
function ChompEndNumber(const s: string): string;
|
||||||
var
|
var
|
||||||
NewLen: Integer;
|
NewLen: Integer;
|
||||||
|
@ -599,6 +599,7 @@ type
|
|||||||
FSourceDirectories: TFileReferenceList;
|
FSourceDirectories: TFileReferenceList;
|
||||||
FStateFileDate: longint;
|
FStateFileDate: longint;
|
||||||
FStateFlags: TLazProjectStateFlags;
|
FStateFlags: TLazProjectStateFlags;
|
||||||
|
FStorePathDelim: TPathDelimSwitch;
|
||||||
FTargetFileExt: String;
|
FTargetFileExt: String;
|
||||||
FUnitList: TFPList; // list of _all_ units (TUnitInfo)
|
FUnitList: TFPList; // list of _all_ units (TUnitInfo)
|
||||||
FUpdateLock: integer;
|
FUpdateLock: integer;
|
||||||
@ -821,6 +822,7 @@ type
|
|||||||
read FCompilerOptions write SetCompilerOptions;
|
read FCompilerOptions write SetCompilerOptions;
|
||||||
property DefineTemplates: TProjectDefineTemplates read FDefineTemplates;
|
property DefineTemplates: TProjectDefineTemplates read FDefineTemplates;
|
||||||
property Destroying: boolean read fDestroying;
|
property Destroying: boolean read fDestroying;
|
||||||
|
property EnableI18N: boolean read FEnableI18N write SetEnableI18N;
|
||||||
property FirstAutoRevertLockedUnit: TUnitInfo read GetFirstAutoRevertLockedUnit;
|
property FirstAutoRevertLockedUnit: TUnitInfo read GetFirstAutoRevertLockedUnit;
|
||||||
property FirstLoadedUnit: TUnitInfo read GetFirstLoadedUnit;
|
property FirstLoadedUnit: TUnitInfo read GetFirstLoadedUnit;
|
||||||
property FirstPartOfProject: TUnitInfo read GetFirstPartOfProject;
|
property FirstPartOfProject: TUnitInfo read GetFirstPartOfProject;
|
||||||
@ -828,9 +830,8 @@ type
|
|||||||
read FFirstRemovedDependency;
|
read FFirstRemovedDependency;
|
||||||
property FirstRequiredDependency: TPkgDependency
|
property FirstRequiredDependency: TPkgDependency
|
||||||
read FFirstRequiredDependency;
|
read FFirstRequiredDependency;
|
||||||
property FirstUnitWithEditorIndex: TUnitInfo read GetFirstUnitWithEditorIndex;
|
|
||||||
property FirstUnitWithComponent: TUnitInfo read GetFirstUnitWithComponent;
|
property FirstUnitWithComponent: TUnitInfo read GetFirstUnitWithComponent;
|
||||||
property StateFlags: TLazProjectStateFlags read FStateFlags write FStateFlags;
|
property FirstUnitWithEditorIndex: TUnitInfo read GetFirstUnitWithEditorIndex;
|
||||||
property JumpHistory: TProjectJumpHistory
|
property JumpHistory: TProjectJumpHistory
|
||||||
read FJumpHistory write FJumpHistory;
|
read FJumpHistory write FJumpHistory;
|
||||||
property LastCompilerFileDate: integer read FLastCompilerFileDate
|
property LastCompilerFileDate: integer read FLastCompilerFileDate
|
||||||
@ -840,40 +841,40 @@ type
|
|||||||
property LastCompilerParams: string read FLastCompilerParams
|
property LastCompilerParams: string read FLastCompilerParams
|
||||||
write FLastCompilerParams;
|
write FLastCompilerParams;
|
||||||
property MainFilename: String read GetMainFilename;
|
property MainFilename: String read GetMainFilename;
|
||||||
|
property MainProject: boolean read FMainProject write SetMainProject;
|
||||||
property MainUnitID: Integer read FMainUnitID write SetMainUnitID;
|
property MainUnitID: Integer read FMainUnitID write SetMainUnitID;
|
||||||
property MainUnitInfo: TUnitInfo read GetMainUnitInfo;
|
property MainUnitInfo: TUnitInfo read GetMainUnitInfo;
|
||||||
property MainProject: boolean read FMainProject write SetMainProject;
|
|
||||||
property OnBeginUpdate: TNotifyEvent read FOnBeginUpdate write FOnBeginUpdate;
|
property OnBeginUpdate: TNotifyEvent read FOnBeginUpdate write FOnBeginUpdate;
|
||||||
property OnEndUpdate: TEndUpdateProjectEvent read FOnEndUpdate write FOnEndUpdate;
|
|
||||||
property OnFileBackup: TOnFileBackup read fOnFileBackup write fOnFileBackup;
|
|
||||||
property OnSaveProjectInfo: TOnSaveProjectInfo read FOnSaveProjectInfo
|
|
||||||
write FOnSaveProjectInfo;
|
|
||||||
property OnLoadProjectInfo: TOnLoadProjectInfo read FOnLoadProjectInfo
|
|
||||||
write FOnLoadProjectInfo;
|
|
||||||
property OnGetTestDirectory: TOnProjectGetTestDirectory
|
|
||||||
read FOnGetTestDirectory write FOnGetTestDirectory;
|
|
||||||
property OnChangeProjectInfoFile: TOnChangeProjectInfoFile read FOnChangeProjectInfoFile
|
property OnChangeProjectInfoFile: TOnChangeProjectInfoFile read FOnChangeProjectInfoFile
|
||||||
write FOnChangeProjectInfoFile;
|
write FOnChangeProjectInfoFile;
|
||||||
|
property OnEndUpdate: TEndUpdateProjectEvent read FOnEndUpdate write FOnEndUpdate;
|
||||||
|
property OnFileBackup: TOnFileBackup read fOnFileBackup write fOnFileBackup;
|
||||||
|
property OnGetTestDirectory: TOnProjectGetTestDirectory
|
||||||
|
read FOnGetTestDirectory write FOnGetTestDirectory;
|
||||||
|
property OnLoadProjectInfo: TOnLoadProjectInfo read FOnLoadProjectInfo
|
||||||
|
write FOnLoadProjectInfo;
|
||||||
|
property OnSaveProjectInfo: TOnSaveProjectInfo read FOnSaveProjectInfo
|
||||||
|
write FOnSaveProjectInfo;
|
||||||
|
property POOutputDirectory: string read FPOOutputDirectory
|
||||||
|
write SetPOOutputDirectory;
|
||||||
property ProjectDirectory: string read fProjectDirectory;
|
property ProjectDirectory: string read fProjectDirectory;
|
||||||
property ProjectInfoFile: string
|
property ProjectInfoFile: string
|
||||||
read GetProjectInfoFile write SetProjectInfoFile;
|
read GetProjectInfoFile write SetProjectInfoFile;
|
||||||
property PublishOptions: TPublishProjectOptions
|
property PublishOptions: TPublishProjectOptions
|
||||||
read FPublishOptions write FPublishOptions;
|
read FPublishOptions write FPublishOptions;
|
||||||
|
property Resources: TProjectResources read FResources;
|
||||||
|
|
||||||
property RunParameterOptions: TRunParamsOptions read FRunParameterOptions;
|
property RunParameterOptions: TRunParamsOptions read FRunParameterOptions;
|
||||||
property UseAppBundle: Boolean read FUseAppBundle write FUseAppBundle;
|
|
||||||
property SourceDirectories: TFileReferenceList read FSourceDirectories;
|
property SourceDirectories: TFileReferenceList read FSourceDirectories;
|
||||||
property StateFileDate: longint read FStateFileDate write FStateFileDate;
|
property StateFileDate: longint read FStateFileDate write FStateFileDate;
|
||||||
|
property StateFlags: TLazProjectStateFlags read FStateFlags write FStateFlags;
|
||||||
|
property StorePathDelim: TPathDelimSwitch read FStorePathDelim write FStorePathDelim;
|
||||||
property TargetFileExt: String read FTargetFileExt write FTargetFileExt;
|
property TargetFileExt: String read FTargetFileExt write FTargetFileExt;
|
||||||
property TargetFilename: string
|
property TargetFilename: string
|
||||||
read GetTargetFilename write SetTargetFilename;
|
read GetTargetFilename write SetTargetFilename;
|
||||||
property Units[Index: integer]: TUnitInfo read GetUnits;
|
property Units[Index: integer]: TUnitInfo read GetUnits;
|
||||||
property UpdateLock: integer read FUpdateLock;
|
property UpdateLock: integer read FUpdateLock;
|
||||||
|
property UseAppBundle: Boolean read FUseAppBundle write FUseAppBundle;
|
||||||
property Resources: TProjectResources read FResources;
|
|
||||||
|
|
||||||
property EnableI18N: boolean read FEnableI18N write SetEnableI18N;
|
|
||||||
property POOutputDirectory: string read FPOOutputDirectory
|
|
||||||
write SetPOOutputDirectory;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -2420,8 +2421,8 @@ begin
|
|||||||
NewMainUnitID:=-1;
|
NewMainUnitID:=-1;
|
||||||
try
|
try
|
||||||
Path:='ProjectOptions/';
|
Path:='ProjectOptions/';
|
||||||
fPathDelimChanged:=
|
StorePathDelim:=CheckPathDelim(
|
||||||
XMLConfig.GetValue(Path+'PathDelim/Value', PathDelim)<>PathDelim;
|
XMLConfig.GetValue(Path+'PathDelim/Value', PathDelim),fPathDelimChanged);
|
||||||
|
|
||||||
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TProject.ReadProject C reading values');{$ENDIF}
|
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TProject.ReadProject C reading values');{$ENDIF}
|
||||||
FileVersion:= XMLConfig.GetValue(Path+'Version/Value',0);
|
FileVersion:= XMLConfig.GetValue(Path+'Version/Value',0);
|
||||||
|
Loading…
Reference in New Issue
Block a user