<table><tr><td style="">asemke created this revision.<br />asemke added a reviewer: Cantor.<br />asemke added a project: Cantor.<br />Herald added a project: KDE Edu.<br />Herald added a subscriber: kde-edu.<br />asemke requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D16174">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>There were two major problems with the handling of the generated plot images for python:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">using of a non-initialized boolean m_finished variable in PythonExpression which caused unstable results (plots are shown or not)</li>
<li class="remarkup-list-item">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.</li>
</ul>

<p>This patch addresses both of these problems and also greatly simplifies the code:</p>

<ul class="remarkup-list">
<li class="remarkup-list-item">QFileSystemWatcher is used to monitor one single file relevant for the plot image only</li>
<li class="remarkup-list-item">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.</li>
<li class="remarkup-list-item">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.</li>
</ul></div></div><br /><div><strong>TEST PLAN</strong><div><p>Different tests with matplotlib examples showing much more stable behavior in Cantor now with respect to the handling of plot images.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R55 Cantor</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D16174">https://phabricator.kde.org/D16174</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/backends/python/pythonexpression.cpp<br />
src/backends/python/pythonexpression.h<br />
src/backends/python/pythonsession.cpp<br />
src/backends/python/pythonsession.h<br />
src/lib/expression.cpp<br />
src/lib/expression.h</div></div></div><br /><div><strong>To: </strong>asemke, Cantor<br /><strong>Cc: </strong>kde-edu, narvaez, apol<br /></div>