Opening file dialogs will not open all filenames / paths.

Some filenames will not be opened due to missing escaping.
The failing files / paths are those with one or more spaces in them.
The remedy is to quote the string. The same error exists at
a few places. (#517)
This commit is contained in:
Thomas Nilsson 2022-06-17 14:37:35 +02:00
parent 86f06fee85
commit 3fe9261083
6 changed files with 6 additions and 6 deletions

View File

@ -874,7 +874,7 @@ begin
try
prg := cqrini.ReadString('ExtView', 'txt', '');
if prg<>'' then
dmUtils.RunOnBackground(prg + ' ' + OtF)
dmUtils.RunOnBackground(prg + ' ' + AnsiQuotedStr(OtF, '"'))
else ShowMessage('No external text viewer defined!'+#10+'See: prefrences/External viewers');
finally
//done

View File

@ -163,7 +163,7 @@ begin
try
prg := cqrini.ReadString('ExtView', 'txt', '');
if prg<>'' then
dmUtils.RunOnBackground(prg + ' ' + '"' + f + '"')
dmUtils.RunOnBackground(prg + ' ' + AnsiQuotedStr(f, '"'))
else ShowMessage('No external text viewer defined!'+#10+'See: prefrences/External viewers');
finally
//done

View File

@ -58,7 +58,7 @@ begin
CurrentDir := GetCurrentDir;
try
SetCurrentDir(flAttach.Directory);
dmUtils.RunOnBackground('/usr/bin/xdg-open' + ' "' + flAttach.FileName + '"');
dmUtils.RunOnBackground('/usr/bin/xdg-open' + ' ' + AnsiQuotedStr(flAttach.FileName, '"'));
finally
SetCurrentDir(CurrentDir)
end;

View File

@ -37,7 +37,7 @@ uses dUtils, dData;
procedure TfrmDbError.btnOpenErrFileClick(Sender : TObject);
begin
dmUtils.RunOnBackground('xdg-open ' + dmData.DataDir + 'mysql.err')
dmUtils.RunOnBackground('xdg-open ' + AnsiQuotedStr(dmData.DataDir + 'mysql.err', '"'))
end;
procedure TfrmDbError.btnVisitFAQClick(Sender : TObject);

View File

@ -159,7 +159,7 @@ begin
try
prg := cqrini.ReadString('ExtView', 'txt', '');
if prg<>'' then
dmUtils.RunOnBackground(prg + ' ' + '"' + edtFileName.Text + '"')
dmUtils.RunOnBackground(prg + ' ' + AnsiQuotedStr(edtFileName.Text, '"'))
else ShowMessage('No external text viewer defined!'+#10+'See: prefrences/External viewers');
finally
//done

View File

@ -7484,7 +7484,7 @@ begin
btnSave.Enabled := False; //disable manual saving when remote is on
tmrADIF.Interval := 250; //rate to read qsos from UDP (msec)
if run and FileExists(ExtractWord(1,path,[' '])) then
dmUtils.RunOnBackground(path)
dmUtils.RunOnBackground(AnsiQuotedStr(path, '"'))
end;