fix dmdwrap, TPathOptions, items in TStringList were not patched when realoding from file.

This commit is contained in:
Basile Burg 2014-11-10 15:52:40 +01:00
parent 118b747ef7
commit 15257c2b2c
1 changed files with 16 additions and 0 deletions

View File

@ -214,6 +214,7 @@ type
procedure setSrcs(const aValue: TStringList); procedure setSrcs(const aValue: TStringList);
procedure setIncl(const aValue: TStringList); procedure setIncl(const aValue: TStringList);
procedure setImpt(const aValue: TStringList); procedure setImpt(const aValue: TStringList);
procedure strLstChange(sender: TObject);
published published
property outputFilename: string read fFname write setFname; property outputFilename: string read fFname write setFname;
property objectDirectory: string read fObjDir write setObjDir; property objectDirectory: string read fObjDir write setObjDir;
@ -808,6 +809,18 @@ begin
fSrcs := TStringList.Create; fSrcs := TStringList.Create;
fIncl := TStringList.Create; fIncl := TStringList.Create;
fImpt := TStringList.Create; fImpt := TStringList.Create;
// setSrcs(), setIncl(), setImpt() are not called when reloading from
// a stream but rather the TSgringList.Assign()
fSrcs.OnChange:= @strLstChange;
fIncl.OnChange:= @strLstChange;
fImpt.OnChange:= @strLstChange;
end;
procedure TPathsOpts.strLstChange(sender: TObject);
begin
TStringList(sender).BeginUpdate; // onChange not called anymore
patchPlateformPaths(TStringList(sender));
// EndUpdate is not called to avoid an infinite loop
end; end;
procedure TPathsOpts.getOpts(const aList: TStrings); procedure TPathsOpts.getOpts(const aList: TStrings);
@ -816,7 +829,9 @@ var
begin begin
for str in fSrcs do if str <> '' then for str in fSrcs do if str <> '' then
begin begin
str := (CEMainForm.expandSymbolicString(str));
if not if not
// files are directly put in aList
listAsteriskPath(str, aList, dExtList) listAsteriskPath(str, aList, dExtList)
then then
aList.Add(str); aList.Add(str);
@ -834,6 +849,7 @@ end;
procedure TPathsOpts.assign(aValue: TPersistent); procedure TPathsOpts.assign(aValue: TPersistent);
var var
src: TPathsOpts; src: TPathsOpts;
i: Integer;
begin begin
if (aValue is TPathsOpts) then if (aValue is TPathsOpts) then
begin begin