From: Olivier S. <ob...@us...> - 2005-08-31 07:49:22
|
Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26438/dev/JVCL3/run Modified Files: JvAppStorage.pas Log Message: Mantis 3168: Added FlushOnDestroy property Index: JvAppStorage.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvAppStorage.pas,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** JvAppStorage.pas 14 Aug 2005 05:58:12 -0000 1.90 --- JvAppStorage.pas 31 Aug 2005 07:49:15 -0000 1.91 *************** *** 178,183 **** --- 178,189 ---- function GetUpdating: Boolean; protected + FFlushOnDestroy: Boolean; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; + { Sets the value of FFlushOnDestroy. Derived classes may override this + method to prevent it from changing or add extra behaviour to it. } + procedure SetFlushOnDestroy(Value: Boolean); virtual; + //Returns the property count of an instance function GetPropCount(Instance: TPersistent): Integer; *************** *** 598,601 **** --- 604,611 ---- property ReadOnly and Result of the function GetPhysicalReadOnly } property ReadOnly: Boolean read GetReadOnly write SetReadOnly default False; + { If True, the destructor will call Flush as its first instruction. + This property was added following Mantis 3168 and is True by default + to keep backward compatibility } + property FlushOnDestroy: Boolean read FFlushOnDestroy write SetFlushOnDestroy default True; published property StorageOptions: TJvCustomAppStorageOptions read FStorageOptions write SetStorageOptions; *************** *** 1135,1138 **** --- 1145,1149 ---- begin inherited Create(AOwner); + FFlushOnDestroy := True; FAutoFlush := False; FAutoReload := False; *************** *** 1145,1149 **** destructor TJvCustomAppStorage.Destroy; begin ! Flush; FreeAndNil(FSubStorages); FreeAndNil(FStorageOptions); --- 1156,1161 ---- destructor TJvCustomAppStorage.Destroy; begin ! if FlushOnDestroy then ! Flush; FreeAndNil(FSubStorages); FreeAndNil(FStorageOptions); *************** *** 1191,1194 **** --- 1203,1211 ---- end; + procedure TJvCustomAppStorage.SetFlushOnDestroy(Value: Boolean); + begin + FFlushOnDestroy := Value; + end; + function TJvCustomAppStorage.GetPropCount(Instance: TPersistent): Integer; var |