Browse Source

Merge branch 'develop'

Unknown 6 years ago
parent
commit
a959a47814
24 changed files with 908 additions and 891 deletions
  1. 17 9
      Quick.Config.Base.pas
  2. 101 17
      Quick.Config.Json.pas
  3. 39 15
      Quick.Config.Registry.pas
  4. 23 14
      Quick.FileMonitor.pas
  5. 1 1
      Quick.Json.Serializer.pas
  6. 4 3
      README.md
  7. 21 14
      samples/delphi/QuickConfig/ConfigToFile/Main.pas
  8. 2 794
      samples/delphi/QuickConfig/ConfigToFile/Win64/Debug/config.json
  9. 3 3
      samples/delphi/QuickConfig/ConfigToRegistry/Main.pas
  10. 240 0
      samples/firemonkey/QuickConfig/ConfigToFile/Android/Debug/ConfigToFile.lnk
  11. 28 0
      samples/firemonkey/QuickConfig/ConfigToFile/Android/Debug/ConfigToFile.vsr
  12. 11 2
      samples/firemonkey/QuickConfig/ConfigToFile/ConfigToFile.deployproj
  13. 8 1
      samples/firemonkey/QuickConfig/ConfigToFile/ConfigToFile.dproj
  14. 22 9
      samples/firemonkey/QuickConfig/ConfigToFile/Main.pas
  15. BIN
      samples/firemonkey/QuickConfig/ConfigToFile/OSX32/Debug/ConfigToFile
  16. 7 0
      samples/firemonkey/QuickConfig/ConfigToFile/OSX32/Debug/ConfigToFile.entitlements
  17. 8 0
      samples/firemonkey/QuickConfig/ConfigToFile/OSX32/Debug/ConfigToFile.info.plist
  18. 358 2
      samples/firemonkey/QuickConfig/ConfigToFile/Win64/Debug/config.json
  19. BIN
      samples/firemonkey/QuickConfig/ConfigToFile/iOSSimulator/Debug/ConfigToFile
  20. BIN
      samples/firemonkey/QuickThreads/ScheduledTasks/OSX32/Debug/RunScheduledTasks
  21. BIN
      samples/firemonkey/QuickThreads/ScheduledTasks/iOSSimulator/Debug/RunScheduledTasks
  22. 2 2
      samples/fpc/QuickConfig/ConfigToFile/Config.json
  23. 12 4
      samples/fpc/QuickConfig/ConfigToFile/umain.pas
  24. 1 1
      samples/fpc/QuickConfig/ConfigToRegistry/umain.pas

+ 17 - 9
Quick.Config.Base.pas

@@ -7,7 +7,7 @@
   Author      : Kike Pérez
   Author      : Kike Pérez
   Version     : 1.5
   Version     : 1.5
   Created     : 26/01/2017
   Created     : 26/01/2017
-  Modified    : 21/01/2019
+  Modified    : 25/01/2019
 
 
   This file is part of QuickLib: https://github.com/exilon/QuickLib
   This file is part of QuickLib: https://github.com/exilon/QuickLib
 
 
@@ -41,14 +41,13 @@ uses
   fpjson,
   fpjson,
   jsonparser,
   jsonparser,
   fpjsonrtti,
   fpjsonrtti,
-  Quick.Json.Serializer;
   {$ELSE}
   {$ELSE}
-  Quick.Json.Serializer,
   DBXJSON,
   DBXJSON,
   System.JSON,
   System.JSON,
   Rest.Json.Types,
   Rest.Json.Types,
-  Rest.Json;
+  Rest.Json,
   {$ENDIF}
   {$ENDIF}
+  Quick.Json.Serializer;
 
 
 type
 type
 
 
@@ -104,6 +103,8 @@ type
     {$IFDEF DELPHIRX102_UP}[JsonIgnoreAttribute]{$ENDIF}
     {$IFDEF DELPHIRX102_UP}[JsonIgnoreAttribute]{$ENDIF}
     property LastSaved : TDateTime read fLastSaved write fLastSaved;
     property LastSaved : TDateTime read fLastSaved write fLastSaved;
     procedure Apply;
     procedure Apply;
+    //override this method to provide your class initialization
+    procedure Init; virtual;
     procedure DefaultValues; virtual;
     procedure DefaultValues; virtual;
     procedure Load; virtual;
     procedure Load; virtual;
     procedure Save; virtual;
     procedure Save; virtual;
@@ -111,6 +112,8 @@ type
     procedure FromJSON(const json : string);
     procedure FromJSON(const json : string);
   end;
   end;
 
 
+  EAppConfig = class(Exception);
+
 implementation
 implementation
 
 
 
 
@@ -129,6 +132,7 @@ begin
   fProvider := aConfigProvider;
   fProvider := aConfigProvider;
   fJsonIndent := True;
   fJsonIndent := True;
   fLastSaved := 0;
   fLastSaved := 0;
+  Init;
 end;
 end;
 
 
 procedure TAppConfig.Apply;
 procedure TAppConfig.Apply;
@@ -156,7 +160,7 @@ begin
   try
   try
     serializer := TJsonSerializer.Create(slPublishedProperty);
     serializer := TJsonSerializer.Create(slPublishedProperty);
     try
     try
-      Result := serializer.ObjectToJSON(Self,True);
+      Result := serializer.ObjectToJSON(Self,fJsonIndent);
     finally
     finally
       serializer.Free;
       serializer.Free;
     end;
     end;
@@ -172,11 +176,7 @@ begin
   try
   try
     serializer := TJsonSerializer.Create(slPublishedProperty);
     serializer := TJsonSerializer.Create(slPublishedProperty);
     try
     try
-      {$IF NOT DEFINED(FPC) AND DEFINED(NEXTGEN)}
       serializer.JsonToObject(Self,json);
       serializer.JsonToObject(Self,json);
-      {$ELSE}
-      Self := TAppConfig(serializer.JsonToObject(Self,json));
-      {$ENDIF}
     finally
     finally
       serializer.Free;
       serializer.Free;
     end;
     end;
@@ -185,14 +185,22 @@ begin
   end;
   end;
 end;
 end;
 
 
+procedure TAppConfig.Init;
+begin
+  //override to create private classes
+end;
+
 procedure TAppConfig.Load;
 procedure TAppConfig.Load;
 begin
 begin
+  if not Assigned(fProvider) then raise EAppConfig.Create('No provider assigned!');
   fProvider.Load(Self);
   fProvider.Load(Self);
 end;
 end;
 
 
 procedure TAppConfig.Save;
 procedure TAppConfig.Save;
 begin
 begin
+  if not Assigned(fProvider) then raise EAppConfig.Create('No provider assigned!');
   fProvider.Save(Self);
   fProvider.Save(Self);
+  fLastSaved := Now();
 end;
 end;
 
 
 end.
 end.

+ 101 - 17
Quick.Config.Json.pas

@@ -7,7 +7,7 @@
   Author      : Kike Pérez
   Author      : Kike Pérez
   Version     : 1.5
   Version     : 1.5
   Created     : 21/10/2017
   Created     : 21/10/2017
-  Modified    : 17/01/2019
+  Modified    : 25/01/2019
 
 
   This file is part of QuickLib: https://github.com/exilon/QuickLib
   This file is part of QuickLib: https://github.com/exilon/QuickLib
 
 
@@ -49,25 +49,50 @@ uses
   Rest.Json.Types,
   Rest.Json.Types,
   System.JSON,
   System.JSON,
   {$ENDIF}
   {$ENDIF}
+  Quick.FileMonitor,
   Quick.Config.Base;
   Quick.Config.Base;
 
 
 type
 type
 
 
+  TFileModifiedEvent = procedure of object;
+  TLoadConfigEvent = procedure of object;
+
   TAppConfigJsonProvider = class(TAppConfigProvider)
   TAppConfigJsonProvider = class(TAppConfigProvider)
   private
   private
     fFilename : string;
     fFilename : string;
+    fFileMonitor : TFileMonitor;
+    fOnFileModified : TFileModifiedEvent;
+    fLoaded : Boolean;
+    fReloadIfFileChanged : Boolean;
+    fOnConfigLoaded : TLoadConfigEvent;
+    fOnConfigReloaded : TLoadConfigEvent;
+    fNotifyReload : TLoadConfigEvent;
+    procedure CreateFileMonitor;
+    procedure FileModifiedNotify(MonitorNotify : TMonitorNotify);
+    procedure SetFileName(const Value: string);
+    procedure SetReloadIfFileChanged(const Value: Boolean);
+    procedure SetReloadNotify(aNotifyReload : TLoadConfigEvent);
+    procedure DoNofifyReload;
+  protected
     procedure Load(cConfig : TAppConfig); override;
     procedure Load(cConfig : TAppConfig); override;
     procedure Save(cConfig : TAppConfig); override;
     procedure Save(cConfig : TAppConfig); override;
   public
   public
-    constructor Create(const aFilename : string = ''); virtual;
-    property Filename : string read fFilename write fFilename;
+    constructor Create(const aFilename : string; aReloadIfFileChanged : Boolean = False); virtual;
+    destructor Destroy; override;
+    property Filename : string read fFilename write SetFileName;
+    property ReloadIfFileChanged : Boolean read fReloadIfFileChanged write SetReloadIfFileChanged;
+    property IsLoaded : Boolean read fLoaded;
+    property OnFileModified : TFileModifiedEvent read fOnFileModified write fOnFileModified;
+    property OnConfigLoaded : TLoadConfigEvent read fOnConfigLoaded write fOnConfigLoaded;
+    property OnConfigReloaded : TLoadConfigEvent read fOnConfigReloaded write fOnConfigReloaded;
   end;
   end;
 
 
   TAppConfigJson = class(TAppConfig)
   TAppConfigJson = class(TAppConfig)
   private
   private
     function GetProvider : TAppConfigJsonProvider;
     function GetProvider : TAppConfigJsonProvider;
+    procedure ReloadNotify;
   public
   public
-    constructor Create(const aFileName : string = ''); overload; virtual;
+    constructor Create(const aFilename : string; aReloadIfFileChanged : Boolean = False); virtual;
     destructor Destroy; override;
     destructor Destroy; override;
     property Provider : TAppConfigJsonProvider read GetProvider;
     property Provider : TAppConfigJsonProvider read GetProvider;
   end;
   end;
@@ -94,11 +119,45 @@ type
 
 
 implementation
 implementation
 
 
-constructor TAppConfigJsonProvider.Create(const aFilename : string = '');
+constructor TAppConfigJsonProvider.Create(const aFilename : string; aReloadIfFileChanged : Boolean = False);
 begin
 begin
   inherited Create;
   inherited Create;
   if aFilename = '' then fFilename := TPath.ChangeExtension(ParamStr(0),'json')
   if aFilename = '' then fFilename := TPath.ChangeExtension(ParamStr(0),'json')
     else fFilename := aFilename;
     else fFilename := aFilename;
+  fLoaded := False;
+  fReloadIfFileChanged := aReloadIfFileChanged;
+  if aReloadIfFileChanged then CreateFileMonitor;
+end;
+
+procedure TAppConfigJsonProvider.CreateFileMonitor;
+begin
+  fFileMonitor := TQuickFileMonitor.Create;
+  fFileMonitor.FileName := fFilename;
+  fFileMonitor.Interval := 2000;
+  fFileMonitor.Notifies := [TMonitorNotify.mnFileModified];
+  fFileMonitor.OnFileChange := FileModifiedNotify;
+  fFileMonitor.Enabled := True;
+end;
+
+destructor TAppConfigJsonProvider.Destroy;
+begin
+  if Assigned(fFileMonitor) then fFileMonitor.Free;
+  inherited;
+end;
+
+procedure TAppConfigJsonProvider.DoNofifyReload;
+begin
+  if Assigned(fNotifyReload) then fNotifyReload
+    else raise EAppConfig.Create('Not config assigned to reload!');
+end;
+
+procedure TAppConfigJsonProvider.FileModifiedNotify(MonitorNotify : TMonitorNotify);
+begin
+  if MonitorNotify = TMonitorNotify.mnFileModified then
+  begin
+    if Assigned(fOnFileModified) then fOnFileModified;
+    if fReloadIfFileChanged then DoNofifyReload;
+  end;
 end;
 end;
 
 
 procedure TAppConfigJsonProvider.Load(cConfig : TAppConfig);
 procedure TAppConfigJsonProvider.Load(cConfig : TAppConfig);
@@ -106,9 +165,6 @@ var
   json : TStrings;
   json : TStrings;
   Serializer : TJsonSerializer;
   Serializer : TJsonSerializer;
 begin
 begin
-  //create object with rtti if nil
-  //if not Assigned(Config) then Config := InitObject;
-
   if (not FileExists(fFilename)) and (CreateIfNotExists) then
   if (not FileExists(fFilename)) and (CreateIfNotExists) then
   begin
   begin
     TAppConfig(cConfig).DefaultValues;
     TAppConfig(cConfig).DefaultValues;
@@ -130,8 +186,14 @@ begin
     finally
     finally
       json.Free;
       json.Free;
     end;
     end;
+    if not fLoaded then
+    begin
+      fLoaded := True;
+      if Assigned(fOnConfigLoaded) then fOnConfigLoaded;
+    end
+    else if Assigned(fOnConfigReloaded) then fOnConfigReloaded;
   except
   except
-    on e : Exception do raise e;
+    on e : Exception do raise EAppConfig.Create(e.Message);
   end;
   end;
 end;
 end;
 
 
@@ -139,11 +201,8 @@ procedure TAppConfigJsonProvider.Save(cConfig : TAppConfig);
 var
 var
   json : TStrings;
   json : TStrings;
   Serializer : TJsonSerializer;
   Serializer : TJsonSerializer;
-  ctx : TRttiContext;
-  rprop : TRttiProperty;
 begin
 begin
-  //create object with rtti if nil
-  if not Assigned(cConfig) then cConfig := TAppConfigJson.Create;
+  if not Assigned(cConfig) then cConfig := TAppConfigJson.Create(fFilename,fReloadIfFileChanged);
 
 
   try
   try
     json := TStringList.Create;
     json := TStringList.Create;
@@ -157,21 +216,40 @@ begin
         serializer.Free;
         serializer.Free;
       end;
       end;
       json.SaveToFile(fFilename);
       json.SaveToFile(fFilename);
-      cConfig.LastSaved := Now;
     finally
     finally
       json.Free;
       json.Free;
     end;
     end;
   except
   except
-    on e : Exception do raise e;
+    on e : Exception do raise EAppConfig.Create(e.Message);
   end;
   end;
 end;
 end;
 
 
 
 
+procedure TAppConfigJsonProvider.SetFileName(const Value: string);
+begin
+  fFilename := Value;
+  if Assigned(fFileMonitor) then fFileMonitor.Free;
+  if fReloadIfFileChanged then CreateFileMonitor;
+end;
+
+procedure TAppConfigJsonProvider.SetReloadIfFileChanged(const Value: Boolean);
+begin
+  fReloadIfFileChanged := Value;
+  if Assigned(fFileMonitor) then fFileMonitor.Free;
+  if fReloadIfFileChanged then CreateFileMonitor;
+end;
+
+procedure TAppConfigJsonProvider.SetReloadNotify(aNotifyReload: TLoadConfigEvent);
+begin
+  fNotifyReload := aNotifyReload;
+end;
+
 { TAppConfigJson }
 { TAppConfigJson }
 
 
-constructor TAppConfigJson.Create(const aFileName : string = '');
+constructor TAppConfigJson.Create(const aFilename : string; aReloadIfFileChanged : Boolean = False);
 begin
 begin
-  inherited Create(TAppConfigJsonProvider.Create(aFileName));
+  inherited Create(TAppConfigJsonProvider.Create(aFileName,aReloadIfFileChanged));
+  TAppConfigJsonProvider(fProvider).SetReloadNotify(ReloadNotify);
 end;
 end;
 
 
 destructor TAppConfigJson.Destroy;
 destructor TAppConfigJson.Destroy;
@@ -181,7 +259,13 @@ end;
 
 
 function TAppConfigJson.GetProvider: TAppConfigJsonProvider;
 function TAppConfigJson.GetProvider: TAppConfigJsonProvider;
 begin
 begin
+  if not Assigned(fProvider) then raise EAppConfig.Create('No provider assigned!');
   Result := TAppConfigJsonProvider(fProvider);
   Result := TAppConfigJsonProvider(fProvider);
 end;
 end;
 
 
+procedure TAppConfigJson.ReloadNotify;
+begin
+  Self.Load;
+end;
+
 end.
 end.

+ 39 - 15
Quick.Config.Registry.pas

@@ -7,7 +7,7 @@
   Author      : Kike Pérez
   Author      : Kike Pérez
   Version     : 1.5
   Version     : 1.5
   Created     : 21/10/2017
   Created     : 21/10/2017
-  Modified    : 17/01/2019
+  Modified    : 25/01/2019
 
 
   This file is part of QuickLib: https://github.com/exilon/QuickLib
   This file is part of QuickLib: https://github.com/exilon/QuickLib
 
 
@@ -127,7 +127,7 @@ begin
   if aHRoot <> HKEY_CURRENT_USER then fRootKey := aHRoot
   if aHRoot <> HKEY_CURRENT_USER then fRootKey := aHRoot
     else fRootKey := HKEY_CURRENT_USER;
     else fRootKey := HKEY_CURRENT_USER;
   if aMainKey <> '' then fMainKey := aMainKey
   if aMainKey <> '' then fMainKey := aMainKey
-    else fMainKey := '_AppConfig';
+    else fMainKey := ExtractFileNameWithoutExt(ParamStr(0));
   fRegConfig := TRegistry.Create(KEY_READ or KEY_WRITE);
   fRegConfig := TRegistry.Create(KEY_READ or KEY_WRITE);
 end;
 end;
 
 
@@ -234,8 +234,12 @@ begin
     end;
     end;
     if fRegConfig.KeyExists(aCurrentKey + '_bak') then fRegConfig.DeleteKey(aCurrentKey + '_bak');
     if fRegConfig.KeyExists(aCurrentKey + '_bak') then fRegConfig.DeleteKey(aCurrentKey + '_bak');
   except
   except
-    fRegConfig.DeleteKey(aCurrentKey);
-    fRegConfig.MoveKey(aCurrentKey+'_bak',aCurrentKey,True);
+    on E : Exception do
+    begin
+      fRegConfig.DeleteKey(aCurrentKey);
+      fRegConfig.MoveKey(aCurrentKey+'_bak',aCurrentKey,True);
+      raise EAppConfig.Create(e.message);
+    end;
   end;
   end;
 end;
 end;
 
 
@@ -324,6 +328,7 @@ var
 begin
 begin
   Result := False;
   Result := False;
   if cCurrentKey <> '' then fRegConfig.OpenKeyReadOnly(cCurrentKey);
   if cCurrentKey <> '' then fRegConfig.OpenKeyReadOnly(cCurrentKey);
+  // else Exit;
   //check if exists RegKey numeric (indicates is a Array)
   //check if exists RegKey numeric (indicates is a Array)
   RegKeyList := TStringList.Create;
   RegKeyList := TStringList.Create;
   try
   try
@@ -354,15 +359,15 @@ end;
 
 
 class function TAppConfigRegistryProvider.IsSimpleJsonValue(v: TJSONValue): Boolean;
 class function TAppConfigRegistryProvider.IsSimpleJsonValue(v: TJSONValue): Boolean;
 begin
 begin
-  Result := (v is TJSONNumber)
-    or (v is TJSONString)
+  Result := (v is {$IFDEF FPC}fpjson.TJsonIntegerNumber{$ELSE}TJSONNumber{$ENDIF})
+    or (v is {$IFDEF FPC}fpjson.{$ENDIF}TJSONString)
     {$IFNDEF FPC}
     {$IFNDEF FPC}
     or (v is TJSONTrue)
     or (v is TJSONTrue)
     or (v is TJSONFalse)
     or (v is TJSONFalse)
     {$ELSE}
     {$ELSE}
-    or (v is TJsonBool)
+    or (v is {$IFDEF FPC}fpjson.TJSONBoolean{$ELSE}TJsonBool{$ENDIF})
     {$ENDIF}
     {$ENDIF}
-    or (v is TJSONNull);
+    or (v is {$IFDEF FPC}fpjson.{$ENDIF}TJSONNull);
 end;
 end;
 
 
 function TAppConfigRegistryProvider.ReadRegValue(const cCurrentKey, cName : string) : TJSONValue;
 function TAppConfigRegistryProvider.ReadRegValue(const cCurrentKey, cName : string) : TJSONValue;
@@ -398,11 +403,15 @@ var
   aValue : string;
   aValue : string;
 begin
 begin
   aName := cName.DeQuotedString('"');
   aName := cName.DeQuotedString('"');
+  {$IFNDEF FPC}
   aValue := cValue.ToString.DeQuotedString('"');
   aValue := cValue.ToString.DeQuotedString('"');
+  {$ELSE}
+  aValue := cValue.AsString;// .DeQuotedString('"');
+  {$ENDIF}
   fRegConfig.OpenKey(cCurrentKey,True);
   fRegConfig.OpenKey(cCurrentKey,True);
-  if cValue is TJSONNumber then  fRegConfig.WriteInteger(aName,StrToInt64(aValue))
-   else if cValue is TJSONString then fRegConfig.WriteString(aName,aValue)
-    else if cValue is TJSONBool then fRegConfig.WriteString(aName,aValue);
+  if cValue is {$IFDEF FPC}fpjson.TJSONIntegerNumber{$ELSE}TJSONNumber{$ENDIF} then fRegConfig.WriteInteger(aName,StrToInt64(aValue))
+   else if cValue is {$IFDEF FPC}fpjson.{$ENDIF}TJSONString then fRegConfig.WriteString(aName,aValue)
+    else if cValue is {$IFDEF FPC}fpjson.TJSONBoolean{$ELSE}TJSONBool{$ENDIF} then fRegConfig.WriteString(aName,aValue);
       //else if cValue is TJSONNull then fRegConfig.WriteString(aName,'');
       //else if cValue is TJSONNull then fRegConfig.WriteString(aName,'');
 end;
 end;
 
 
@@ -420,7 +429,14 @@ begin
   //read root values
   //read root values
   RegValueList := TStringList.Create;
   RegValueList := TStringList.Create;
   try
   try
+    {$IFNDEF FPC}
     fRegConfig.GetValueNames(RegValueList);
     fRegConfig.GetValueNames(RegValueList);
+    {$ELSE}
+    try
+      fRegConfig.GetValueNames(RegValueList);
+    except
+    end;
+    {$ENDIF}
     for RegValue in RegValueList do
     for RegValue in RegValueList do
     begin
     begin
       newObj.AddPair(RegValue,ReadRegValue(cCurrentKey,RegValue));
       newObj.AddPair(RegValue,ReadRegValue(cCurrentKey,RegValue));
@@ -431,7 +447,14 @@ begin
   //read root keys
   //read root keys
   RegKeyList := TStringList.Create;
   RegKeyList := TStringList.Create;
   try
   try
+    {$IFNDEF FPC}
     fRegConfig.GetKeyNames(RegKeyList);
     fRegConfig.GetKeyNames(RegKeyList);
+    {$ELSE}
+    try
+      fRegConfig.GetKeyNames(RegKeyList);
+    except
+    end;
+    {$ENDIF}
     for RegKey in RegKeyList do
     for RegKey in RegKeyList do
     begin
     begin
       fRegConfig.OpenKeyReadOnly(cCurrentKey + '\' + RegKey);
       fRegConfig.OpenKeyReadOnly(cCurrentKey + '\' + RegKey);
@@ -514,13 +537,13 @@ begin
     Exit;
     Exit;
   end;
   end;
 
 
-  if jPair.JsonValue is TJSONObject then
+  if jPair.JsonValue is {$IFDEF FPC}fpjson.{$ENDIF}TJSONObject then
   begin
   begin
     aCount := TJSONObject(jPair.JsonValue).Count;
     aCount := TJSONObject(jPair.JsonValue).Count;
     for i := 0 to aCount - 1 do
     for i := 0 to aCount - 1 do
       ProcessPairWrite(cCurrentKey + '\' + jPair.JsonString{$IFNDEF FPC}.ToString{$ENDIF}.DeQuotedString('"'), TJSONObject(jPair.JsonValue),i);
       ProcessPairWrite(cCurrentKey + '\' + jPair.JsonString{$IFNDEF FPC}.ToString{$ENDIF}.DeQuotedString('"'), TJSONObject(jPair.JsonValue),i);
   end
   end
-  else if jPair.JsonValue is TJSONArray then
+  else if jPair.JsonValue is {$IFDEF FPC}fpjson.{$ENDIF}TJSONArray then
   begin
   begin
     aCount := TJSONArray(jPair.JsonValue).Count;
     aCount := TJSONArray(jPair.JsonValue).Count;
     for i := 0 to aCount - 1 do
     for i := 0 to aCount - 1 do
@@ -545,13 +568,13 @@ begin
     Exit;
     Exit;
   end;
   end;
 
 
-  if jValue is TJSONObject then
+  if jValue is {$IFDEF FPC}fpjson.{$ENDIF}TJSONObject then
   begin
   begin
     aCount := TJSONObject(jValue).Count;
     aCount := TJSONObject(jValue).Count;
     for i := 0 to aCount - 1 do
     for i := 0 to aCount - 1 do
       ProcessPairWrite(cCurrentKey + '\' + Zeroes(aIndex,dig),TJSONObject(jValue),i);
       ProcessPairWrite(cCurrentKey + '\' + Zeroes(aIndex,dig),TJSONObject(jValue),i);
   end
   end
-  else if jValue is TJSONArray then
+  else if jValue is {$IFDEF FPC}fpjson.{$ENDIF}TJSONArray then
   begin
   begin
     aCount := TJSONArray(jValue).Count;
     aCount := TJSONArray(jValue).Count;
     for i := 0 to aCount - 1 do
     for i := 0 to aCount - 1 do
@@ -574,6 +597,7 @@ end;
 
 
 function TAppConfigRegistry.GetProvider: TAppConfigRegistryProvider;
 function TAppConfigRegistry.GetProvider: TAppConfigRegistryProvider;
 begin
 begin
+  if not Assigned(fProvider) then raise EAppConfig.Create('No provider assigned!');
   Result := TAppConfigRegistryProvider(fProvider);
   Result := TAppConfigRegistryProvider(fProvider);
 end;
 end;
 
 

+ 23 - 14
Quick.FileMonitor.pas

@@ -1,13 +1,13 @@
 { ***************************************************************************
 { ***************************************************************************
 
 
-  Copyright (c) 2015-2018 Kike Pérez
+  Copyright (c) 2015-2019 Kike Pérez
 
 
   Unit        : Quick.FileMonitor
   Unit        : Quick.FileMonitor
   Description : Watch for single file changes
   Description : Watch for single file changes
   Author      : Kike Pérez
   Author      : Kike Pérez
-  Version     : 1.1
+  Version     : 1.2
   Created     : 11/09/2017
   Created     : 11/09/2017
-  Modified    : 07/04/2018
+  Modified    : 25/01/2019
 
 
   This file is part of QuickLib: https://github.com/exilon/QuickLib
   This file is part of QuickLib: https://github.com/exilon/QuickLib
 
 
@@ -37,6 +37,9 @@ uses
   Classes,
   Classes,
   {$IFDEF MSWINDOWS}
   {$IFDEF MSWINDOWS}
   Windows,
   Windows,
+  SyncObjs,
+  {$ELSE}
+  SyncObjs,
   {$ENDIF}
   {$ENDIF}
   SysUtils,
   SysUtils,
   {$IFDEF FPC}
   {$IFDEF FPC}
@@ -51,10 +54,10 @@ type
   TMonitorWatch = set of TMonitorNotify;
   TMonitorWatch = set of TMonitorNotify;
   TFileChangeNotify = procedure(MonitorNofify : TMonitorNotify) of object;
   TFileChangeNotify = procedure(MonitorNofify : TMonitorNotify) of object;
 
 
-  TQuickFileMonitor = class(TThread)
+  TFileMonitor = class(TThread)
   private
   private
     fFileName : string;
     fFileName : string;
-    fTickEvent : THandle;
+    fTickEvent : TSimpleEvent;
     fInterval : Integer;
     fInterval : Integer;
     fNotifies : TMonitorWatch;
     fNotifies : TMonitorWatch;
     fEnabled : Boolean;
     fEnabled : Boolean;
@@ -75,9 +78,11 @@ type
     property Enabled : Boolean read fEnabled write SetStatus;
     property Enabled : Boolean read fEnabled write SetStatus;
   end;
   end;
 
 
+  TQuickFileMonitor = TFileMonitor;
+
 implementation
 implementation
 
 
-constructor TQuickFileMonitor.Create;
+constructor TFileMonitor.Create;
 begin
 begin
   inherited Create(True);
   inherited Create(True);
   Self.FreeOnTerminate := False;
   Self.FreeOnTerminate := False;
@@ -86,19 +91,23 @@ begin
   fModifedDate := 0;
   fModifedDate := 0;
   fCurrentMonitorNotify := mnNone;
   fCurrentMonitorNotify := mnNone;
   fNotifies := [mnFileCreated,mnFileModified,mnFileDeleted];
   fNotifies := [mnFileCreated,mnFileModified,mnFileDeleted];
-  fTickEvent := CreateEvent(nil, True, False, nil);
+  {$IFDEF FPC}
+  fTickEvent := TSimpleEvent.Create;
+  {$ELSE}
+  fTickEvent := TSimpleEvent.Create(nil,True,False,'');
+  {$ENDIF}
   Self.Resume;
   Self.Resume;
 end;
 end;
 
 
-destructor TQuickFileMonitor.Destroy;
+destructor TFileMonitor.Destroy;
 begin
 begin
   if not Terminated then Terminate;
   if not Terminated then Terminate;
-  SetEvent(fTickEvent);
-  CloseHandle(fTickEvent);
+  fTickEvent.SetEvent;
+  fTickEvent.Free;
   inherited;
   inherited;
 end;
 end;
 
 
-procedure TQuickFileMonitor.Execute;
+procedure TFileMonitor.Execute;
 var
 var
   LastModifiedDate : TDateTime;
   LastModifiedDate : TDateTime;
 begin
 begin
@@ -106,7 +115,7 @@ begin
   while not Terminated do
   while not Terminated do
   begin
   begin
     fCurrentMonitorNotify := mnNone;
     fCurrentMonitorNotify := mnNone;
-    if WaitForSingleObject(fTickEvent,fInterval) = WAIT_TIMEOUT then
+    if fTickEvent.WaitFor(fInterval) = TWaitResult.wrTimeout then
     begin
     begin
       if fEnabled then
       if fEnabled then
       begin
       begin
@@ -154,7 +163,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-procedure TQuickFileMonitor.SetStatus(Status : Boolean);
+procedure TFileMonitor.SetStatus(Status : Boolean);
 begin
 begin
   if fEnabled <> Status then
   if fEnabled <> Status then
   begin
   begin
@@ -168,7 +177,7 @@ begin
   end;
   end;
 end;
 end;
 
 
-procedure TQuickFileMonitor.NotifyEvent;
+procedure TFileMonitor.NotifyEvent;
 begin
 begin
   if Assigned(fOnChangeNotify) then fOnChangeNotify(fCurrentMonitorNotify);
   if Assigned(fOnChangeNotify) then fOnChangeNotify(fCurrentMonitorNotify);
 end;
 end;

+ 1 - 1
Quick.Json.Serializer.pas

@@ -518,7 +518,7 @@ begin
     Result := aObject;
     Result := aObject;
     rValue := nil;
     rValue := nil;
     {$IFNDEF FPC}
     {$IFNDEF FPC}
-    member := TJSONPair(aJson.GetValue(aName));
+     member := TJSONPair(aJson.GetValue(aName));
     {$ELSE}
     {$ELSE}
     member := TJsonObject(aJson.Find(aName));
     member := TJsonObject(aJson.Find(aName));
     {$ENDIF}
     {$ENDIF}

+ 4 - 3
README.md

@@ -5,6 +5,7 @@
 --------
 --------
 
 
 Small delphi/Firemonkey(Windows,Android,OSX & IOS) and fpc(Windows & Linux) library containing interesting and quick to implement functions, created to simplify application development and crossplatform support and improve productivity.
 Small delphi/Firemonkey(Windows,Android,OSX & IOS) and fpc(Windows & Linux) library containing interesting and quick to implement functions, created to simplify application development and crossplatform support and improve productivity.
+* NEW: QuickConfigJson reload if config file changed
 * NEW: First version with OSX/IOS partial support
 * NEW: First version with OSX/IOS partial support
 * NEW: Refactorized Quick.Config (more easy)
 * NEW: Refactorized Quick.Config (more easy)
 * NEW: TScheduledTasks: New schedule methods.
 * NEW: TScheduledTasks: New schedule methods.
@@ -168,7 +169,7 @@ Log.Add('Error x',etError);
 Log.Add('Error is %s',[ErrorStr],etError);
 Log.Add('Error is %s',[ErrorStr],etError);
 ```
 ```
 
 
-**Quick.Config:** Load/Save a config as json file or Windows Registry keys. Create a descend class from TAppConfigJson or TAppConfigRegistry and add private variables will be loaded/saved.
+**Quick.Config:** Load/Save a config as json file or Windows Registry keys. Create a descend class from TAppConfigJson or TAppConfigRegistry and add private variables will be loaded/saved. TAppConfiJson allow detect if config file was changed and do a config reload.
 
 
 ```delphi
 ```delphi
 //create a class heritage
 //create a class heritage
@@ -185,9 +186,9 @@ end;
 
 
 //create your config to json file
 //create your config to json file
 //Add Quick.Config.Json to your uses
 //Add Quick.Config.Json to your uses
-MyConfig := TMyConfig.Create;
+MyConfig := TMyConfig.Create('Config.json');
 MyConfig.Provider.CreateIfNotExists := True;
 MyConfig.Provider.CreateIfNotExists := True;
-MyConfig.Provider.Filename := 'Config.json';
+MyConfig.Provider.ReloadIfFileModified := True;
 MyConfig.Name := 'John';
 MyConfig.Name := 'John';
 MyConfig.Surname := 'Smith';
 MyConfig.Surname := 'Smith';
 //load
 //load

+ 21 - 14
samples/delphi/QuickConfig/ConfigToFile/Main.pas

@@ -64,8 +64,8 @@ type
     property SessionName : string read fSessionName write fSessionName;
     property SessionName : string read fSessionName write fSessionName;
     property WorkList : TObjectList<TWorker> read fWorkList write fWorkList;
     property WorkList : TObjectList<TWorker> read fWorkList write fWorkList;
   public
   public
-    constructor Create;
     destructor Destroy; override;
     destructor Destroy; override;
+    procedure Init; override;
     procedure DefaultValues; override;
     procedure DefaultValues; override;
   end;
   end;
 
 
@@ -79,12 +79,13 @@ type
     procedure SetConfig(cConfig: TMyConfig);
     procedure SetConfig(cConfig: TMyConfig);
     function TestConfig(cConfig1, cConfig2 : TMyConfig) : Boolean;
     function TestConfig(cConfig1, cConfig2 : TMyConfig) : Boolean;
     procedure FormClose(Sender: TObject; var Action: TCloseAction);
     procedure FormClose(Sender: TObject; var Action: TCloseAction);
+    procedure OnFileModified;
   end;
   end;
 
 
 var
 var
   MainForm: TMainForm;
   MainForm: TMainForm;
   ConfigTest : TMyConfig;
   ConfigTest : TMyConfig;
-  ConfigReg : TMyConfig;
+  ConfigJson : TMyConfig;
 
 
 implementation
 implementation
 
 
@@ -93,16 +94,16 @@ implementation
 procedure TMainForm.btnLoadFileClick(Sender: TObject);
 procedure TMainForm.btnLoadFileClick(Sender: TObject);
 begin
 begin
   meInfo.Lines.Add('Load ConfigReg');
   meInfo.Lines.Add('Load ConfigReg');
-  ConfigReg.Load;
-  meInfo.Lines.Add(ConfigReg.ToJSON);
-  if TestConfig(configtest,ConfigReg) then meInfo.Lines.Add('Test passed successfully!');
+  ConfigJson.Load;
+  meInfo.Lines.Add(ConfigJson.ToJSON);
+  if TestConfig(configtest,ConfigJson) then meInfo.Lines.Add('Test passed successfully!');
  end;
  end;
 
 
 procedure TMainForm.btnSaveFileClick(Sender: TObject);
 procedure TMainForm.btnSaveFileClick(Sender: TObject);
 begin
 begin
-  SetConfig(ConfigReg);
-  ConfigReg.Save;
-  meInfo.Lines.Add('Saved Config in Registry at ' + DateTimeToStr(ConfigReg.LastSaved));
+  SetConfig(ConfigJson);
+  ConfigJson.Save;
+  meInfo.Lines.Add('Saved Config in Registry at ' + DateTimeToStr(ConfigJson.LastSaved));
 end;
 end;
 
 
 procedure TMainForm.SetConfig(cConfig : TMyConfig);
 procedure TMainForm.SetConfig(cConfig : TMyConfig);
@@ -171,24 +172,30 @@ end;
 
 
 procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
 procedure TMainForm.FormClose(Sender: TObject; var Action: TCloseAction);
 begin
 begin
-  if Assigned(ConfigReg) then ConfigReg.Free;
+  if Assigned(ConfigJson) then ConfigJson.Free;
   if Assigned(ConfigTest) then ConfigTest.Free;
   if Assigned(ConfigTest) then ConfigTest.Free;
 end;
 end;
 
 
 procedure TMainForm.FormCreate(Sender: TObject);
 procedure TMainForm.FormCreate(Sender: TObject);
 begin
 begin
-  ConfigReg := TMyConfig.Create;
-  ConfigReg.Provider.Filename := '.\config.json';
+  ConfigJson := TMyConfig.Create('.\config.json');
+  ConfigJson.Provider.OnFileModified := OnFileModified;
+  ConfigJson.Provider.ReloadIfFileChanged := True;
   //create config test to compare later
   //create config test to compare later
-  ConfigTest := TMyConfig.Create;
+  ConfigTest := TMyConfig.Create('');
   SetConfig(ConfigTest);
   SetConfig(ConfigTest);
 end;
 end;
 
 
+procedure TMainForm.OnFileModified;
+begin
+  meInfo.Lines.Add('Config file modified. Config will be reload');
+end;
+
 { TMyConfig }
 { TMyConfig }
 
 
-constructor TMyConfig.Create;
+procedure TMyConfig.Init;
 begin
 begin
-  inherited Create;
+  inherited;
   WorkList := TObjectList<TWorker>.Create(True);
   WorkList := TObjectList<TWorker>.Create(True);
   DefaultValues;
   DefaultValues;
 end;
 end;

+ 2 - 794
samples/delphi/QuickConfig/ConfigToFile/Win64/Debug/config.json

@@ -29,246 +29,6 @@
         "PosY": 0
         "PosY": 0
     },
     },
     "History": [
     "History": [
-        {
-            "Id": 0,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 1,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 2,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 3,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 4,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 5,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 6,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 7,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 8,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 9,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 10,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 11,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 12,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 13,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 14,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 15,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 0,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 1,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 2,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 3,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 4,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 5,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 6,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 7,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 8,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 9,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 10,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 11,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 12,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 13,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 14,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 15,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 0,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 1,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 2,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 3,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 4,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 5,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 6,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 7,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 8,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 9,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 10,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 11,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 12,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 13,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 14,
-            "Priority": "msLow",
-            "Redundant": true
-        },
-        {
-            "Id": 15,
-            "Priority": "msLow",
-            "Redundant": true
-        },
         {
         {
             "Id": 0,
             "Id": 0,
             "Priority": "msLow",
             "Priority": "msLow",
@@ -351,567 +111,15 @@
         }
         }
     ],
     ],
     "Complex": {
     "Complex": {
-        "Id": 25297232,
+        "Id": 24336464,
         "Priority": "msHigh",
         "Priority": "msHigh",
         "Redundant": false
         "Redundant": false
     },
     },
-    "ModifyDate": "2019-01-21T23:15:39.665Z",
+    "ModifyDate": "2019-01-26T01:38:10.340Z",
     "Title": "a fresh title",
     "Title": "a fresh title",
     "SessionName": "First Session",
     "SessionName": "First Session",
     "WorkList": {
     "WorkList": {
         "List": [
         "List": [
-            {
-                "Name": "Process 0",
-                "Active": false
-            },
-            {
-                "Name": "Process 1",
-                "Active": false
-            },
-            {
-                "Name": "Process 2",
-                "Active": false
-            },
-            {
-                "Name": "Process 3",
-                "Active": false
-            },
-            {
-                "Name": "Process 4",
-                "Active": false
-            },
-            {
-                "Name": "Process 5",
-                "Active": false
-            },
-            {
-                "Name": "Process 6",
-                "Active": false
-            },
-            {
-                "Name": "Process 7",
-                "Active": false
-            },
-            {
-                "Name": "Process 8",
-                "Active": false
-            },
-            {
-                "Name": "Process 9",
-                "Active": false
-            },
-            {
-                "Name": "Process 10",
-                "Active": false
-            },
-            {
-                "Name": "Process 11",
-                "Active": false
-            },
-            {
-                "Name": "Process 12",
-                "Active": false
-            },
-            {
-                "Name": "Process 13",
-                "Active": false
-            },
-            {
-                "Name": "Process 14",
-                "Active": false
-            },
-            {
-                "Name": "Process 15",
-                "Active": false
-            },
-            {
-                "Name": "Process 16",
-                "Active": false
-            },
-            {
-                "Name": "Process 17",
-                "Active": false
-            },
-            {
-                "Name": "Process 18",
-                "Active": false
-            },
-            {
-                "Name": "Process 19",
-                "Active": false
-            },
-            {
-                "Name": "Process 20",
-                "Active": false
-            },
-            {
-                "Name": "Process 21",
-                "Active": false
-            },
-            {
-                "Name": "Process 22",
-                "Active": false
-            },
-            {
-                "Name": "Process 0",
-                "Active": false
-            },
-            {
-                "Name": "Process 1",
-                "Active": false
-            },
-            {
-                "Name": "Process 2",
-                "Active": false
-            },
-            {
-                "Name": "Process 3",
-                "Active": false
-            },
-            {
-                "Name": "Process 4",
-                "Active": false
-            },
-            {
-                "Name": "Process 5",
-                "Active": false
-            },
-            {
-                "Name": "Process 6",
-                "Active": false
-            },
-            {
-                "Name": "Process 7",
-                "Active": false
-            },
-            {
-                "Name": "Process 8",
-                "Active": false
-            },
-            {
-                "Name": "Process 9",
-                "Active": false
-            },
-            {
-                "Name": "Process 10",
-                "Active": false
-            },
-            {
-                "Name": "Process 11",
-                "Active": false
-            },
-            {
-                "Name": "Process 12",
-                "Active": false
-            },
-            {
-                "Name": "Process 13",
-                "Active": false
-            },
-            {
-                "Name": "Process 14",
-                "Active": false
-            },
-            {
-                "Name": "Process 15",
-                "Active": false
-            },
-            {
-                "Name": "Process 16",
-                "Active": false
-            },
-            {
-                "Name": "Process 17",
-                "Active": false
-            },
-            {
-                "Name": "Process 18",
-                "Active": false
-            },
-            {
-                "Name": "Process 19",
-                "Active": false
-            },
-            {
-                "Name": "Process 20",
-                "Active": false
-            },
-            {
-                "Name": "Process 21",
-                "Active": false
-            },
-            {
-                "Name": "Process 22",
-                "Active": false
-            },
-            {
-                "Name": "Process 0",
-                "Active": false
-            },
-            {
-                "Name": "Process 1",
-                "Active": false
-            },
-            {
-                "Name": "Process 2",
-                "Active": false
-            },
-            {
-                "Name": "Process 3",
-                "Active": false
-            },
-            {
-                "Name": "Process 4",
-                "Active": false
-            },
-            {
-                "Name": "Process 5",
-                "Active": false
-            },
-            {
-                "Name": "Process 6",
-                "Active": false
-            },
-            {
-                "Name": "Process 7",
-                "Active": false
-            },
-            {
-                "Name": "Process 8",
-                "Active": false
-            },
-            {
-                "Name": "Process 9",
-                "Active": false
-            },
-            {
-                "Name": "Process 10",
-                "Active": false
-            },
-            {
-                "Name": "Process 11",
-                "Active": false
-            },
-            {
-                "Name": "Process 12",
-                "Active": false
-            },
-            {
-                "Name": "Process 13",
-                "Active": false
-            },
-            {
-                "Name": "Process 14",
-                "Active": false
-            },
-            {
-                "Name": "Process 15",
-                "Active": false
-            },
-            {
-                "Name": "Process 16",
-                "Active": false
-            },
-            {
-                "Name": "Process 17",
-                "Active": false
-            },
-            {
-                "Name": "Process 18",
-                "Active": false
-            },
-            {
-                "Name": "Process 19",
-                "Active": false
-            },
-            {
-                "Name": "Process 20",
-                "Active": false
-            },
-            {
-                "Name": "Process 21",
-                "Active": false
-            },
-            {
-                "Name": "Process 22",
-                "Active": false
-            },
-            {
-                "Name": "Process 0",
-                "Active": false
-            },
-            {
-                "Name": "Process 1",
-                "Active": false
-            },
-            {
-                "Name": "Process 2",
-                "Active": false
-            },
-            {
-                "Name": "Process 3",
-                "Active": false
-            },
-            {
-                "Name": "Process 4",
-                "Active": false
-            },
-            {
-                "Name": "Process 5",
-                "Active": false
-            },
-            {
-                "Name": "Process 6",
-                "Active": false
-            },
-            {
-                "Name": "Process 7",
-                "Active": false
-            },
-            {
-                "Name": "Process 8",
-                "Active": false
-            },
-            {
-                "Name": "Process 9",
-                "Active": false
-            },
-            {
-                "Name": "Process 10",
-                "Active": false
-            },
-            {
-                "Name": "Process 11",
-                "Active": false
-            },
-            {
-                "Name": "Process 12",
-                "Active": false
-            },
-            {
-                "Name": "Process 13",
-                "Active": false
-            },
-            {
-                "Name": "Process 14",
-                "Active": false
-            },
-            {
-                "Name": "Process 15",
-                "Active": false
-            },
-            {
-                "Name": "Process 16",
-                "Active": false
-            },
-            {
-                "Name": "Process 17",
-                "Active": false
-            },
-            {
-                "Name": "Process 18",
-                "Active": false
-            },
-            {
-                "Name": "Process 19",
-                "Active": false
-            },
-            {
-                "Name": "Process 20",
-                "Active": false
-            },
-            {
-                "Name": "Process 21",
-                "Active": false
-            },
-            {
-                "Name": "Process 22",
-                "Active": false
-            },
-            {
-                "Name": "Process 0",
-                "Active": false
-            },
-            {
-                "Name": "Process 1",
-                "Active": false
-            },
-            {
-                "Name": "Process 2",
-                "Active": false
-            },
-            {
-                "Name": "Process 3",
-                "Active": false
-            },
-            {
-                "Name": "Process 4",
-                "Active": false
-            },
-            {
-                "Name": "Process 5",
-                "Active": false
-            },
-            {
-                "Name": "Process 6",
-                "Active": false
-            },
-            {
-                "Name": "Process 7",
-                "Active": false
-            },
-            {
-                "Name": "Process 8",
-                "Active": false
-            },
-            {
-                "Name": "Process 9",
-                "Active": false
-            },
-            {
-                "Name": "Process 10",
-                "Active": false
-            },
-            {
-                "Name": "Process 11",
-                "Active": false
-            },
-            {
-                "Name": "Process 12",
-                "Active": false
-            },
-            {
-                "Name": "Process 13",
-                "Active": false
-            },
-            {
-                "Name": "Process 14",
-                "Active": false
-            },
-            {
-                "Name": "Process 15",
-                "Active": false
-            },
-            {
-                "Name": "Process 16",
-                "Active": false
-            },
-            {
-                "Name": "Process 17",
-                "Active": false
-            },
-            {
-                "Name": "Process 18",
-                "Active": false
-            },
-            {
-                "Name": "Process 19",
-                "Active": false
-            },
-            {
-                "Name": "Process 20",
-                "Active": false
-            },
-            {
-                "Name": "Process 21",
-                "Active": false
-            },
-            {
-                "Name": "Process 22",
-                "Active": false
-            },
-            {
-                "Name": "Process 0",
-                "Active": false
-            },
-            {
-                "Name": "Process 1",
-                "Active": false
-            },
-            {
-                "Name": "Process 2",
-                "Active": false
-            },
-            {
-                "Name": "Process 3",
-                "Active": false
-            },
-            {
-                "Name": "Process 4",
-                "Active": false
-            },
-            {
-                "Name": "Process 5",
-                "Active": false
-            },
-            {
-                "Name": "Process 6",
-                "Active": false
-            },
-            {
-                "Name": "Process 7",
-                "Active": false
-            },
-            {
-                "Name": "Process 8",
-                "Active": false
-            },
-            {
-                "Name": "Process 9",
-                "Active": false
-            },
-            {
-                "Name": "Process 10",
-                "Active": false
-            },
-            {
-                "Name": "Process 11",
-                "Active": false
-            },
-            {
-                "Name": "Process 12",
-                "Active": false
-            },
-            {
-                "Name": "Process 13",
-                "Active": false
-            },
-            {
-                "Name": "Process 14",
-                "Active": false
-            },
-            {
-                "Name": "Process 15",
-                "Active": false
-            },
-            {
-                "Name": "Process 16",
-                "Active": false
-            },
-            {
-                "Name": "Process 17",
-                "Active": false
-            },
-            {
-                "Name": "Process 18",
-                "Active": false
-            },
-            {
-                "Name": "Process 19",
-                "Active": false
-            },
-            {
-                "Name": "Process 20",
-                "Active": false
-            },
-            {
-                "Name": "Process 21",
-                "Active": false
-            },
-            {
-                "Name": "Process 22",
-                "Active": false
-            },
             {
             {
                 "Name": "Process 0",
                 "Name": "Process 0",
                 "Active": false
                 "Active": false

+ 3 - 3
samples/delphi/QuickConfig/ConfigToRegistry/Main.pas

@@ -64,8 +64,8 @@ type
     property SessionName : string read fSessionName write fSessionName;
     property SessionName : string read fSessionName write fSessionName;
     property WorkList : TObjectList<TWorker> read fWorkList write fWorkList;
     property WorkList : TObjectList<TWorker> read fWorkList write fWorkList;
   public
   public
-    constructor Create;
     destructor Destroy; override;
     destructor Destroy; override;
+    procedure Init; override;
     procedure DefaultValues; override;
     procedure DefaultValues; override;
   end;
   end;
 
 
@@ -187,9 +187,9 @@ end;
 
 
 { TMyConfig }
 { TMyConfig }
 
 
-constructor TMyConfig.Create;
+procedure TMyConfig.Init;
 begin
 begin
-  inherited Create;
+  inherited;
   WorkList := TObjectList<TWorker>.Create(True);
   WorkList := TObjectList<TWorker>.Create(True);
   DefaultValues;
   DefaultValues;
 end;
 end;

+ 240 - 0
samples/firemonkey/QuickConfig/ConfigToFile/Android/Debug/ConfigToFile.lnk

@@ -0,0 +1,240 @@
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\SysInit.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Types.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Base.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Dlfcn.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.StdDef.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.SysTypes.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Fcntl.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.SysStat.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Locale.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.String_.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Signal.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Time.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.SysTime.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.SysConst.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Dirent.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Errno.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Fnmatch.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Langinfo.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Sched.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Pthread.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Stdio.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Stdlib.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.SysSysctl.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Unistd.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Utime.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Wordexp.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Pwd.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Semaphore.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.Jni.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.AssetManager.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.Looper.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.KeyCodes.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.Input.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.Rect.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.NativeWindow.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.NativeActivity.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.IOUtils.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Internal.ICU.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.RTLConsts.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Wchar.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.Wctype.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Character.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Internal.ExcUtils.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.SysUtils.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.VarUtils.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Variants.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Generics.Collections.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.SysMman.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Hash.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Math.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Rtti.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.TypInfo.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Generics.Defaults.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.StrOpts.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Posix.SysSelect.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Classes.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Masks.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.StrUtils.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.TimeSpan.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.DateUtils.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.IOUtils.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.StartUpCopy.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.UITypes.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.Consts.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNIMarshal.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNIBridge.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.JavaTypes.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.Java.Security.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.Java.Net.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.Util.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.Os.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.Net.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.GraphicsContentViewText.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Messaging.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Analytics.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Math.Vectors.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Actions.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.ImageList.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Consts.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Android.Devices.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Devices.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.DialogService.Async.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Dialogs.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Surfaces.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.UIConsts.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.TextLayout.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Utils.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Graphics.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.RegularExpressionsAPI.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.RegularExpressionsConsts.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.RegularExpressionsCore.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.RegularExpressions.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Text.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.Configuration.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.Log.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.AppGlue.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.Widget.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.App.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.Location.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.AdMob.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.Hardware.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.Accounts.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.Support.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.PlayServices.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.Print.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.Webkit.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.Embarcadero.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.DialogService.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Gestures.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Gestures.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.VirtualKeyboard.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.BehaviorManager.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Styles.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Materials.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Types3D.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Filter.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Filter.Custom.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Effects.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.Diagnostics.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.SyncObjs.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.MultiResBitmap.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Ani.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.AcceleratorKey.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.Bitmap.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.Helpers.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.FontGlyphs.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.FontGlyphs.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Objects.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.ImgList.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Menus.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Controls.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Presentation.Messages.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Controls.Model.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Presentation.Factory.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Presentation.Style.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Controls.Presentation.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.KeyMapping.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Helpers.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.MultiTouch.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.MultiTouch.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.ZOrder.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.ZOrder.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Platform.Text.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Maps.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Maps.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Materials.Canvas.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Canvas.GPU.Helpers.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.TextLayout.GPU.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.StrokeBuilder.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Canvas.GPU.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Platform.Timer.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Platform.UI.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.VirtualKeyboard.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Dialogs.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.JNI.Telephony.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Platform.Device.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Platform.Logger.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Platform.SaveState.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Platform.Screen.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Pickers.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Pickers.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Platform.Metrics.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.KhrPlatform.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.EglPlatform.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.Egl.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.Gles2.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.Gles2ext.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Context.GLES.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.Eglext.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Androidapi.NativeWindowJni.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Controls3D.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.MaterialSources.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Import.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Objects3D.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Forms3D.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Presentation.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Presentation.Style.Common.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Presentation.Android.Style.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Context.GLES.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Graphics.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Controls.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Platform.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Platform.Common.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Clipboard.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Clipboard.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Platform.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.ActnList.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Types.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.StdActns.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Styles.Objects.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Styles.Switch.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Switch.Style.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Switch.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.StdCtrls.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.InertialMovement.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Layouts.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Header.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Forms.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.JSONConsts.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.JSON.o"
+D:\\Delphi\\LibsRAD10\\QuickLibs\\QuickLib\\samples\\firemonkey\\QuickConfig\\ConfigToFile\\Android\\Debug\\Quick.Commons.o
+D:\\Delphi\\LibsRAD10\\QuickLibs\\QuickLib\\samples\\firemonkey\\QuickConfig\\ConfigToFile\\Android\\Debug\\Quick.JSON.Utils.o
+D:\\Delphi\\LibsRAD10\\QuickLibs\\QuickLib\\samples\\firemonkey\\QuickConfig\\ConfigToFile\\Android\\Debug\\Quick.Json.Serializer.o
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\REST.Consts.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\REST.Json.Types.o"
+D:\\Delphi\\LibsRAD10\\QuickLibs\\QuickLib\\samples\\firemonkey\\QuickConfig\\ConfigToFile\\Android\\Debug\\Quick.FileMonitor.o
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Data.DBConsts.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Data.FmtBcd.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Data.SqlTimSt.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Data.DBXCommonResStrs.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Data.DBXPlatform.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.IniFiles.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.JSON.Types.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.NetEncoding.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.JSON.Utils.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.JSON.Readers.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\System.JSON.Writers.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Data.DBCommonTypes.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Data.DBXClassRegistry.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Data.DSUtil.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Data.DBXCommon.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\Data.DBXJSON.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\REST.Json.Interceptors.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\REST.JsonReflect.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\REST.Json.o"
+D:\\Delphi\\LibsRAD10\\QuickLibs\\QuickLib\\samples\\firemonkey\\QuickConfig\\ConfigToFile\\Android\\Debug\\Quick.Config.Base.o
+D:\\Delphi\\LibsRAD10\\QuickLibs\\QuickLib\\samples\\firemonkey\\QuickConfig\\ConfigToFile\\Android\\Debug\\Quick.Config.Json.o
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.ScrollBox.Style.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.ScrollBox.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.ScrollBox.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Memo.Types.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.MagnifierGlass.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.SpellChecker.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.SpellChecker.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Memo.Style.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Memo.Android.o"
+"c:\\program files (x86)\\embarcadero\\studio\\20.0\\lib\\Android\\debug\\FMX.Memo.o"
+D:\\Delphi\\LibsRAD10\\QuickLibs\\QuickLib\\samples\\firemonkey\\QuickConfig\\ConfigToFile\\Android\\Debug\\Main.o
+.\\Android\\Debug\\ConfigToFile.o

+ 28 - 0
samples/firemonkey/QuickConfig/ConfigToFile/Android/Debug/ConfigToFile.vsr

@@ -0,0 +1,28 @@
+EXPORTED {
+	global:
+		_NativeMain;
+		__rsrc_*;
+		__rstr_*;
+		dbkFCallWrapperAddr;
+		dbk_RTL_initialized;
+		__dbk_fcall_wrapper;
+		_DbgExcNotify;
+		_Unwind_VRS_Get;
+		_Unwind_VRS_Set;
+		_Unwind_Complete;
+		_Unwind_Resume_or_Rethrow;
+		_Unwind_GetDataRelBase;
+		_Unwind_GetTextRelBase;
+		_Unwind_GetLanguageSpecificData;
+		_Unwind_GetRegionStart;
+		_BorUnwind_RaiseException;
+		_BorUnwind_RaiseException2;
+		_BorUnwind_Resume;
+		_UnwindCppFrame;
+		UnwindCppPersonalityCommon;
+		_Unwind_DeleteException;
+		TMethodImplementationIntercept;
+		ExecJNI;
+		ANativeActivity_onCreate;
+	local: *;
+};

+ 11 - 2
samples/firemonkey/QuickConfig/ConfigToFile/ConfigToFile.deployproj

@@ -4,10 +4,10 @@
         <ProjectFileVersion>12</ProjectFileVersion>
         <ProjectFileVersion>12</ProjectFileVersion>
     </ProjectExtensions>
     </ProjectExtensions>
     <PropertyGroup>
     <PropertyGroup>
-        <DeviceId Condition="'$(Platform)'=='Android'">emulator-5554</DeviceId>
+        <DeviceId Condition="'$(Platform)'=='Android'"/>
         <DeviceId Condition="'$(Platform)'=='iOSDevice32'"/>
         <DeviceId Condition="'$(Platform)'=='iOSDevice32'"/>
         <DeviceId Condition="'$(Platform)'=='iOSDevice64'"/>
         <DeviceId Condition="'$(Platform)'=='iOSDevice64'"/>
-        <DeviceId Condition="'$(Platform)'=='iOSSimulator'">18177134-9BFD-46EA-8567-C7B81A17DACE</DeviceId>
+        <DeviceId Condition="'$(Platform)'=='iOSSimulator'">iPhone5</DeviceId>
     </PropertyGroup>
     </PropertyGroup>
     <ItemGroup Condition="'$(Platform)'=='iOSDevice64'"/>
     <ItemGroup Condition="'$(Platform)'=='iOSDevice64'"/>
     <ItemGroup Condition="'$(Platform)'=='Win64'"/>
     <ItemGroup Condition="'$(Platform)'=='Win64'"/>
@@ -80,6 +80,15 @@
             <RemoteCommand/>
             <RemoteCommand/>
             <Overwrite>True</Overwrite>
             <Overwrite>True</Overwrite>
         </DeployFile>
         </DeployFile>
+        <DeployFile Include="OSX32\Debug\ConfigToFile.rsm" Condition="'$(Config)'=='Debug'">
+            <RemoteDir>ConfigToFile.app\Contents\MacOS\</RemoteDir>
+            <RemoteName>ConfigToFile.rsm</RemoteName>
+            <DeployClass>DebugSymbols</DeployClass>
+            <Operation>1</Operation>
+            <LocalCommand/>
+            <RemoteCommand/>
+            <Overwrite>True</Overwrite>
+        </DeployFile>
     </ItemGroup>
     </ItemGroup>
     <ItemGroup Condition="'$(Platform)'=='Android'">
     <ItemGroup Condition="'$(Platform)'=='Android'">
         <DeployFile Include="$(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png" Condition="'$(Config)'=='Debug'">
         <DeployFile Include="$(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png" Condition="'$(Config)'=='Debug'">

+ 8 - 1
samples/firemonkey/QuickConfig/ConfigToFile/ConfigToFile.dproj

@@ -6,7 +6,7 @@
         <MainSource>ConfigToFile.dpr</MainSource>
         <MainSource>ConfigToFile.dpr</MainSource>
         <Base>True</Base>
         <Base>True</Base>
         <Config Condition="'$(Config)'==''">Debug</Config>
         <Config Condition="'$(Config)'==''">Debug</Config>
-        <Platform Condition="'$(Platform)'==''">Android</Platform>
+        <Platform Condition="'$(Platform)'==''">Win64</Platform>
         <TargetedPlatforms>1119</TargetedPlatforms>
         <TargetedPlatforms>1119</TargetedPlatforms>
         <AppType>Application</AppType>
         <AppType>Application</AppType>
     </PropertyGroup>
     </PropertyGroup>
@@ -703,6 +703,13 @@
                         <Overwrite>true</Overwrite>
                         <Overwrite>true</Overwrite>
                     </Platform>
                     </Platform>
                 </DeployFile>
                 </DeployFile>
+                <DeployFile LocalName="OSX32\Debug\ConfigToFile.rsm" Configuration="Debug" Class="DebugSymbols">
+                    <Platform Name="OSX32">
+                        <RemoteDir>Contents\MacOS\</RemoteDir>
+                        <RemoteName>ConfigToFile.rsm</RemoteName>
+                        <Overwrite>true</Overwrite>
+                    </Platform>
+                </DeployFile>
                 <DeployFile LocalName="$(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x748.png" Configuration="Debug" Class="iPad_Launch1024">
                 <DeployFile LocalName="$(BDS)\bin\Artwork\iOS\iPad\FM_LaunchImageLandscape_1024x748.png" Configuration="Debug" Class="iPad_Launch1024">
                     <Platform Name="iOSSimulator">
                     <Platform Name="iOSSimulator">
                         <RemoteName>Default-Landscape.png</RemoteName>
                         <RemoteName>Default-Landscape.png</RemoteName>

+ 22 - 9
samples/firemonkey/QuickConfig/ConfigToFile/Main.pas

@@ -57,8 +57,8 @@ type
     property SessionName : string read fSessionName write fSessionName;
     property SessionName : string read fSessionName write fSessionName;
     property WorkList : TObjectList<TWorker> read fWorkList write fWorkList;
     property WorkList : TObjectList<TWorker> read fWorkList write fWorkList;
   public
   public
-    constructor Create;
     destructor Destroy; override;
     destructor Destroy; override;
+    procedure Init; override;
     procedure DefaultValues; override;
     procedure DefaultValues; override;
   end;
   end;
 
 
@@ -73,6 +73,8 @@ type
     procedure FormClose(Sender: TObject; var Action: TCloseAction);
     procedure FormClose(Sender: TObject; var Action: TCloseAction);
     procedure btnLoadJsonClick(Sender: TObject);
     procedure btnLoadJsonClick(Sender: TObject);
     procedure btnSaveJsonClick(Sender: TObject);
     procedure btnSaveJsonClick(Sender: TObject);
+    procedure OnConfigFileModified;
+    procedure OnConfigReloaded;
   end;
   end;
 
 
 var
 var
@@ -172,24 +174,35 @@ end;
 
 
 procedure TMainForm.FormCreate(Sender: TObject);
 procedure TMainForm.FormCreate(Sender: TObject);
 begin
 begin
-  ConfigJson := TMyConfig.Create;
-  {$IFDEF NEXTGEN}
-  ConfigJson.Provider.Filename := TPath.GetDocumentsPath + '/config.json';
+  {$IF Defined(NEXTGEN) OR Defined(OSX)}
+  ConfigJson := TMyConfig.Create(TPath.GetDocumentsPath + '/config.json');
   {$ELSE}
   {$ELSE}
-  ConfigJson.Provider.Filename := '.\config.json';
+  ConfigJson := TMyConfig.Create('.\config.json');
   {$ENDIF}
   {$ENDIF}
+  ConfigJson.Provider.OnFileModified := OnConfigFileModified;
+  ConfigJson.Provider.OnConfigReloaded := OnConfigReloaded;
+  ConfigJson.Provider.ReloadIfFileChanged := True;
   //create config test to compare later
   //create config test to compare later
-  ConfigTest := TMyConfig.Create;
+  ConfigTest := TMyConfig.Create('');
   SetConfig(ConfigTest);
   SetConfig(ConfigTest);
 end;
 end;
 
 
+procedure TMainForm.OnConfigFileModified;
+begin
+  meInfo.Lines.Add('Config modified');
+end;
+
+procedure TMainForm.OnConfigReloaded;
+begin
+  meInfo.Lines.Add('Config reloaded');
+end;
+
 { TMyConfig }
 { TMyConfig }
 
 
-constructor TMyConfig.Create;
+procedure TMyConfig.Init;
 begin
 begin
-  inherited Create;
+  inherited;
   WorkList := TObjectList<TWorker>.Create(True);
   WorkList := TObjectList<TWorker>.Create(True);
-  DefaultValues;
 end;
 end;
 
 
 procedure TMyConfig.DefaultValues;
 procedure TMyConfig.DefaultValues;

BIN
samples/firemonkey/QuickConfig/ConfigToFile/OSX32/Debug/ConfigToFile


+ 7 - 0
samples/firemonkey/QuickConfig/ConfigToFile/OSX32/Debug/ConfigToFile.entitlements

@@ -1,7 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
+
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+
 <plist version="1.0">
 <plist version="1.0">
+
 <dict>
 <dict>
+
 	
 	
+
 </dict>
 </dict>
+
 </plist>
 </plist>
+

+ 8 - 0
samples/firemonkey/QuickConfig/ConfigToFile/OSX32/Debug/ConfigToFile.info.plist

@@ -1,7 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
+
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+
 <plist version="1.0">
 <plist version="1.0">
+
 <dict>
 <dict>
+
 	<key>CFBundleName</key>
 	<key>CFBundleName</key>
 	<string>ConfigToFile</string>
 	<string>ConfigToFile</string>
 	<key>CFBundleDisplayName</key>
 	<key>CFBundleDisplayName</key>
@@ -33,6 +37,7 @@
 	<key>NSContactsUsageDescription</key>
 	<key>NSContactsUsageDescription</key>
 	<string>The reason for accessing the contacts</string>
 	<string>The reason for accessing the contacts</string>
 
 
+
 	<key>CFBundleIconFile</key>
 	<key>CFBundleIconFile</key>
 	<string>ConfigToFile.icns</string>
 	<string>ConfigToFile.icns</string>
 	<key>CFBundleSupportedPlatforms</key>
 	<key>CFBundleSupportedPlatforms</key>
@@ -40,5 +45,8 @@
 		<string>MacOSX</string>
 		<string>MacOSX</string>
 	</array>
 	</array>
 
 
+
 </dict>
 </dict>
+
 </plist>
 </plist>
+

+ 358 - 2
samples/firemonkey/QuickConfig/ConfigToFile/Win64/Debug/config.json

@@ -29,6 +29,86 @@
         "PosY": 0
         "PosY": 0
     },
     },
     "History": [
     "History": [
+        {
+            "Id": 0,
+            "Priority": "msLow",
+            "Redundant": true
+        },
+        {
+            "Id": 1,
+            "Priority": "msLow",
+            "Redundant": true
+        },
+        {
+            "Id": 2,
+            "Priority": "msLow",
+            "Redundant": true
+        },
+        {
+            "Id": 3,
+            "Priority": "msLow",
+            "Redundant": true
+        },
+        {
+            "Id": 4,
+            "Priority": "msLow",
+            "Redundant": true
+        },
+        {
+            "Id": 5,
+            "Priority": "msLow",
+            "Redundant": true
+        },
+        {
+            "Id": 6,
+            "Priority": "msLow",
+            "Redundant": true
+        },
+        {
+            "Id": 7,
+            "Priority": "msLow",
+            "Redundant": true
+        },
+        {
+            "Id": 8,
+            "Priority": "msLow",
+            "Redundant": true
+        },
+        {
+            "Id": 9,
+            "Priority": "msLow",
+            "Redundant": true
+        },
+        {
+            "Id": 10,
+            "Priority": "msLow",
+            "Redundant": true
+        },
+        {
+            "Id": 11,
+            "Priority": "msLow",
+            "Redundant": true
+        },
+        {
+            "Id": 12,
+            "Priority": "msLow",
+            "Redundant": true
+        },
+        {
+            "Id": 13,
+            "Priority": "msLow",
+            "Redundant": true
+        },
+        {
+            "Id": 14,
+            "Priority": "msLow",
+            "Redundant": true
+        },
+        {
+            "Id": 15,
+            "Priority": "msLow",
+            "Redundant": true
+        },
         {
         {
             "Id": 0,
             "Id": 0,
             "Priority": "msLow",
             "Priority": "msLow",
@@ -111,15 +191,291 @@
         }
         }
     ],
     ],
     "Complex": {
     "Complex": {
-        "Id": 269729584,
+        "Id": 269991728,
         "Priority": "msHigh",
         "Priority": "msHigh",
         "Redundant": false
         "Redundant": false
     },
     },
-    "ModifyDate": "2019-01-17T23:08:53.216Z",
+    "ModifyDate": "2019-01-25T23:28:02.895Z",
     "Title": "a fresh title",
     "Title": "a fresh title",
     "SessionName": "First Session",
     "SessionName": "First Session",
     "WorkList": {
     "WorkList": {
         "List": [
         "List": [
+            {
+                "Name": "Process 0",
+                "Active": false
+            },
+            {
+                "Name": "Process 1",
+                "Active": false
+            },
+            {
+                "Name": "Process 2",
+                "Active": false
+            },
+            {
+                "Name": "Process 3",
+                "Active": false
+            },
+            {
+                "Name": "Process 4",
+                "Active": false
+            },
+            {
+                "Name": "Process 5",
+                "Active": false
+            },
+            {
+                "Name": "Process 6",
+                "Active": false
+            },
+            {
+                "Name": "Process 7",
+                "Active": false
+            },
+            {
+                "Name": "Process 8",
+                "Active": false
+            },
+            {
+                "Name": "Process 9",
+                "Active": false
+            },
+            {
+                "Name": "Process 10",
+                "Active": false
+            },
+            {
+                "Name": "Process 11",
+                "Active": false
+            },
+            {
+                "Name": "Process 12",
+                "Active": false
+            },
+            {
+                "Name": "Process 13",
+                "Active": false
+            },
+            {
+                "Name": "Process 14",
+                "Active": false
+            },
+            {
+                "Name": "Process 15",
+                "Active": false
+            },
+            {
+                "Name": "Process 16",
+                "Active": false
+            },
+            {
+                "Name": "Process 17",
+                "Active": false
+            },
+            {
+                "Name": "Process 18",
+                "Active": false
+            },
+            {
+                "Name": "Process 19",
+                "Active": false
+            },
+            {
+                "Name": "Process 20",
+                "Active": false
+            },
+            {
+                "Name": "Process 21",
+                "Active": false
+            },
+            {
+                "Name": "Process 22",
+                "Active": false
+            },
+            {
+                "Name": "Process 0",
+                "Active": false
+            },
+            {
+                "Name": "Process 1",
+                "Active": false
+            },
+            {
+                "Name": "Process 2",
+                "Active": false
+            },
+            {
+                "Name": "Process 3",
+                "Active": false
+            },
+            {
+                "Name": "Process 4",
+                "Active": false
+            },
+            {
+                "Name": "Process 5",
+                "Active": false
+            },
+            {
+                "Name": "Process 6",
+                "Active": false
+            },
+            {
+                "Name": "Process 7",
+                "Active": false
+            },
+            {
+                "Name": "Process 8",
+                "Active": false
+            },
+            {
+                "Name": "Process 9",
+                "Active": false
+            },
+            {
+                "Name": "Process 10",
+                "Active": false
+            },
+            {
+                "Name": "Process 11",
+                "Active": false
+            },
+            {
+                "Name": "Process 12",
+                "Active": false
+            },
+            {
+                "Name": "Process 13",
+                "Active": false
+            },
+            {
+                "Name": "Process 14",
+                "Active": false
+            },
+            {
+                "Name": "Process 15",
+                "Active": false
+            },
+            {
+                "Name": "Process 16",
+                "Active": false
+            },
+            {
+                "Name": "Process 17",
+                "Active": false
+            },
+            {
+                "Name": "Process 18",
+                "Active": false
+            },
+            {
+                "Name": "Process 19",
+                "Active": false
+            },
+            {
+                "Name": "Process 20",
+                "Active": false
+            },
+            {
+                "Name": "Process 21",
+                "Active": false
+            },
+            {
+                "Name": "Process 22",
+                "Active": false
+            },
+            {
+                "Name": "Process 0",
+                "Active": false
+            },
+            {
+                "Name": "Process 1",
+                "Active": false
+            },
+            {
+                "Name": "Process 2",
+                "Active": false
+            },
+            {
+                "Name": "Process 3",
+                "Active": false
+            },
+            {
+                "Name": "Process 4",
+                "Active": false
+            },
+            {
+                "Name": "Process 5",
+                "Active": false
+            },
+            {
+                "Name": "Process 6",
+                "Active": false
+            },
+            {
+                "Name": "Process 7",
+                "Active": false
+            },
+            {
+                "Name": "Process 8",
+                "Active": false
+            },
+            {
+                "Name": "Process 9",
+                "Active": false
+            },
+            {
+                "Name": "Process 10",
+                "Active": false
+            },
+            {
+                "Name": "Process 11",
+                "Active": false
+            },
+            {
+                "Name": "Process 12",
+                "Active": false
+            },
+            {
+                "Name": "Process 13",
+                "Active": false
+            },
+            {
+                "Name": "Process 14",
+                "Active": false
+            },
+            {
+                "Name": "Process 15",
+                "Active": false
+            },
+            {
+                "Name": "Process 16",
+                "Active": false
+            },
+            {
+                "Name": "Process 17",
+                "Active": false
+            },
+            {
+                "Name": "Process 18",
+                "Active": false
+            },
+            {
+                "Name": "Process 19",
+                "Active": false
+            },
+            {
+                "Name": "Process 20",
+                "Active": false
+            },
+            {
+                "Name": "Process 21",
+                "Active": false
+            },
+            {
+                "Name": "Process 22",
+                "Active": false
+            },
             {
             {
                 "Name": "Process 0",
                 "Name": "Process 0",
                 "Active": false
                 "Active": false

BIN
samples/firemonkey/QuickConfig/ConfigToFile/iOSSimulator/Debug/ConfigToFile


BIN
samples/firemonkey/QuickThreads/ScheduledTasks/OSX32/Debug/RunScheduledTasks


BIN
samples/firemonkey/QuickThreads/ScheduledTasks/iOSSimulator/Debug/RunScheduledTasks


+ 2 - 2
samples/fpc/QuickConfig/ConfigToFile/Config.json

@@ -10,7 +10,7 @@
          6,
          6,
          7
          7
     ],
     ],
-     "LastFilename" :  "C:\\library.txt",
+     "LastFilename" :  "C:\\library2.txt",
      "WindowPos" :  {
      "WindowPos" :  {
          "PosX" :  100,
          "PosX" :  100,
          "PosY" :  200 
          "PosY" :  200 
@@ -27,5 +27,5 @@
          "Priority" :  "msMed",
          "Priority" :  "msMed",
          "Redundant" :  true 
          "Redundant" :  true 
     },
     },
-     "ModifyDate" :  "2019-01-24T23:59:38.138Z" 
+     "ModifyDate" :  "2019-01-25T23:52:30.424Z" 
 }
 }

+ 12 - 4
samples/fpc/QuickConfig/ConfigToFile/umain.pas

@@ -68,7 +68,7 @@ type
     fModifyDate : TDateTime;
     fModifyDate : TDateTime;
     //fWorkList : TObjectList<TWorker>;
     //fWorkList : TObjectList<TWorker>;
   public
   public
-    constructor Create;
+    procedure Init;
     destructor Destroy; override;
     destructor Destroy; override;
     procedure DefaultValues; override;
     procedure DefaultValues; override;
     property Hidden : Boolean read fHidden write fHidden;
     property Hidden : Boolean read fHidden write fHidden;
@@ -94,6 +94,7 @@ type
     procedure btnSaveJsonClick(Sender: TObject);
     procedure btnSaveJsonClick(Sender: TObject);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
     procedure FormCreate(Sender: TObject);
     procedure FormCreate(Sender: TObject);
+    procedure OnConfigFileModified;
   private
   private
 
 
   public
   public
@@ -171,10 +172,17 @@ end;
 
 
 procedure TForm1.FormCreate(Sender: TObject);
 procedure TForm1.FormCreate(Sender: TObject);
 begin
 begin
-  ConfigTest := TMyConfig.Create;
+  ConfigTest := TMyConfig.Create('');
   SetConfig(ConfigTest);
   SetConfig(ConfigTest);
   ConfigJson := TMyConfig.Create('.\Config.json');
   ConfigJson := TMyConfig.Create('.\Config.json');
-  //ConfigJson.Provider.CreateIfNotExists := True;
+  ConfigJson.Provider.CreateIfNotExists := True;
+  ConfigJson.Provider.ReloadIfFileChanged := True;
+  ConfigJson.Provider.OnFileModified := OnConfigFileModified;
+end;
+
+procedure TForm1.OnConfigFileModified;
+begin
+  meInfo.Lines.Add('Config file modified');
 end;
 end;
 
 
 procedure TForm1.SetConfig(cConfig: TMyConfig);
 procedure TForm1.SetConfig(cConfig: TMyConfig);
@@ -202,7 +210,7 @@ end;
 
 
 { TMyConfig }
 { TMyConfig }
 
 
-constructor TMyConfig.Create;
+procedure TMyConfig.Init;
 begin
 begin
   inherited;
   inherited;
   //WorkList := TObjectList<TWorker>.Create(True);
   //WorkList := TObjectList<TWorker>.Create(True);

+ 1 - 1
samples/fpc/QuickConfig/ConfigToRegistry/umain.pas

@@ -173,7 +173,7 @@ begin
   ConfigTest := TMyConfig.Create;
   ConfigTest := TMyConfig.Create;
   SetConfig(ConfigTest);
   SetConfig(ConfigTest);
   ConfigReg := TMyConfig.Create(HKEY_CURRENT_USER,'_AppConfig2');
   ConfigReg := TMyConfig.Create(HKEY_CURRENT_USER,'_AppConfig2');
-  //ConfigReg.Provider.CreateIfNotExists := True;
+  ConfigReg.Provider.CreateIfNotExists := True;
 end;
 end;
 
 
 procedure TForm1.SetConfig(cConfig: TMyConfig);
 procedure TForm1.SetConfig(cConfig: TMyConfig);