Patch: fix missing color in qif-import account copy

Christian Stimming stimming at tuhh.de
Sun Mar 14 16:49:50 EDT 2010


Am Samstag, 13. März 2010 schrieb Tom Van Braeckel:
> The merge_children method checked this attribute when comparing two
> Account's,
> so it compared #<colorcode> to 0x0... and considered the 2 accounts to be
> different.
> 
> And that's why it didn't merge those (identical) accounts.
> 
> Another way of fixing this is just not comparing the colors when
>  determining whether 2 accounts are equal, but I assume this has been given
>  though before.

I completely agree with your expectation here: I would also expect the account 
comparison to ignore things like account color.

I also wonder why this criterion slipped into the accout comparison, as I 
don't recall it has been added anywhere by intention. Maybe this is a silent 
implication of a comparison  of the account kvp frames? But why does the 
initial copying of the accounts not copy its kvp frames? I mean, from the 
point of view of the "engine", the qif-import code is so much "downstream", it 
shouldn't have to know about whether copying an account must include copying 
its "color". Instead, the "engine" should offer a function which does the 
copying, and the qif-import uses that one and doesn't have to take care of the 
details (including the account color) by itself. Why is this not the case 
here? To me, this sounds like an error and your patch is merely a temporary 
workaround but the underlying error will cause the same problem again as soon 
as another new flag is added to the account type.

Regards,

Christian


More information about the gnucash-devel mailing list