mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 06:49:16 +02:00
* Smarter handling of DispatchOptions options
git-svn-id: trunk@42278 -
This commit is contained in:
parent
abf6c99304
commit
73b365cd30
@ -493,9 +493,16 @@ end;
|
|||||||
|
|
||||||
procedure TSQLDBRestDispatcher.SetDispatchOptions(AValue: TRestDispatcherOptions);
|
procedure TSQLDBRestDispatcher.SetDispatchOptions(AValue: TRestDispatcherOptions);
|
||||||
|
|
||||||
|
Var
|
||||||
|
DeleteConnection : Boolean;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
DeleteConnection:=(rdoConnectionInURL in FDispatchOptions) and Not (rdoConnectionInURL in aValue);
|
||||||
if (rdoConnectionResource in aValue) then
|
if (rdoConnectionResource in aValue) then
|
||||||
Include(aValue,rdoConnectionInURL);
|
if DeleteConnection then // if user disables rdoConnectionInURL, we disable rdoConnectionResource.
|
||||||
|
exclude(aValue,rdoConnectionResource)
|
||||||
|
else // else we include rdoConnectionInURL...
|
||||||
|
Include(aValue,rdoConnectionInURL);
|
||||||
if FDispatchOptions=AValue then Exit;
|
if FDispatchOptions=AValue then Exit;
|
||||||
FDispatchOptions:=AValue;
|
FDispatchOptions:=AValue;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user