[kde-edu]: Review Request: Default Variable Model for Cantor's Variable Management

Alexander Rieder alexanderrieder at gmail.com
Mon Sep 20 23:11:03 CEST 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5386/#review7700
-----------------------------------------------------------


API looks good. One thing: when you evaluate an expression without using the returned Expression object, you should set the FinishingBehaviour to DeleteOnFinish, so you won't leak memory. (see Session::evaluateExpression(const QString&, Expression::FinishingBehavior) )

- Alexander


On 2010-09-20 18:06:50, Miha Cancula wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5386/
> -----------------------------------------------------------
> 
> (Updated 2010-09-20 18:06:50)
> 
> 
> Review request for KDE-Edu and Alexander Rieder.
> 
> 
> Summary
> -------
> 
> This patch introduces a new class DefaultVariableModel, which can be used for convenience by the backends to show and modify their variables. It subclasses QAbstractTableModel, and provides a convenience API with functions like addVariable() and removeVariable(). 
> 
> Most of the QAbstractItemModel interface code was copied from KAlgebra's implementation. 
> 
> The patch also includes extra methods to the VariableManagementExtension not only for defining, but also for modifying and removing variables. The model uses these methods in the setData() function to modify or delete variables. This way the backend must only implement the Extension's functions and variable modifying works automatically. 
> 
> 
> Diffs
> -----
> 
>   /trunk/KDE/kdeedu/cantor/src/lib/CMakeLists.txt 1177594 
>   /trunk/KDE/kdeedu/cantor/src/lib/defaultvariablemodel.h PRE-CREATION 
>   /trunk/KDE/kdeedu/cantor/src/lib/defaultvariablemodel.cpp PRE-CREATION 
>   /trunk/KDE/kdeedu/cantor/src/lib/extension.h 1177594 
>   /trunk/KDE/kdeedu/cantor/src/lib/extension.cpp 1177594 
> 
> Diff: http://svn.reviewboard.kde.org/r/5386/diff
> 
> 
> Testing
> -------
> 
> I made the Octave backend use it, without subclassing, and all the wanted functions work. 
> 
> 
> Thanks,
> 
> Miha
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-edu/attachments/20100920/b75b0e0b/attachment.htm 


More information about the kde-edu mailing list