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.
When an already-committed split is moved to another transaction with
xaccSplitSetParent(), the split was marked dirty *after* the old
transaction was committed. trans_cleanup_commit() only drops a
moved-out split from the old transaction's split list when the split is
dirty at that commit, so the still-clean split was left dangling in the
old transaction's split list.
On the SQL/DBI backends, destroying the now-vacated old transaction then
deleted the moved split's KVP slots (online_id, cap-gains links, ...) by
the split's own GUID, even though the split now belongs to another
transaction. The split's native columns survive -- they are rewritten
under the new tx_guid -- but its slots are lost; in some sequences the
save fails outright with "UNIQUE constraint failed: transactions.guid".
The XML backend is unaffected because it re-serializes the whole book.
Mark the split dirty before committing the old transaction so
trans_cleanup_commit() removes it from the old transaction's split list,
as that code already intends. This is a no-op for split creation (the
overwhelmingly common caller), where the prior parent is NULL.
Add a DBI round-trip regression test (sqlite3, and mysql/pgsql when the
TEST_*_URL variables are set): seed a split carrying an online_id, save
and reload, reparent it onto another transaction, destroy the old
transaction, then save and reload again and assert the online_id
survived.
Covers the final case where having the reconcile window open and
auto-completing a transaction then deleting the transaction before
committing it leaves the transaction in the reconcile window.
We need to signal that the account is modified even if it isn't
because that's what the reconcile window is watching.
The problem with take 1 was that the duplicate split uses the same lot
and account pointers without adding itself to those lists, causing
checks in unit tests to fail.
This reverts commit 4dbf803041.
The use-after free errors are caused by the compiler reordering the
steps in xaccSplitFree and Transaction's do_destroy. Unfortunately the
corrections here caused trouble in other places, leading to test failures.