mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Cosmetic in project files:
* Move const.inc and compilers.inc back to main source directory * Move remaining few lines of code from heidicomp.pas to helpers.pas * Remove components/compilerdetection and components/heidisql * Remove remainders of EDBImage component, unused since Aug 08.
This commit is contained in:
@ -103,6 +103,23 @@ type
|
||||
// General purpose editing status flag
|
||||
TEditingStatus = (esUntouched, esModified, esDeleted, esAddedUntouched, esAddedModified, esAddedDeleted);
|
||||
|
||||
TDeferDataSet = class;
|
||||
TAsyncPostRunner = procedure(ds: TDeferDataSet) of object;
|
||||
|
||||
TDeferDataSet = class(TZQuery)
|
||||
private
|
||||
callback: TAsyncPostRunner;
|
||||
kind: Integer;
|
||||
protected
|
||||
procedure InternalPost; override;
|
||||
procedure InternalRefresh; override;
|
||||
public
|
||||
constructor Create(AOwner: TComponent; PostCallback: TAsyncPostRunner); reintroduce;
|
||||
procedure ExecSQL; override;
|
||||
procedure DoAsync;
|
||||
procedure DoAsyncExecSql;
|
||||
end;
|
||||
|
||||
{$I const.inc}
|
||||
|
||||
function implodestr(seperator: WideString; a: TWideStringList) :WideString;
|
||||
@ -3083,6 +3100,48 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TDeferDataSet.InternalPost;
|
||||
begin
|
||||
kind := 1;
|
||||
if @callback = nil then DoAsync
|
||||
else callback(self);
|
||||
end;
|
||||
|
||||
procedure TDeferDataSet.InternalRefresh;
|
||||
begin
|
||||
kind := 3;
|
||||
if @callback = nil then DoAsync
|
||||
else callback(self);
|
||||
end;
|
||||
|
||||
procedure TDeferDataSet.ExecSql;
|
||||
begin
|
||||
kind := 2;
|
||||
if @callback = nil then DoAsync
|
||||
else callback(self);
|
||||
end;
|
||||
|
||||
constructor TDeferDataSet.Create(AOwner: TComponent; PostCallback: TAsyncPostRunner);
|
||||
begin
|
||||
callback := PostCallback;
|
||||
inherited Create(AOwner);
|
||||
end;
|
||||
|
||||
procedure TDeferDataSet.DoAsync;
|
||||
begin
|
||||
case kind of
|
||||
1: inherited InternalPost;
|
||||
2: inherited ExecSQL;
|
||||
3: inherited InternalRefresh;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDeferDataSet.DoAsyncExecSql;
|
||||
begin
|
||||
inherited ExecSql;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user