[Kmymoney-devel] work on models

Thomas Baumgart thb at net-bembel.de
Tue Feb 16 09:10:46 CET 2010

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.



Thomas Baumgart

GPG-FP: E55E D592 F45F 116B 8429   4F99 9C59 DB40 B75D D3BA
I can break things just fine by myself,
I don't need (KDE) 4.2 to help me. -- Bill Suit
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 224 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kmymoney-devel/attachments/20100216/dfedc365/attachment.sig 

More information about the KMyMoney-devel mailing list