Browse Source

Patch from Luiz Americo, mantis 12698
- Add OnGetHandle event

git-svn-id: trunk@12222 -

joost 16 years ago
parent
commit
0684eda0d8
1 changed files with 4 additions and 0 deletions
  1. 4 0
      packages/fcl-db/src/sqlite/customsqliteds.pas

+ 4 - 0
packages/fcl-db/src/sqlite/customsqliteds.pas

@@ -98,6 +98,7 @@ type
     FMasterLink: TMasterDataLink;
     FMasterLink: TMasterDataLink;
     FIndexFieldNames: String;
     FIndexFieldNames: String;
     FIndexFieldList: TList;
     FIndexFieldList: TList;
+    FOnGetHandle: TDataSetNotifyEvent;
     FOptions: TSqliteOptions;
     FOptions: TSqliteOptions;
     FSqlList:TStrings;
     FSqlList:TStrings;
     procedure CopyCacheToItem(AItem: PDataRecord);
     procedure CopyCacheToItem(AItem: PDataRecord);
@@ -228,6 +229,7 @@ type
     property IndexFieldNames: string read FIndexFieldNames write FIndexFieldNames;
     property IndexFieldNames: string read FIndexFieldNames write FIndexFieldNames;
     property FileName: String read FFileName write SetFileName;
     property FileName: String read FFileName write SetFileName;
     property OnCallback: TSqliteCallback read FOnCallback write FOnCallback;
     property OnCallback: TSqliteCallback read FOnCallback write FOnCallback;
+    property OnGetHandle: TDataSetNotifyEvent read FOnGetHandle write FOnGetHandle;
     property Options: TSqliteOptions read FOptions write SetOptions;
     property Options: TSqliteOptions read FOptions write SetOptions;
     property PrimaryKey: String read FPrimaryKey write FPrimaryKey;
     property PrimaryKey: String read FPrimaryKey write FPrimaryKey;
     property SaveOnClose: Boolean read FSaveOnClose write FSaveOnClose; 
     property SaveOnClose: Boolean read FSaveOnClose write FSaveOnClose; 
@@ -1097,6 +1099,8 @@ begin
   if FFileName = '' then
   if FFileName = '' then
     DatabaseError('Filename not set',Self);
     DatabaseError('Filename not set',Self);
   FSqliteHandle := InternalGetHandle;
   FSqliteHandle := InternalGetHandle;
+  if Assigned(FOnGetHandle) then
+    FOnGetHandle(Self);
 end;
 end;
 
 
 procedure TCustomSqliteDataset.FreeItem(AItem: PDataRecord);
 procedure TCustomSqliteDataset.FreeItem(AItem: PDataRecord);