This required some adjustments:
* New warnings character-conversion and deprecated-volatile are
disabled for the reasons indicated in the adjacent comments.
* C23 is a lot stricter about function pointer signatures so some
callbacks in gnc-frequency.c and dialog-sx-editor had to be cast using
the long-available GLib macros.
* C++23 is stricter about a reference (foo&) parameter taking an
lvalue only; a lambda used in several csv-importer files was trying to
pass an rvalue so the parameter had to be changed to perfect
forward (foo&&).
* C++23 doesn't allow oring together enum values from different enum
types, even anonymous ones, so the two gnc_numeric enums for rounding
and denominators are combined into a single enum GncNumericRoundDenom.
* C++20's new automatic generation of comparison functions combined
with its stricter automatic conversion rules caused trouble with
operator==() and operator!=() for gnc::GUID and GncGUID, complaining
about ambiguity or not being able to find operator==(const GncGuid&,
const GncGuid&). The fix has two parts: Changing operator!=(const
gnc::GUID&, const gnc::GUID&) to operator==(const gnc::GUID&, const
gnc::GUID&) to resolve the conversion problem and changing the call
forwarding operator==(const GncGuid&, const GncGuid&) to only cast the
first argument to gnc::GUID so that it could work unambiguously with
operator==(const gnc::GUID&, const GncGuid&).
* python sqlite3test: C23 apparently makes AppleClang a lot pickier
about includes.
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.
Change the Import Map Editor to look for the KVP slot
"ofx/associated-income-account" so it can be listed. The account
reference stored is a GUID so add a function to retrieve that so the
existing gnc_account_delete_map_entry function can be used to remove it.
Chris Lam pointed out that the original algo would crash if a
transaction had more than one split in the account being deleted.
Deduplicate the transaction vector first to protect against that.
Also suspend qof events for a 4x speedup.
New function xaccAccountDeleteAllTransactions.
Delete all transactions before deleting the account; simply deleting the
splits during account destruction isn't safe. In the particular case of an
imbalance account the transaction commit after deleting a split just makes
a new one.
Destroying the split vector from front->back crashes halfway through
because the iterators aren't updated as we remove items from the
vector. Iterating in reverse works because the remaining elements
aren't moved as we delete.
transaction change.
This also reverts commit 60ccca017 and fixes Bug 799347 in a different
way that avoids the problems found during the investigation of 799370
and reported on gnucash-user.
Send QOF_EVENT_REMOVE on the child before actually removing it from
the children vector so that the stored indexes are valid long enough
to clear them.
whereby deleting an account and moving all splits to another account
would segfault. make a copy of priv->splits and work on the copy
rather than the original.