Commit Graph

10 Commits

Author SHA1 Message Date
Christopher Lam
1d26d99ddb [gnc-budget] use std::optional<gnc_numeric> instead of bool+gnc_numeric
more expressive
2023-11-18 08:59:32 +08:00
Christopher Lam
3d8a28898d [gnc-budget] gnc_budget_get_account_period_note returns a const
to harmonize with all other char getters
2022-11-19 10:35:49 +08:00
Christopher Lam
2ee0c98200 [gnc-budget] use operator[] instead of find() and insert()
- avoid hashing Account* twice. one call to operator[] is sufficient.
- don't need use std::move with better constructors
- sanity check - can't have a budget with num_periods = 0
- remove unused headers
2022-11-19 10:35:43 +08:00
John Ralls
688832b5f8 Bug 798585 - segfault running sample script
The root cause of which is that on recent releases of GLib (recent
meaning 2.66 in the current Debian stable!) g_type_instance_get_private
looks in the wrong place for the private data. When running the script
in question it returned NULL and since the code didn't check for a valid
pointer, it crashed.

So this change replaces all calls to g_type_instance_get_private with
the function [type_prefix]_get_instance_private() added in glib-2.36
except for two register2 files that have been removed from master; those
are ignored to avoid unnecessary merge conflicts.
2022-07-30 16:50:51 -07:00
Christopher Lam
670902d5a8 Bug 798535 - Crash when increasing the number of periods in a budget
because in the SQL backend, gnc_budget_commit_edit will update the sql
by reading from vectors with an increased priv->num_periods.
2022-05-18 17:37:05 +08:00
Christopher Lam
a47413860a Factor out GValue access for setters and getters 2022-03-02 07:36:59 +08:00
Christopher Lam
8f845df934 Factor out make_period_[data|note]_path 2022-03-02 07:36:59 +08:00
Christopher Lam
919f392c7a Use kvp C++ interface rather than GValue 2022-03-02 07:36:59 +08:00
Christopher Lam
6c4c2512db Use C++ STL instead of GLib 2022-03-02 07:36:59 +08:00
Christopher Lam
9088acabd8 [gnc-budget.cpp] convert to c++ 2022-03-02 07:13:24 +08:00