IDE: do not write default launching pathplusparams

git-svn-id: trunk@41687 -
This commit is contained in:
mattias 2013-06-12 10:47:36 +00:00
parent b3c587c8c1
commit f5026c3fe2

View File

@ -139,7 +139,6 @@ type
function ShowRunParamsOptsDlg(RunParamsOptions: TRunParamsOptions): TModalResult; function ShowRunParamsOptsDlg(RunParamsOptions: TRunParamsOptions): TModalResult;
implementation implementation
{$R *.lfm} {$R *.lfm}
@ -186,6 +185,17 @@ begin
List.Free; List.Free;
end; end;
var
DefaultLaunchingApplicationPathPlusParams: string;
function GetDefaultLaunchingApplicationPathPlusParams: string;
begin
Result:=DefaultLaunchingApplicationPathPlusParams;
if Result<>'' then exit;
Result:=FindTerminalInPath;
DefaultLaunchingApplicationPathPlusParams:=Result;
end;
function ShowRunParamsOptsDlg(RunParamsOptions: TRunParamsOptions): TModalResult; function ShowRunParamsOptsDlg(RunParamsOptions: TRunParamsOptions): TModalResult;
var var
RunParamsOptsForm: TRunParamsOptsDlg; RunParamsOptsForm: TRunParamsOptsDlg;
@ -216,16 +226,12 @@ begin
end; end;
procedure TRunParamsOptions.Clear; procedure TRunParamsOptions.Clear;
var
s: String;
begin begin
// local options // local options
fHostApplicationFilename := ''; fHostApplicationFilename := '';
fCmdLineParams := ''; fCmdLineParams := '';
fUseLaunchingApplication := False; fUseLaunchingApplication := False;
S := FindTerminalInPath; fLaunchingApplicationPathPlusParams := GetDefaultLaunchingApplicationPathPlusParams;
if S <> '' then
fLaunchingApplicationPathPlusParams := S;
// TODO: guess are we under gnome or kde so query for gnome-terminal or konsole. // TODO: guess are we under gnome or kde so query for gnome-terminal or konsole.
fWorkingDirectory := ''; fWorkingDirectory := '';
fUseDisplay := False; fUseDisplay := False;
@ -238,8 +244,6 @@ end;
function TRunParamsOptions.Load(XMLConfig: TXMLConfig; const Path: string; function TRunParamsOptions.Load(XMLConfig: TXMLConfig; const Path: string;
AdjustPathDelims: boolean): TModalResult; AdjustPathDelims: boolean): TModalResult;
var
S: String;
function f(const Filename: string): string; function f(const Filename: string): string;
begin begin
@ -270,13 +274,7 @@ begin
Path + 'RunParams/local/LaunchingApplication/Use', fUseLaunchingApplication); Path + 'RunParams/local/LaunchingApplication/Use', fUseLaunchingApplication);
fLaunchingApplicationPathPlusParams := fLaunchingApplicationPathPlusParams :=
f(XMLConfig.GetValue(Path + 'RunParams/local/LaunchingApplication/PathPlusParams', f(XMLConfig.GetValue(Path + 'RunParams/local/LaunchingApplication/PathPlusParams',
fLaunchingApplicationPathPlusParams)); f(GetDefaultLaunchingApplicationPathPlusParams)));
if (fLaunchingApplicationPathPlusParams = '') then
begin
S := FindTerminalInPath;
if S <> '' then
fLaunchingApplicationPathPlusParams := S;
end;
fWorkingDirectory := f(XMLConfig.GetValue( fWorkingDirectory := f(XMLConfig.GetValue(
Path + 'RunParams/local/WorkingDirectory/Value', fWorkingDirectory)); Path + 'RunParams/local/WorkingDirectory/Value', fWorkingDirectory));
fUseDisplay := XMLConfig.GetValue(Path + 'RunParams/local/Display/Use', fUseDisplay := XMLConfig.GetValue(Path + 'RunParams/local/Display/Use',
@ -327,7 +325,7 @@ begin
XMLConfig.SetDeleteValue(Path + 'RunParams/local/LaunchingApplication/Use', XMLConfig.SetDeleteValue(Path + 'RunParams/local/LaunchingApplication/Use',
fUseLaunchingApplication, False); fUseLaunchingApplication, False);
XMLConfig.SetDeleteValue(Path + 'RunParams/local/LaunchingApplication/PathPlusParams', XMLConfig.SetDeleteValue(Path + 'RunParams/local/LaunchingApplication/PathPlusParams',
f(fLaunchingApplicationPathPlusParams), ''); f(fLaunchingApplicationPathPlusParams), f(GetDefaultLaunchingApplicationPathPlusParams));
XMLConfig.SetDeleteValue(Path + 'RunParams/local/WorkingDirectory/Value', XMLConfig.SetDeleteValue(Path + 'RunParams/local/WorkingDirectory/Value',
f(fWorkingDirectory), ''); f(fWorkingDirectory), '');
XMLConfig.SetDeleteValue(Path + 'RunParams/local/Display/Use', XMLConfig.SetDeleteValue(Path + 'RunParams/local/Display/Use',