You've already forked lazarus-ccr
tvplanit: modified flexdatastore so that it should correctly check if any dataset is linked.
(patch from forum user "magu", http://forum.lazarus.freepascal.org/index.php/topic,32871.msg212397.html#msg212397, most of the other commits of today are based on magu's work). git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4685 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -287,6 +287,8 @@ end;
|
|||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
procedure TVpFlexDataStore.SetConnected(const Value: boolean);
|
procedure TVpFlexDataStore.SetConnected(const Value: boolean);
|
||||||
|
var
|
||||||
|
rststrikes: Integer;
|
||||||
begin
|
begin
|
||||||
{ disconnect if destroying }
|
{ disconnect if destroying }
|
||||||
if csDestroying in ComponentState then Exit;
|
if csDestroying in ComponentState then Exit;
|
||||||
@ -302,11 +304,44 @@ begin
|
|||||||
and (FTasksDataSrc = nil)
|
and (FTasksDataSrc = nil)
|
||||||
then Exit;
|
then Exit;
|
||||||
|
|
||||||
if (FResourceDataSrc.Dataset = nil)
|
rststrikes := 0;
|
||||||
|
// basically a Src can fail either if (a) it is completely nil, or (b) only the dataset is nil
|
||||||
|
if (FResourceDataSrc <> nil) then begin
|
||||||
|
if (FResourceDataSrc.Dataset = nil) then begin
|
||||||
|
inc(rststrikes)
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
inc(rststrikes);
|
||||||
|
|
||||||
|
if (FEventsDataSrc <> nil) then begin
|
||||||
|
if (FEventsDataSrc.Dataset = nil) then begin
|
||||||
|
inc(rststrikes)
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
inc(rststrikes);
|
||||||
|
|
||||||
|
if (FContactsDataSrc <> nil) then begin
|
||||||
|
if (FContactsDataSrc.Dataset = nil) then begin
|
||||||
|
inc(rststrikes)
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
inc(rststrikes);
|
||||||
|
|
||||||
|
if (FTasksDataSrc <> nil) then begin
|
||||||
|
if (FTasksDataSrc.Dataset = nil) then begin
|
||||||
|
inc(rststrikes)
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
inc(rststrikes);
|
||||||
|
|
||||||
|
//if no datasrc is set then exit
|
||||||
|
if rststrikes >= 4 then Exit;
|
||||||
|
|
||||||
|
{if (FResourceDataSrc.Dataset = nil)
|
||||||
and (FEventsDataSrc.Dataset = nil)
|
and (FEventsDataSrc.Dataset = nil)
|
||||||
and (FContactsDataSrc.Dataset = nil)
|
and (FContactsDataSrc.Dataset = nil)
|
||||||
and (FTasksDataSrc.Dataset = nil)
|
and (FTasksDataSrc.Dataset = nil)
|
||||||
then Exit;
|
then Exit; }
|
||||||
|
|
||||||
if Value then begin
|
if Value then begin
|
||||||
{ try to open the tables one at a time. If they fail, and AutoCreate is }
|
{ try to open the tables one at a time. If they fail, and AutoCreate is }
|
||||||
|
Reference in New Issue
Block a user