[Kmymoney-devel] Some planning for the next release
Cristian Oneţ
onet.cristian at gmail.com
Sat Feb 6 09:13:09 CET 2010
În data de Vineri 05 Februarie 2010 14:41:32 Alvaro Soliverez a scris:
> Cristian has an idea about how to handle models, which could
> improve performance and improve the tidiness of the code. He can tell
> you more about that, since part of that might be done during the next
> release.
>
Let me tell you about this. As you know I started working on a model for
accounts. For now this model is used in the account selector widget in the
ledger (through a filtering proxy model). It's reloaded in the same place where
the old widget's data was reloaded.
Than I've went on to see what extra data would this model need to store so it
would be usable in the other account views we have in the application. After
adding functionality to it I got to the stage where the same model can be used
in the accounts view and the account selector widget (with the appropriate
filtering).
When reaching this point I came to the conclusion that we really need only one
instance of the model object per application that would be keep up to date
with the MyMoneyFile object. It would avoid executing the same loading
procedure all around the application.
To accomplish this I was thinking of making a singleton that would be the
owner of all these 'core' models (with all the data related to that model) of
the application. This would take care of loading the models and keeping them
in sync with the data from the MyMoneyFile.
When we would need a new view of a model somewhere in the application we would
write a filtering proxy model that would leave us only with the data we need to
display and maybe a custom view if needed. Like the one I have to write for
the accounts tree to be able to display the total balance of an account like
it's done now (when the item is expanded the total balance is the actual
balance of the account when it's collapsed it's the balance of the account and
the sum of the balances of the sub-accounts) and also to handle the context
menu.
Any thoughts?
--
Regards,
Cristian Oneţ
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kmymoney-devel/attachments/20100206/37e09eea/attachment.sig
More information about the KMyMoney-devel
mailing list