Browse Source

* Introduce reload method

git-svn-id: trunk@30260 -
michael 10 years ago
parent
commit
636fb64577
1 changed files with 8 additions and 2 deletions
  1. 8 2
      packages/fcl-json/src/jsonconf.pp

+ 8 - 2
packages/fcl-json/src/jsonconf.pp

@@ -73,6 +73,7 @@ type
   public
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
+    Procedure Reload;
     procedure Clear;
     procedure Flush;    // Writes the JSON file
     procedure OpenKey(const aPath: WideString; AllowCreate : Boolean);
@@ -528,12 +529,17 @@ begin
   DeletePath(APath);
 end;
 
-procedure TJSONConfig.Loaded;
+Procedure TJSONConfig.Reload;
+
 begin
-  inherited Loaded;
   if Length(Filename) > 0 then
     DoSetFilename(Filename,True);
 end;
+procedure TJSONConfig.Loaded;
+begin
+  inherited Loaded;
+  Reload;
+end;
 
 function TJSONConfig.FindPath(const APath: WideString; AllowCreate: Boolean
   ): TJSONObject;