Skip to content

Commit

Permalink
portable fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Oleynikov committed Dec 12, 2019
1 parent ff495a5 commit 84f17e3
Show file tree
Hide file tree
Showing 7 changed files with 4,671 additions and 10 deletions.
2 changes: 1 addition & 1 deletion NightscoutWatcher.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ uses

begin
Application.Initialize;
Application.Title:='Nightscout Watcher';
Application.Title := 'Nightscout Watcher';
Application.CreateForm(TfMain, fMain);
Application.Run;
end.
7 changes: 3 additions & 4 deletions NightscoutWatcher.lpi
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<AutoIncrementBuild Value="True"/>
<MajorVersionNr Value="2"/>
<MinorVersionNr Value="11"/>
<RevisionNr Value="2"/>
<BuildNr Value="122"/>
<RevisionNr Value="3"/>
<BuildNr Value="125"/>
<StringTable CompanyName="Sergey Oleynikov" LegalCopyright="Sergey Oleynikov" ProductName="Nightscout Watcher"/>
</VersionInfo>
<BuildModes Count="3">
Expand All @@ -38,7 +38,6 @@
<SearchPaths>
<IncludeFiles Value="Forms;Units;$(ProjOutDir)"/>
<OtherUnitFiles Value="Forms;Units"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
Expand Down Expand Up @@ -80,7 +79,7 @@
<SearchPaths>
<IncludeFiles Value="Forms;Units;$(ProjOutDir)"/>
<OtherUnitFiles Value="Forms;Units"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
<UnitOutputDirectory Value="r:\Дом\Здоровье\NightscoutWatcher"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
Expand Down
7 changes: 4 additions & 3 deletions forms/ufMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1175,16 +1175,17 @@ function TfMain.GetDrawStageSize(DrawStage: TDrawStage; ScaleIndex: Integer = -1

function TfMain.LoadEntriesData: Boolean;
var
FileName, Msg, DummyText: string;
FileName, Msg, DummyText, Url: string;
IsFileDownloaded: Boolean;
begin
Result := False;
FileName := TSettings.GetEntriesFileName;
Entries.Clear;
if not DebugMode then
begin
DeleteUrlCacheEntry(PAnsiChar(Settings.GetEntriesUrlByHours()));
IsFileDownloaded := URLDownloadToFile(nil, PAnsiChar(Settings.GetEntriesUrlByHours()), PAnsiChar(FileName), 0, nil) = S_OK;
Url := Settings.GetEntriesUrlByHours();
DeleteUrlCacheEntry(PAnsiChar(Url));
IsFileDownloaded := URLDownloadToFile(nil, PAnsiChar(Url), PAnsiChar(FileName), 0, nil) = S_OK;

if not IsFileDownloaded then
begin
Expand Down
Loading

0 comments on commit 84f17e3

Please sign in to comment.