mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 16:49:00 +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);
|
||||
|
||||
Var
|
||||
DeleteConnection : Boolean;
|
||||
|
||||
begin
|
||||
DeleteConnection:=(rdoConnectionInURL in FDispatchOptions) and Not (rdoConnectionInURL in aValue);
|
||||
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;
|
||||
FDispatchOptions:=AValue;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user