[fpc-devel] db patch

2005-05-08 Thread Jesus Reyes
hi here is a patch for two bugs:
*TFloatField.SetAsString doesn't look at DecimalSeparator for converting a 
string into a Float (this fixes lazarus issue 893: 
http://www.lazarus.freepascal.org/mantis/view.php?id=893 )

*TBooleanField.SetAsString won't accept an empty string as a valid value, also 
the patch allows strings as T, F or any starting substring of DisplayValues to 
be accepted.

Regards.

Jesus Reyes A.


fields.diff
Description: Binary data
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Duplicate code inTDatasource.DistributeEvent implementation

2005-05-08 Thread Jesus Reyes

- Original Message - 
From: "Luiz AmÃrico" <[EMAIL PROTECTED]>
To: "FPC developers' list" 
Sent: Sunday, May 08, 2005 6:45 PM
Subject: Re: [fpc-devel] Duplicate code inTDatasource.DistributeEvent 
implementation


> Michael Van Canneyt wrote:
> > 
> > On Sat, 7 May 2005, Luiz AmÃrico wrote:
> > 
> > 
> > No. First non visual components (such as detail datasets, lookup datasets) 
> > must get their event, and only then visual controls get an event. 
> > 
> > The double loop is intentional.
> > 
> 
> Thank you.
> Now I can see the intention.
> 
> It seens that this procedure is called quite often.
> One approach to optimize could be inserting the items in FDataLinks in 
> the appropriate order (Non visual first, visual in the end) and doing a 
> simple loop without checks in DistributeEvent.
> This would be done inside RegisterDataLink with a simple and safe alghoritm.
> 
> If you agree with the cited approach i can send the patch.
> 
> Luiz
> 

I doubt that you will get any improvement. Probably what target components do 
inside the event handling is potentially more slower (if speed is in this case 
the concern) than iterating through the list of datalinks.

Jesus Reyes A.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Duplicate code in TDatasource.DistributeEvent implementation

2005-05-08 Thread Luiz Américo
Michael Van Canneyt wrote:
On Sat, 7 May 2005, Luiz AmÃrico wrote:
No. First non visual components (such as detail datasets, lookup datasets) 
must get their event, and only then visual controls get an event. 

The double loop is intentional.
Thank you.
Now I can see the intention.
It seens that this procedure is called quite often.
One approach to optimize could be inserting the items in FDataLinks in 
the appropriate order (Non visual first, visual in the end) and doing a 
simple loop without checks in DistributeEvent.
This would be done inside RegisterDataLink with a simple and safe alghoritm.

If you agree with the cited approach i can send the patch.
Luiz
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] TCustomConnection - why?

2005-05-08 Thread Uberto Barbini
> yes. In that case we should make TCustomConnection an alias for
> TDBDatabase.

If the interfaces are identical I see no problems.
Anyway could you rename TDBDatabase? It's orrible and I overlooked it when I 
searched for a TConnection replacement... ;)

Bye Uberto

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Duplicate code in TDatasource.DistributeEvent implementation

2005-05-08 Thread Michael Van Canneyt


On Sat, 7 May 2005, Luiz AmÃrico wrote:

> take a look at TDatasource.DistributeEvent implementation (datasource.inc):
> 
> With FDatalinks do
> begin
> For I:=0 to Count-1 do
> With TDatalink(Items[i]) do
> If Not VisualControl Then
>  DataEvent(Event,Info);
> For I:=0 to Count-1 do
> With TDatalink(Items[i]) do
> If VisualControl Then
>  DataEvent(Event,Info);
> end;
> 
> Am I missimg something or the check to VisualControl doesnt make sense?
> As far as i can see the code below has the same effect
> 
> With FDatalinks do
> begin
> For I:=0 to Count-1 do
> With TDatalink(Items[i]) do
>DataEvent(Event,Info);
> end;

No. First non visual components (such as detail datasets, lookup datasets) 
must get their event, and only then visual controls get an event. 

The double loop is intentional.

Michael.___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel