mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2026-01-04 01:40:31 +01:00
IDEIntf: added customdata and customsessiondata for project files
git-svn-id: trunk@14939 -
This commit is contained in:
parent
5ec895750e
commit
0d3824b98f
@ -9667,7 +9667,6 @@ begin
|
||||
DoJumpToCodeToolBossError;
|
||||
exit;
|
||||
end;
|
||||
|
||||
end else begin
|
||||
// ToDo: load .lfi file
|
||||
MessageDlg('Not implemented',
|
||||
|
||||
@ -324,6 +324,7 @@ type
|
||||
property CursorPos: TPoint read fCursorPos write fCursorPos; // physical (screen) position
|
||||
property CustomHighlighter: boolean
|
||||
read fCustomHighlighter write fCustomHighlighter;
|
||||
property Directives: TStrings;
|
||||
property EditorIndex: integer read fEditorIndex write SetEditorIndex;
|
||||
property FileReadOnly: Boolean read fFileReadOnly write SetFileReadOnly;
|
||||
property FirstRequiredComponent: TUnitComponentDependency
|
||||
@ -1152,6 +1153,8 @@ begin
|
||||
fOnLoadSaveFilename(AFilename,false);
|
||||
XMLConfig.SetDeleteValue(Path+'ResourceFilename/Value',AFilename,'');
|
||||
XMLConfig.SetDeleteValue(Path+'UnitName/Value',fUnitName,'');
|
||||
// save custom data
|
||||
SaveStringToStringTree(XMLConfig,CustomData,Path+'CustomData/');
|
||||
end;
|
||||
|
||||
// session data
|
||||
@ -1171,6 +1174,8 @@ begin
|
||||
FBuildFileIfActive,false);
|
||||
XMLConfig.SetDeleteValue(Path+'RunFileIfActive/Value',
|
||||
FRunFileIfActive,false);
|
||||
// save custom session data
|
||||
SaveStringToStringTree(XMLConfig,CustomSessionData,Path+'CustomSessionData/');
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -1203,6 +1208,9 @@ begin
|
||||
FResourceFilename:='';
|
||||
if FilenameIsPascalSource(Filename) then
|
||||
fUnitName:=XMLConfig.GetValue(Path+'UnitName/Value','');
|
||||
|
||||
// save custom data
|
||||
LoadStringToStringTree(XMLConfig,CustomData,Path+'CustomData/');
|
||||
end;
|
||||
|
||||
// session data
|
||||
@ -1225,6 +1233,8 @@ begin
|
||||
UpdateUsageCount(uuIsPartOfProject,1);
|
||||
end;
|
||||
FBookmarks.LoadFromXMLConfig(XMLConfig,Path+'Bookmarks/');
|
||||
// load custom session data
|
||||
LoadStringToStringTree(XMLConfig,CustomSessionData,Path+'CustomSessionData/');
|
||||
end;
|
||||
|
||||
function TUnitInfo.ParseUnitNameFromSource(TryCache: boolean): string;
|
||||
|
||||
@ -284,12 +284,16 @@ type
|
||||
|
||||
TLazProjectFile = class(TPersistent)
|
||||
private
|
||||
FCustomData: TStringToStringTree;
|
||||
FCustomSessionData: TStringToStringTree;
|
||||
FIsPartOfProject: boolean;
|
||||
protected
|
||||
function GetFilename: string; virtual; abstract;
|
||||
procedure SetFilename(const AValue: string); virtual; abstract;
|
||||
procedure SetIsPartOfProject(const AValue: boolean); virtual;
|
||||
public
|
||||
constructor Create;
|
||||
destructor Destroy; override;
|
||||
procedure SetSourceText(const SourceText: string); virtual; abstract;
|
||||
function GetSourceText: string; virtual; abstract;
|
||||
procedure ClearModifieds; virtual; abstract;
|
||||
@ -297,6 +301,8 @@ type
|
||||
property IsPartOfProject: boolean read FIsPartOfProject
|
||||
write SetIsPartOfProject;
|
||||
property Filename: string read GetFilename write SetFilename;
|
||||
property CustomData: TStringToStringTree read FCustomData;
|
||||
property CustomSessionData: TStringToStringTree read FCustomSessionData;
|
||||
end;
|
||||
TLazProjectFileClass = class of TLazProjectFile;
|
||||
|
||||
@ -1156,6 +1162,19 @@ begin
|
||||
FIsPartOfProject:=AValue;
|
||||
end;
|
||||
|
||||
constructor TLazProjectFile.Create;
|
||||
begin
|
||||
FCustomData:=TStringToStringTree.Create(true);
|
||||
FCustomSessionData:=TStringToStringTree.Create(true);
|
||||
end;
|
||||
|
||||
destructor TLazProjectFile.Destroy;
|
||||
begin
|
||||
FreeAndNil(FCustomData);
|
||||
FreeAndNil(FCustomSessionData);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
{ TLazCompilerOptions }
|
||||
|
||||
constructor TLazCompilerOptions.Create(const TheOwner: TObject);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user