unleashed a bug in TCEProject, run, parameters not copied from TCEPorjectRunOptions

This commit is contained in:
Basile Burg 2014-11-13 16:33:01 +01:00
parent 1a1f050937
commit 5a4076b1cb
3 changed files with 27 additions and 15 deletions

View File

@ -307,7 +307,7 @@
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="ce_toolseditor"/> <UnitName Value="ce_toolseditor"/>
</Unit26> </Unit26>
<Unit27> <Unit27>
<Filename Value="..\src\ce_txtsyn.pas"/> <Filename Value="..\src\ce_txtsyn.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<UnitName Value="ce_txtsyn"/> <UnitName Value="ce_txtsyn"/>

View File

@ -258,7 +258,7 @@ type
procedure setExecutable(const aValue: string); procedure setExecutable(const aValue: string);
procedure setWorkDir(const aValue: string); procedure setWorkDir(const aValue: string);
procedure setOptions(const aValue: TProcessOptions); procedure setOptions(const aValue: TProcessOptions);
procedure setParameters(const aValue: TStringList); procedure setParameters(aValue: TStringList);
procedure setShowWin(const aValue: TShowWindowOptions); procedure setShowWin(const aValue: TShowWindowOptions);
protected protected
property executable: string read fExecutable write setExecutable; property executable: string read fExecutable write setExecutable;
@ -271,7 +271,7 @@ type
destructor destroy; override; destructor destroy; override;
procedure assign(source: TPersistent); override; procedure assign(source: TPersistent); override;
procedure getOpts(const aList: TStrings); override; procedure getOpts(const aList: TStrings); override;
procedure setProcess(const aProcess: TProcess); procedure setProcess(aProcess: TProcess);
end; end;
(***************************************************************************** (*****************************************************************************
@ -986,7 +986,7 @@ begin
if source is TCustomProcOptions then if source is TCustomProcOptions then
begin begin
src := TCustomProcOptions(source); src := TCustomProcOptions(source);
fParameters.Assign(src.fParameters); fParameters := src.fParameters;
fOptions := src.fOptions; fOptions := src.fOptions;
fExecutable := src.fExecutable; fExecutable := src.fExecutable;
fShowWin := src.fShowWin; fShowWin := src.fShowWin;
@ -998,7 +998,9 @@ procedure TCustomProcOptions.getOpts(const aList: TStrings);
begin begin
end; end;
procedure TCustomProcOptions.setProcess(const aProcess: TProcess); procedure TCustomProcOptions.setProcess(aProcess: TProcess);
var
i: Integer;
begin begin
aProcess.Parameters := fParameters; aProcess.Parameters := fParameters;
aProcess.Executable := fExecutable; aProcess.Executable := fExecutable;
@ -1029,7 +1031,7 @@ begin
doChanged; doChanged;
end; end;
procedure TCustomProcOptions.setParameters(const aValue: TStringList); procedure TCustomProcOptions.setParameters(aValue: TStringList);
begin begin
fParameters.Assign(aValue); fParameters.Assign(aValue);
doChanged; doChanged;

View File

@ -559,16 +559,26 @@ begin
killProcess(fRunner); killProcess(fRunner);
// //
fRunner := TAsyncProcess.Create(nil); // fRunner can use the input process widget. fRunner := TAsyncProcess.Create(nil); // fRunner can use the input process widget.
// TODO-cbugfix: parameters are not copied from src to target.
currentConfiguration.runOptions.setProcess(fRunner); currentConfiguration.runOptions.setProcess(fRunner);
prm := '';
i := 1; //fRunner.Parameters.SaveToFile('C:\dst.txt');
repeat //currentConfiguration.runOptions.parameters.SaveToFile('C:\src.txt');
prm := ExtractDelimited(i, runArgs, [' ']);
prm := CEMainForm.expandSymbolicString(prm);
if prm <> '``' then if runArgs <> '' then
fRunner.Parameters.AddText(prm); begin
Inc(i); prm := '';
until prm = '``'; i := 1;
repeat
prm := ExtractDelimited(i, runArgs, [' ']);
prm := CEMainForm.expandSymbolicString(prm);
if prm <> '``' then
fRunner.Parameters.AddText(prm);
Inc(i);
until prm = '``';
end;
// //
if not fileExists(outputFilename) then if not fileExists(outputFilename) then
begin begin