tvplanit: Fix JSONDatastore deleting data file when started next time.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6669 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-09-29 23:00:35 +00:00
parent 6467d8a2fe
commit f81256b351
2 changed files with 6 additions and 3 deletions

View File

@ -4,7 +4,7 @@ unit Unit1;
{ Activate this define to use a JSON string instead of a file } { Activate this define to use a JSON string instead of a file }
{$DEFINE USE_JSON_STRING} {.$DEFINE USE_JSON_STRING}
interface interface

View File

@ -431,8 +431,8 @@ end;
procedure TVpJSONDatastore.Loaded; procedure TVpJSONDatastore.Loaded;
begin begin
inherited; inherited;
if not (csDesigning in ComponentState) then if not (csDesigning in ComponentState) and AutoConnect then
Connected := AutoConnect; Connected := true;
end; end;
procedure TVpJSONDatastore.LoadEvents; procedure TVpJSONDatastore.LoadEvents;
@ -615,6 +615,9 @@ begin
if (csDesigning in ComponentState) or (csLoading in ComponentState) then if (csDesigning in ComponentState) or (csLoading in ComponentState) then
Exit; Exit;
if Value = Connected then
exit;
{ Connecting or disconnecting? } { Connecting or disconnecting? }
if Value then if Value then
ReadJSON ReadJSON