D16174: Fixed the handling of plot images for python
noreply at phabricator.kde.org
Sat Oct 13 09:08:34 BST 2018
asemke created this revision.
asemke added a reviewer: Cantor.
asemke added a project: Cantor.
Herald added a project: KDE Edu.
Herald added a subscriber: kde-edu.
asemke requested review of this revision.
There were two major problems with the handling of the generated plot images for python:
- using of a non-initialized boolean m_finished variable in PythonExpression which caused unstable results (plots are shown or not)
- using of KDirWatch which monitored the whole temp directory for changes and which, in addition to performance problems because of the many changes in the temp folder, lead to strange side effects when a plot image generated in one python session was shown in another python session since both were monitoring the same temp folder.
This patch addresses both of these problems and also greatly simplifies the code:
- QFileSystemWatcher is used to monitor one single file relevant for the plot image only
- Moved the handling of images from PythonSession to PythonExpression and further simplified it. The code is similar to the handling of plot images for Maxima now.
- QFileSystemWatcher* is part of Expression - here the proposal is to put this to the base class since this is needed for all backends (MaximaExpression, PythonExpression, etc.) and to move the code to using this new member in Expression step by step.
Different tests with matplotlib examples showing much more stable behavior in Cantor now with respect to the handling of plot images.
To: asemke, #cantor
Cc: kde-edu, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the kde-edu