Skip to content

Commit

Permalink
read external program path value from ini file
Browse files Browse the repository at this point in the history
  • Loading branch information
riderkick committed Jun 6, 2015
1 parent 52dfc95 commit 31a711b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mangadownloader/forms/frmMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2576,9 +2576,10 @@ procedure TMainForm.miFavoritesOpenWithClick(Sender: TObject);
f := '';
FindCloseUTF8(Info);

if edOptionExternal.Text <> '' then
s := options.ReadString('general', 'ExternalProgram', '');
if s <> '' then
begin
s := StringReplace(edOptionExternal.Text, '%PATH%', fd, [rfReplaceAll]);
s := StringReplace(s, '%PATH%', fd, [rfReplaceAll]);
s := StringReplace(s, '%FCHAPTER%', f, [rfReplaceAll]);
with TProcessUTF8.Create(nil) do try
CommandLine := s;
Expand Down Expand Up @@ -2638,9 +2639,10 @@ procedure TMainForm.miDownloadOpenWithClick(Sender: TObject);
FindCloseUTF8(Info);
end;

if edOptionExternal.Text <> '' then
s := options.ReadString('general', 'ExternalProgram', '');
if s <> '' then
begin
s := StringReplace(edOptionExternal.Text, '%PATH%', fd, [rfReplaceAll]);
s := StringReplace(s, '%PATH%', fd, [rfReplaceAll]);
s := StringReplace(s, '%FCHAPTER%', f, [rfReplaceAll]);
with TProcessUTF8.Create(nil) do try
CommandLine := s;
Expand Down

0 comments on commit 31a711b

Please sign in to comment.