[Kmymoney-devel] Re: Review Request: Accounts model optimization

Cristian Onet onet.cristian at gmail.com
Sun Mar 6 20:51:17 CET 2011


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

(Updated March 6, 2011, 7:51 p.m.)


Review request for kmymoney.


Changes
-------

Since AccountsModel::load() should only be called once when the model is empty don't try to search for the item that represents an account anymore because it's sure that it will not be found.
Fixed some issues reported bellow without the ones requiring more debug statements. I really am against adding extra null pointer tests on function assertions. I mean it is an assertion that all existing accounts should be represented by an item then it should not be necessary to test for null pointers some places where Thomas requested that. If that happens then there is a really big bug there anyway and I prefer it to crash then to ignore the error or pollute the code with null pointer checks followed by qDebug statements.


Summary
-------

Instead of synchronizing the whole account tree on each data changed take advantage of the new, more granular, signals and perform the appropriate modifications in the model's data after it has been loaded once.

Also create a separate instance for the institutions model. This change has the following rationale. Mixing the two hierarchies in the same model (by account type and institution) would make it difficult to implement changes since depending on the changes it would imply structural modifications in only one instance of the same account. So for example changing the institution means a structural change in the institution hierarchy but no change in the accounts by type hierarchy. Separating the two hierarchies means that one account can be found only once in the model and it also simplifies the implementation of the modifications slots.


This addresses bug 230277.
    https://bugs.kde.org/show_bug.cgi?id=230277


Diffs (updated)
-----

  /trunk/extragear/office/kmymoney/kmymoney/models/accountsmodel.h 1223871 
  /trunk/extragear/office/kmymoney/kmymoney/models/accountsmodel.cpp 1223871 
  /trunk/extragear/office/kmymoney/kmymoney/models/models.h 1223871 
  /trunk/extragear/office/kmymoney/kmymoney/models/models.cpp 1223871 
  /trunk/extragear/office/kmymoney/kmymoney/views/kinstitutionsview.cpp 1223871 
  /trunk/extragear/office/kmymoney/kmymoney/views/kmymoneyview.cpp 1223871 

Diff: http://svn.reviewboard.kde.org/r/6589/diff


Testing
-------

Simple testing using a test file: adding/removing/modifying accounts and modifying banances.


Thanks,

Cristian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kmymoney-devel/attachments/20110306/4b6ff116/attachment-0001.htm 


More information about the KMyMoney-devel mailing list