Return value of KHTMLPart::execute(...)
David Faure
faure at kde.org
Mon Aug 18 12:11:59 BST 2003
On Monday 18 August 2003 11:38, Grimm, Cornelius wrote:
> Hi,
>
> when I execute an JavaScript with KHTMLPart::execute(...), the return value
> is a QVariant of type 0 (QVariant::Invalid) if the script fails for any
> reason, and it's also of type 0 if the javascript simply returns nothing
> (void functions).
>
> Is it possible to distinguish between these two cases?
Looking at the QVariant definition, I don't see how we could do that.
Either it holds a value, or it doesn't.
(BTW the code for this is khtml/ecma/kjs_proxy.cpp:162)
The only solution would be to change the API... (to add a new method
with an output bool or KJS::Completion object)
--
David FAURE, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the kfm-devel
mailing list