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

Miha Cancula miha.cancula at gmail.com
Mon Sep 20 20:06:50 CEST 2010


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

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/1038ff6b/attachment.htm 


More information about the kde-edu mailing list