[Kmymoney-devel] MyMoneyPayee storage
Fernando Vilas
fvilas at iname.com
Tue Jan 12 05:33:11 CET 2010
Hi,
I'm trying to track down the source of some issues in a db patch I have in
the works. As part of this, I added a test case to make sure that the payee
stored in the database matches a payee in memory. It does not, due to some
issues in the payee matching member variables. Here is what happens:
An object of MMPayee is created, setting m_matchKeyIgnoreCase to true.
MMDatabaseMgr adds the payee to the database by calling MMStorageSql.
MMStorageSql::writePayee calls MMPayee::matchData
MMPayee::matchData returns ignoreCase as false when m_matchingEnabled is false
On data retrieval, the new object has m_matchKeyIgnoreCase as false.
MMPayee::operator== returns false because of this difference when it is
essentially a "don't care" condition.
Since I do not want to change the storage code without getting some feedback
first, here are the options to fix this:
1) modify MMPayee::operator== to ignore the matching variables if
m_matchingEnabled is false in both operands.
2) modify MMPayee::matchData to return the actual value of
m_matchKeyIgnoreCase even when m_matchingEnabled is false.
3) Something I have not thought of yet...
Thoughts?
--
Thanks,
Fernando Vilas
fvilas at iname.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kmymoney-devel/attachments/20100111/9581c794/attachment-0001.sig
More information about the KMyMoney-devel
mailing list