Hey Zhimin,

2009/4/20 zhimin song <[email protected]>:
> hi, all
> the definition of WFileUpload::isUploaded() is:
>
>               bool isUploaded() const { return fileUploadTarget_ != 0; }
>
> but the comments of it are:
>
>                      Check with isUploaded() if upload() will schedule a new
> upload. if (isUploaded()) then upload() will no have any effect.
>                      if (!isUploaded()), upload() will start and end when
> either of the two uploaded() or fileTooLarge() signals gets emitted.
>
> It seems does not work right.
>
> I think the right is:
>
>               bool isUploaded() const { return fileUploadTarget_ == 0; }

You are totally right that the method name isUploaded() is entirely
confusing. I have deprecated the method in favor of a new one,
canUpload() which is defined (in terms of the deprecated method,
isUploaded()) as canUpload() == !isUploaded(), and which indicates
better its behavior.

The meaning of canUpload() is to indicate whether upload() will start
a new file upload. This will always be the case when JavaScript is
enabled and never when JavaScript is disabled. Note that you can
upload() the same file upload multiple times consecutively -- and this
is where isUploaded() failed to convey the right message.

Regards,
koen

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to