[Kmymoney-devel] work on models

Cristian Oneţ onet.cristian at gmail.com
Tue Feb 16 09:20:51 CET 2010

On Tue, Feb 16, 2010 at 10:10 AM, Thomas Baumgart <thb at net-bembel.de> wrote:
> On Tuesday 16 February 2010 08:51:32 Cristian Oneţ wrote:
>> On Tue, Feb 16, 2010 at 1:46 AM, Ian Neal
>> <iann_bugzilla at blueyonder.co.uk> wrote:
>> >  Cristian Oneţ wrote:
>> >> Hi,
>> >>
>> >> I've just committed a big patch that prepares the porting of the account
>> >> tree
>> >> to the model view framework. The code is not used yet (besides the
>> >> account selector) since I still need to make some minor adjustments but
>> >> if you would
>> >> like to give it a try and help me spot some possible problems here is
>> >> the patch that adds the committed accounts view above the old accounts
>> >> view so they can be compared side by side. I would appreciate it if you
>> >> would give it
>> >> a try before I do the actual replacement.
>> >>
>> >> Thanks!
>> >
>> > I noticed that in part of the big patch you have in
>> > kmymoney/models/accountsmodel.cpp, addAcountGroup function, lots of
>> > invalidateFilter(); statements at the end of each set of d->m_typelist
>> > statements, can there not just be one invalidateFilter(); statement at
>> > the end of the function or is there the chance that the function can be
>> > passed an accountTypeE that isn't captured by the various if statements?
>> > Would a select/case structure work better than multiple ifs?
>> Well I wanted to call invalidate filter only if the filtering criteria
>> was really changed but I guess that in the current state of the code
>> invalidate could also be called even if the criteria does not change
>> so I'll just call one invalidate at the end of the function to make it
>> more readable.
> In case you need to optimize it, simply use a flag and call it once at the end
> if the flag is set. Set the flag where needed. That only makes sense though,
> if calling invalidate is an expensive operation in terms of runtime.
I don't think that it's necessary in this case since the account group
is usually set up once during the construction of a view.


More information about the KMyMoney-devel mailing list