mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-11-02 20:30:45 -06:00
Promote the OFX/HBCI online_id to named engine accessors:
xaccSplitGetOnlineID / SetOnlineID / HasOnlineID
xaccAccountGetOnlineID / SetOnlineID
The getters return an instance-owned const char* (mirroring
xaccTransGetDocLink / xaccTransGetNotes), so the existing
add_methods_with_prefix auto-wrapper exposes them in the Python bindings
with no .i changes and no %newobject. They write to the same engine KVP
slot ("online_id") the desktop importer uses, so there is no data or
behavior change.
With the accessors in place the gnc_import_*_online_id wrappers in
import-utilities are redundant, so replace every call site (OFX,
AqBanking, and the generic matcher/backend) with them, delete
import-utilities.cpp, and drop the online_id declarations from
import-utilities.h (its importer preference-key macros are retained).
- The engine getters return an instance-owned const char* instead of a
g_strdup'd copy, so callers no longer free the result; the affected
locals are retyped const and their g_free()s dropped.
hash_account_online_ids() g_strdups before inserting, since its hash
table owns its keys (g_free key-destructor).
- xaccAccountSetOnlineID(acc, "") clears the slot, matching the OFX
"delete the online_id" intent (the old wrapper stored an empty string).
- Drop the two unused wrappers: gnc_import_set_trans_online_id (marked
"Not actually used") and gnc_import_trans_has_online_id (no callers).
- Add xaccSplitGet/SetOnlineID to the Split gmock so test-import-backend
links without import-utilities.
This directory contains unit test cases to exercise basic GnuCash engine functions. To run the tests, just do 'make check' Notes on test of dirty/clean flag: --------------------------------- This test is currently performed in part in test-customer test-employee test-job test-vendor The test cases will check if the dirty flag is unset on creation of an object and if the dirty flag is set when the object is modified. There used to be a test also to check if the dirty flag is cleared again upon committing the change. This test has been removed, because it can only be successful if a backend is set up. That's because the 'dirty' flag is supposed to be cleared by the backend only. We are in the engine test code however. In here it's not possible to load a backend without creating some circular dependencies between gnucash modules. Just for completeness, this was said on the dirty flag tests before these test cases got moved to the engine: "An object cannot be marked 'clean' unless it has actually been saved to a file or sql db. (Or, in the case of the file backend, the 'dirtiness' of the data has been duly noted, and will be taken care of for the next file save. Until its saved, it lives in perpetual dirtiness. Thus, the test cases need to specify a backend, then do the commit, then test the dirty flag. Actually, the use of the dirty flag in gnucash is, at this time, mildly ambiguous, and its semantics are not clearly defined."