[Kmymoney-devel] MyMoneyPayee storage
Thomas Baumgart
thb at net-bembel.de
Tue Jan 12 08:50:31 CET 2010
On Tuesday 12 January 2010 05:33:11 Fernando Vilas wrote:
> 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?
3) is a bit hard to comment on :)
I'd vote for 2) and also change MMPayee::setMatchData to always store the
value passed in m_matchKeyIgnoreCase. Also, we should backport this change
to the KDE3 version.
--
Regards
Thomas Baumgart
GPG-FP: E55E D592 F45F 116B 8429 4F99 9C59 DB40 B75D D3BA
-------------------------------------------------------------
To the optimist, the glass is half full. To the pessimist,
the glass is half empty. To the engineer, the glass is
twice as big as it needs to be.
-------------------------------------------------------------
-------------- 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/20100112/7f198fad/attachment.sig
More information about the KMyMoney-devel
mailing list