mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Implement flat bayes kvp
The bayes data are stored in the KVP store. Before this commit, they are stored under /import-map-bayes/<token>/<account guid>/count (where count is the datum that "matters" in bayes matching). The problem with this is that any token including the kvp delimiter (currently '/') gets divided, and is not found correctly during bayes kvp searching. The quickest solution to this is to replace all "/" characters with some other character. That has been done, along with a re-structuring of the bayes matching code to take advantage of c++ features to make the code more concise and readable. Also modified some test functions to fix leaks and double-frees: the same kvp value can't be in the kvp tree twice. Also, when I added code to clean up after the tests, some things started breaking due to double-delete. Apparently const_cast was hiding some programming errors. Really? You don't say? When giving a GUID* to KvpValue, the latter takes ownership of the former.
This commit is contained in:
@@ -1454,6 +1454,10 @@ void gnc_account_delete_map_entry (Account *acc, char *full_category, gboolean e
|
||||
*/
|
||||
void gnc_account_imap_convert_bayes (QofBook *book);
|
||||
|
||||
/** Change the bayes imap entries from a nested representation to a flat representation.
|
||||
*/
|
||||
void gnc_account_imap_convert_flat (QofBook *);
|
||||
|
||||
/** @} */
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user