Summary: | Executing a KstScript file does not return the expected result | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | Yiwen Mao <yiwenv> |
Component: | general | Assignee: | kst |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: |
the source file to create the data vector
the js file used to excute the kstscript in the problem description |
Description
Yiwen Mao
2008-04-29 02:43:06 UTC
Created attachment 24548 [details]
the source file to create the data vector
Created attachment 24549 [details]
the js file used to excute the kstscript in the problem description
This is a "feature" Because updates on most objects in Kst occur asynchronously you can never be sure when an object has actually been updated. The code "works" when entered by hand as there is a sufficiently long gap between creation of the Data Vector and querying for its values, that the necessary updates have been completed. The code "fails" when run via the script as sufficient time is not available. This can be seen by putting in an alert() statement immediately after creating the Data Vector and before querying for vector values. The expected values will now be returned. This is actually a problem as it places a severe onus on a client of the javaScript extension of Kst to ensure that an update has occured before querying for the results. SVN commit 806977 by arwalker: CCBUG:161397 first draft of allowing the client to make 'synchronous' calls to the Kst javaScript extension. M +5 -0 kst.cpp M +1 -0 kst.h M +70 -7 updatethread.cpp M +6 -2 updatethread.h WebSVN link: http://websvn.kde.org/?view=rev&revision=806977 SVN commit 806978 by arwalker: CCBUG:161397 first draft of allowing the client to make 'synchronous' calls to the Kst javaScript extension. M +17 -3 bind_kst.cpp M +5 -0 bind_kst.h WebSVN link: http://websvn.kde.org/?view=rev&revision=806978 If a client wants to make a "synchronous" call they should make the call as usual and then make a call to Kst.waitForUpdate(). The latter call will return only after the next update loop has completed, thereby ensuring that the actions of the original call have been fully propagated. |